http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/28254044
tags question: http://stackoverflow.com/q/28234347
tags question: http://stackoverflow.com/q/28160993
tags question: http://stackoverflow.com/q/28202359
tags question: http://stackoverflow.com/q/28254023
tags question: http://stackoverflow.com/q/28148516
tags question: http://stackoverflow.com/q/28148588
tags question: http://stackoverflow.com/q/28271418
tags question: http://stackoverflow.com/q/28243732
tags question: http://stackoverflow.com/q/28215637
tags question: http://stackoverflow.com/q/28161590
tags question: http://stackoverflow.com/q/28140772
tags question: http://stackoverflow.com/q/28140954
tags question: http://stackoverflow.com/q/28159719
tags question: http://stackoverflow.com/q/28177942
tags question: http://stackoverflow.com/q/28179394
tags question: http://stackoverflow.com/q/28199272
tags question: http://stackoverflow.com/q/28151696
tags question: http://stackoverflow.com/q/28249545
tags question: http://stackoverflow.com/q/28159283
tags question: http://stackoverflow.com/q/28220805
tags question: http://stackoverflow.com/q/28156987
tags question: http://stackoverflow.com/q/28217575
tags question: http://stackoverflow.com/q/28144815
tags question: http://stackoverflow.com/q/28124651
tags question: http://stackoverflow.com/q/28207616
tags question: http://stackoverflow.com/q/28151207
tags question: http://stackoverflow.com/q/28275075
tags question: http://stackoverflow.com/q/28264835
tags question: http://stackoverflow.com/q/28176225
tags question: http://stackoverflow.com/q/28242783
tags question: http://stackoverflow.com/q/28157941
tags question: http://stackoverflow.com/q/28163514
tags question: http://stackoverflow.com/q/28144858
tags question: http://stackoverflow.com/q/28269179
tags question: http://stackoverflow.com/q/28230548
tags question: http://stackoverflow.com/q/28220531
tags question: http://stackoverflow.com/q/28126490
tags question: http://stackoverflow.com/q/28217928
tags question: http://stackoverflow.com/q/28147755
tags question: http://stackoverflow.com/q/28240772
tags question: http://stackoverflow.com/q/28275101
tags question: http://stackoverflow.com/q/28225252
tags question: http://stackoverflow.com/q/28262201
tags question: http://stackoverflow.com/q/28232134
tags question: http://stackoverflow.com/q/28253114
tags question: http://stackoverflow.com/q/28197458
tags question: http://stackoverflow.com/q/28198707
tags question: http://stackoverflow.com/q/28236522
tags question: http://stackoverflow.com/q/28152698
tags question: http://stackoverflow.com/q/28249577
tags question: http://stackoverflow.com/q/28236910
tags question: http://stackoverflow.com/q/28272358
tags question: http://stackoverflow.com/q/28272968
tags question: http://stackoverflow.com/q/28175276
tags question: http://stackoverflow.com/q/28207919
tags question: http://stackoverflow.com/q/28187109
tags question: http://stackoverflow.com/q/28173902
tags question: http://stackoverflow.com/q/28162090
tags question: http://stackoverflow.com/q/28204397
tags question: http://stackoverflow.com/q/28234904
tags question: http://stackoverflow.com/q/28214844
tags question: http://stackoverflow.com/q/28245571
tags question: http://stackoverflow.com/q/28237688
tags question: http://stackoverflow.com/q/28205925
tags question: http://stackoverflow.com/q/28227988
tags question: http://stackoverflow.com/q/28133649
tags question: http://stackoverflow.com/q/28228098
tags question: http://stackoverflow.com/q/28159613
type: Tag
tags question: http://stackoverflow.com/q/28197581
tags question: http://stackoverflow.com/q/28233725
tags question: http://stackoverflow.com/q/28238082
tags question: http://stackoverflow.com/q/28233505
tags question: http://stackoverflow.com/q/28170535
tags question: http://stackoverflow.com/q/28260691
tags question: http://stackoverflow.com/q/28203415
tags question: http://stackoverflow.com/q/28268982
tags question: http://stackoverflow.com/q/28168456
tags question: http://stackoverflow.com/q/28211074

http://stackoverflow.com/a/28246665
has comment: http://stackoverflow.com/comment/44854329
answers question: http://stackoverflow.com/q/28246564
accepted answer of: http://stackoverflow.com/q/28246564
type: AcceptedAnswer
downvote count: 0
has body: You can save the need to re-apply the handler to all the appended elements by having a single delegated click handler on a common parent element. First of all amend your HTML to include the container, in this case #element-container: Button Button Add Element Then you can amend the Add Element button to append to that container: $('div.add-element').click(function (event) { $('div.element-holder').children('div').clone().appendTo('#element-container'); }); Finally you can add the delegated event handler to the new #element-container. Note that I also shortened the logic using toggle() and siblings(): $('#element-container').on('click', 'div.button', function (event) { $(this).siblings('.green-square').toggle() }); Example fiddle
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/28161166
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44695405
type: Question
score: 5
upvote count: 5
tagged with: javascript
has body: When zooming an HTML page in a desktop browser a fixed position div will scale like the rest of the page and keep its position fixed relative to the viewport. This used to also be the case on the Chrome mobile browser (It still behaved that way in version 39), but on Chrome for mobile 40 it started behaving similar to Safari for mobile and when the page is scaled fixed elements are fixed to the scaled document at the point that they would have been positioned at if the page were at 100% zoom (with some caveats). This is a page with a div with position:fixed http://betterstatistics.org/tests/fixedpos For mobile I scale the div according to zoom, and keeping the position:fixed property so that I don't have to reposition it on scroll, I would like to set the position according to the zoom. Here is my attempt: http://betterstatistics.org/tests/fixedpos/attempt001.html (for mobile only) The relevant lines: orig_w = 300; orig_h = 100; document.body.addEventListener('touchend', repositionDiv); function repositionDiv(){ var zoom = getZoom(); var d1 = document.getElementById("div_br"); var w = (orig_w / zoom); var h = (orig_h / zoom); d1.style.width = w + 'px'; d1.style.height = h + 'px'; d1.style.left = (window.scrollX + window.innerWidth - d1.offsetWidth) +'px'; d1.style.top = (window.innerHeight - d1.offsetHeight) +'px'; } function getZoom(){ return document.documentElement.clientWidth / window.innerWidth; } It almost works on Android Chrome for mobile, but I haven't managed to get the height position after scrolling correct, I also tried: d1.style.top = (window.scrollY + window.innerHeight - d1.offsetHeight) +'px'; and: d1.style.top = (window.scrollY / zoom + window.innerHeight - d1.offsetHeight) +'px'; I know there are some similar questions, but most are in JQuery, and I didn't see one with a solution, they were also mostly concerning iOS, but for now I am more interested in Android Chrome.
has answer: http://stackoverflow.com/a/59128027
tagged with: chrome-for-android
answer count: 1
downvote count: 0
has title: Fixed position div on zoomed browser window on mobile
favorite count: 0
tagged with: css-position

http://stackoverflow.com/comment/44773540
has text: @Rhapx you right I changed it as you see and get new error
type: AnswerComment
comment on: http://stackoverflow.com/a/28203745
score: 0
type: Comment

http://stackoverflow.com/comment/44792493
type: QuestionComment
comment on: http://stackoverflow.com/q/28213936
score: 1
has text: are you changint `v` parameter after compiling create.js? also have you tried to modify headers send by your http server with expires date
type: Comment

protractor
tags question: http://stackoverflow.com/q/28213465
tags question: http://stackoverflow.com/q/28188957
tags question: http://stackoverflow.com/q/28188751
tag name: protractor
tags question: http://stackoverflow.com/q/28168734
tags question: http://stackoverflow.com/q/28144929
tags question: http://stackoverflow.com/q/28186053
tags question: http://stackoverflow.com/q/28202069
tags question: http://stackoverflow.com/q/28195892
tags question: http://stackoverflow.com/q/28224411
type: Tag
tags question: http://stackoverflow.com/q/28158199
tags question: http://stackoverflow.com/q/28211053

http://stackoverflow.com/comment/44894523
type: Comment
has text: How about creating an Angular sample app with your logic on Plnkr or Jsfiddle then I can help debug?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28208585

http://stackoverflow.com/a/28215931
answers question: http://stackoverflow.com/q/28215878
upvote count: 4
downvote count: 0
type: Answer
has body: You can not use innerHTML for the input type. If you have to set the value for the input then you have to use the follwing code : var message = url; document.getElementById('result').value = message;
score: 4

http://stackoverflow.com/a/28276928
score: -7
answers question: http://stackoverflow.com/q/28174609
has comment: http://stackoverflow.com/comment/44937051
type: Answer
downvote count: 7
has body: <ion-view title="sample page"> Your browser does not support iframes. <ion-view> it will work scroll option is default true.no need to add specifically
has comment: http://stackoverflow.com/comment/44911568
upvote count: 0

http://stackoverflow.com/q/28199670
has body: I am currently calling on the gapi.signIn method in more than one place with an app. When user is signing in When user is signing up When user wants to link their app account to their Google account So the gapi.signIn() is being called in each of these instances, with a different callback parameter. Since this is a single-page-app once all the actions have been performed without reloading the page, and latter calls to anyone of the above methods results in each of the callbacks to be fired. Ex. If a user signs in, then logs out and tries to create a new they are told their google account is already tied to an account (this is the expected behaviour). However if they try to signin again, the previous callback that was called when trying to create a user is fired again and they will be again be sent to the page explaining that the google account is tied to an app account. To explain things with a simple code example: var ENV = {...}; function handleClickOfButton_1() { window.authCallback_1 = function() { console.log('callback 1'); }; // attach callback one gapi.auth.signIn({ clientid: ENV.APP.GOOGLE_AUTH.clientid, scope: ENV.APP.GOOGLE_AUTH.scope, cookiepolicy: 'single_host_origin', callback: 'authCallback_1', }); } function handleClickOfButton_2() { window.authCallback_2 = function() { console.log('callback 2'); }; // attach callback one gapi.auth.signIn({ clientid: ENV.APP.GOOGLE_AUTH.clientid, scope: ENV.APP.GOOGLE_AUTH.scope, cookiepolicy: 'single_host_origin', callback: 'authCallback_2', }); } If I click button one, which triggers the first handler, the signIn method will be called once, if I then click the second button, BOTH callback methods will be called. Output: // click button 1 &gt; callback 1 // click button 2 &gt; callback 1 &gt; callback 2 How can I prevent this? I haven't been able to find a reset method. Using the same callback method name, doesn't help. Overriding the window.[method_name] doesn't work either.
tagged with: javascript
tagged with: google-authentication
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/29877786
type: Question
has title: gapi.signIn calling more than one callback

http://stackoverflow.com/q/28181205
has comment: http://stackoverflow.com/comment/44732413
type: Question
has answer: http://stackoverflow.com/a/28181456
answer count: 2
has answer: http://stackoverflow.com/a/28181429
possible better answer: http://stackoverflow.com/a/28181456
linked to: http://stackoverflow.com/q/11922383
score: 0
has comment: http://stackoverflow.com/comment/44732028
has body: My goal is to start with a JSON object. This is not the Object I will be working with, but it will do for the example. var json = [ {"id":"1","age":"20", "region":"Y"}, {"id":"2", "age":"20", "region":"X"}, {"id":"3", "age":"31", "region":"Z"}, {"id":"4", "age":"35", "region":"Q"} ]; Lets say my goal is to sort the region based off of the age. I wish to create a function that will split json into this: var newObj = [ [ {"id":"1","age":"20", "region":"Y"}, {"id":"2", "age":"20", "region":"X"} ], [ {"id":"3", "age":"31", "region":"Z"} ], [ {"id":"4", "age":"35", "region":"Q"} ] ]; Then I could sort the new arrays. I will never know what the ages will be or how many arrays I will need to be created. Thank you for your help.
has comment: http://stackoverflow.com/comment/44732495
has comment: http://stackoverflow.com/comment/44731946
tagged with: javascript
has title: how can i create an undetermined number of arrays to place JSON objects in (javascript)
accepted answer: http://stackoverflow.com/a/28181429
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44731691

http://stackoverflow.com/q/28130031
has comment: http://stackoverflow.com/comment/44633369
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28130142
answer count: 1
has body: I want to add more types to my Google Places autocomplete request. Currently I'm allowing cities in the US, but I want to allow cities and counties. Is counties possible? Here is what I have. var options = { types: ['(cities)'], componentRestrictions: { country: "us" } };
tagged with: google-places
tagged with: google-places-api
type: UnansweredQuestion
type: Question
has title: How to add more filters to google places autocomplete types

javascript
tags question: http://stackoverflow.com/q/28211066
tags question: http://stackoverflow.com/q/28240051
tags question: http://stackoverflow.com/q/28167484
tags question: http://stackoverflow.com/q/28227214
tags question: http://stackoverflow.com/q/28185200
tags question: http://stackoverflow.com/q/28170243
tags question: http://stackoverflow.com/q/28122784
tags question: http://stackoverflow.com/q/28279547
tags question: http://stackoverflow.com/q/28226851
tags question: http://stackoverflow.com/q/28272640
tags question: http://stackoverflow.com/q/28208998
tags question: http://stackoverflow.com/q/28209435
tags question: http://stackoverflow.com/q/28250268
tags question: http://stackoverflow.com/q/28237229
tags question: http://stackoverflow.com/q/28222228
tags question: http://stackoverflow.com/q/28177540
tags question: http://stackoverflow.com/q/28163821
tags question: http://stackoverflow.com/q/28247867
tags question: http://stackoverflow.com/q/28276108
tags question: http://stackoverflow.com/q/28257287
tags question: http://stackoverflow.com/q/28182119
tags question: http://stackoverflow.com/q/28183907
tags question: http://stackoverflow.com/q/28275307
tags question: http://stackoverflow.com/q/28279346
tags question: http://stackoverflow.com/q/28248809
tags question: http://stackoverflow.com/q/28195055
tags question: http://stackoverflow.com/q/28273846
tags question: http://stackoverflow.com/q/28260667
tags question: http://stackoverflow.com/q/28225536
tags question: http://stackoverflow.com/q/28172527
tags question: http://stackoverflow.com/q/28219381
tags question: http://stackoverflow.com/q/28276179
tags question: http://stackoverflow.com/q/28219238
tags question: http://stackoverflow.com/q/28240035
tags question: http://stackoverflow.com/q/28181509
tags question: http://stackoverflow.com/q/28223703
tags question: http://stackoverflow.com/q/28189416
tags question: http://stackoverflow.com/q/28253203
tags question: http://stackoverflow.com/q/28215286
tags question: http://stackoverflow.com/q/28185218
tags question: http://stackoverflow.com/q/28179031
tags question: http://stackoverflow.com/q/28205914
tags question: http://stackoverflow.com/q/28209705
tags question: http://stackoverflow.com/q/28279351
tags question: http://stackoverflow.com/q/28152248
tags question: http://stackoverflow.com/q/28266806
tags question: http://stackoverflow.com/q/28128150
tags question: http://stackoverflow.com/q/28135168
tags question: http://stackoverflow.com/q/28167876
tags question: http://stackoverflow.com/q/28252068
tags question: http://stackoverflow.com/q/28197418
tags question: http://stackoverflow.com/q/28249067
tags question: http://stackoverflow.com/q/28258989
tags question: http://stackoverflow.com/q/28224858
tags question: http://stackoverflow.com/q/28154527
tags question: http://stackoverflow.com/q/28176864
tags question: http://stackoverflow.com/q/28144445
tags question: http://stackoverflow.com/q/28200428
tags question: http://stackoverflow.com/q/28123068
tags question: http://stackoverflow.com/q/28246809
tags question: http://stackoverflow.com/q/28225390
tags question: http://stackoverflow.com/q/28247451
tags question: http://stackoverflow.com/q/28139332
tags question: http://stackoverflow.com/q/28193510
tags question: http://stackoverflow.com/q/28239900
tags question: http://stackoverflow.com/q/28273684
tags question: http://stackoverflow.com/q/28136806
tags question: http://stackoverflow.com/q/28271771
tags question: http://stackoverflow.com/q/28251501
tags question: http://stackoverflow.com/q/28197441
tags question: http://stackoverflow.com/q/28172018
tags question: http://stackoverflow.com/q/28156166
tags question: http://stackoverflow.com/q/28253334
tags question: http://stackoverflow.com/q/28168946
tags question: http://stackoverflow.com/q/28136231
tags question: http://stackoverflow.com/q/28136574
tags question: http://stackoverflow.com/q/28273816
tags question: http://stackoverflow.com/q/28221566
tags question: http://stackoverflow.com/q/28215208
tags question: http://stackoverflow.com/q/28188417

http://stackoverflow.com/q/28259932
score: 1
has answer: http://stackoverflow.com/a/30853554
upvote count: 1
type: Question
tagged with: phaser-framework
tagged with: javascript
tagged with: game-development
has comment: http://stackoverflow.com/comment/45089001
answer count: 1
downvote count: 0
has title: Phaser - Sprite being placed underneath instead of ontop another sprite?
favorite count: 0
has body: I am making a game with phaser and from my understanding, the z-Index of sprites depends on the order they were preloaded and added to the game world. I have these 3 sprites called table, cup, and ball. I am preloading and adding them to the game world in that order, so that ball is displayed above table and cup. However, ball is being displayed above table, yet underneath cup (undesired and game breaking!) How can I make sure ball will always be displayed on top of cup (from a top-down 2d perspective). game.js window.onload = function() { var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('table', 'assets/img/table.png'); game.load.image('cup', 'assets/img/cup.png'); game.load.image('ball', 'assets/img/ball.png'); } var table; var cups; var cup; var ball; var ballAscending = true; var ballThrown = false; function create() { game.physics.startSystem(Phaser.Physics.ARCADE); table = game.add.sprite(game.world.centerX, game.world.centerY, 'table'); table.anchor.setTo(0.5,0.5); var cupW = game.cache.getImage('cup').width; var cupH = game.cache.getImage('cup').height; cups = game.add.group(game,game.world,'cups',false,true,Phaser.Physics.ARCADE); cup = cups.create(game.world.centerX, cupH / 2, 'cup'); cup = cups.create(game.world.centerX - cupW, cupH / 2, 'cup'); cup = cups.create(game.world.centerX + cupW, cupH / 2, 'cup'); cup = cups.create(game.world.centerX - cupW / 2, cupH + (cupH / 2), 'cup'); cup = cups.create(game.world.centerX + cupW / 2, cupH + (cupH / 2), 'cup'); cup = cups.create(game.world.centerX, (cupH * 2) + (cupH / 2), 'cup'); cup = cups.create(game.world.centerX, game.world.height - (cupH / 2), 'cup'); cup = cups.create(game.world.centerX - cupW, game.world.height - (cupH / 2), 'cup'); cup = cups.create(game.world.centerX + cupW, game.world.height - (cupH / 2), 'cup'); cup = cups.create(game.world.centerX - cupW / 2, game.world.height - (cupH /…
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44877573

http://stackoverflow.com/comment/44835494
has text: @Aleks I've quoted directly from the current documentation, take it or leave it
type: Comment
comment on: http://stackoverflow.com/a/28216454
score: 0
type: AnswerComment

http://stackoverflow.com/q/28228477
score: 0
answer count: 1
has title: Get select to same width as a text box in bootstrap rails
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: ruby-on-rails
linked to: http://stackoverflow.com/q/7420434
has answer: http://stackoverflow.com/a/28228578
type: Question
tagged with: javascript
tagged with: jquery
has body: I have a form in rails (4.1.5) using bootstrap (3.3.2). The form has an input textbox and a select. I am using jquery to make the select to be the same width as the textbox. Here's the strange thing: the width of the select element is being changed by jquery, but it is reading the textbox width and setting the select's width as 167 pixels, whereas the text box in chrome is actually 193 pixels. Here is _form.html.erb : <%= form_for foo do |f| %> <%= f.text_field :name, placeholder: 'Name', id: 'foo-name-input', class: 'form-control' %> <%= f.collection_select(:foo_type, @foo_types.keys.to_a.map{|k|[k.humanize, k]}, :last, :first, {}, {class: 'form-control', id: 'foo-type-select'}) %> <%= f.submit class: 'btn btn-default' %> <% end %> ...

http://stackoverflow.com/a/28260864
score: 2
has comment: http://stackoverflow.com/comment/44902107
has comment: http://stackoverflow.com/comment/44898781
has body: First, you need to retrieve the token from response headers, so update your service to: userFactory.create = function(userData) { return $http.post('/api/signup', userData) .then(function(data, status, headers, config, status) { return data; }); } Then you can read the token from controller User.create(vm.userData) .then(function(data) { vm.processing = false; vm.userData = {}; vm.message = data.message; // remember to reference $window in your controller $window.localStorage.setItem('token', data.token); $location.path('/') }); After users login or signup, next time when you send requests to backend, you can add token to headers manually. var req = { method: 'POST', url: 'http://example.com', headers: { 'Authentication': $window.localStorage.getItem('token') }, data: { test: 'test' }, } $http(req).success(function(){...}).error(function(){...});
has comment: http://stackoverflow.com/comment/44897060
has comment: http://stackoverflow.com/comment/44896462
has comment: http://stackoverflow.com/comment/44899458
has comment: http://stackoverflow.com/comment/44899535
has comment: http://stackoverflow.com/comment/44899633
has comment: http://stackoverflow.com/comment/44896418
has comment: http://stackoverflow.com/comment/44900103
accepted answer of: http://stackoverflow.com/q/28260537
upvote count: 2
has comment: http://stackoverflow.com/comment/44899849
answers question: http://stackoverflow.com/q/28260537
has comment: http://stackoverflow.com/comment/44899174
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44897197
downvote count: 0
has comment: http://stackoverflow.com/comment/45017372
has comment: http://stackoverflow.com/comment/44897790
has comment: http://stackoverflow.com/comment/44900087
has comment: http://stackoverflow.com/comment/44899960
has comment: http://stackoverflow.com/comment/44897219
has comment: http://stackoverflow.com/comment/44896645
type: Answer
has comment: http://stackoverflow.com/comment/44896890
has comment: http://stackoverflow.com/comment/44899092
has comment: http://stackoverflow.com/comment/44896605
has comment: http://stackoverflow.com/comment/44896489
has comment: http://stackoverflow.com/comment/44900358

http://stackoverflow.com/comment/44655762
has text: Whatever you do in the constructor, it will not be evaluated until you invoke the constructor. Without a `new Foo()`, there will be no `xx` anywhere. And it's not on the prototype either.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28141267

http://stackoverflow.com/a/36770556
answers question: http://stackoverflow.com/q/28188417
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28188417
has body: To trigger a sort you should be able to do: $(selector).jstree(true).sort(root, true); $(selector).jstree(true).redraw_node(root, true);
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/106689258

http://stackoverflow.com/comment/44625263
type: Comment
type: QuestionComment
has text: http://api.jquery.com/jquery.ajax/ is likely a better place than anything from w3schools
comment on: http://stackoverflow.com/q/28125929
score: 0

http://stackoverflow.com/comment/44676283
type: QuestionComment
comment on: http://stackoverflow.com/q/28152401
has text: Did you check the documentation for [`:visible`](http://api.jQuery.com/visible-selector/), or did it just 'sound right,' from the name?
score: 0
type: Comment

http://stackoverflow.com/comment/44850353
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28229729
has text: @NickBortolotti Please see an update. I have no clue, why the explicit cast is required here; I was sure it should not be needed. Anyway, the updated version should work for you. Cheers.

http://stackoverflow.com/a/28146821
has comment: http://stackoverflow.com/comment/83722288
answers question: http://stackoverflow.com/q/28146748
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/83825896
has comment: http://stackoverflow.com/comment/44665212
accepted answer of: http://stackoverflow.com/q/28146748
type: Answer
has comment: http://stackoverflow.com/comment/44665771
score: 0
upvote count: 1
downvote count: 1
has body: Yes, attaching event handlers to the window's onmousemove and onmouseup (to detach the dynamically added event handlers) events works well, then the events fire even when the mouse moves outside the window. Easy enough to do with addEventListener inside React's onmousedown event.

http://stackoverflow.com/comment/44896783
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28223086
has text: Thanks, this sounds sensible.

http://stackoverflow.com/q/28236522
has answer: http://stackoverflow.com/a/28237293
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
upvote count: 2
accepted answer: http://stackoverflow.com/a/28237293
type: AnsweredQuestion
tagged with: foreach
possible better answer: http://stackoverflow.com/a/28238367
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28238367
has body: I have a list of students and whether or not they were present or absent from the class. var studentList = [ {id: '111', name: 'Anna', present: '1'}, {id: '222', name: 'Bob', present: '1'}, {id: '333', name: 'Cath', present: '1'}, {id: '111', name: 'Anna', present: '0'}, {id: '222', name: 'Bob', present: '0'}, {id: '333', name: 'Cath', present: '1'} ]; I want to output some html that producers the below result. Cath || 2 Anna || 1 Bob || 1 What I want to do is foreach id count if the student is present or absent then provide a total at the bottom of the page. This is what I have so far. {{ student.name }} ||{{student.present}} How do I go about getting a presentTotal for each student, so that I can display it as I showed above? see codepen demo
type: Question
has title: angularjs increment items in a json feed
answer count: 2
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/44625277
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28125970
has text: Well, it was valid syntax, it just wouldn't work, but that bit was the OP's code :)
type: AnswerComment

http://stackoverflow.com/comment/48723048
type: AnswerComment
has text: @wawa OK, true, I just used OP's code. I will leave it as is to keep it simple (instead of using `call` to pass the `this` to the function when using event handler content attributes).
comment on: http://stackoverflow.com/a/28174022
type: Comment
score: 0

http://stackoverflow.com/comment/44673381
score: 0
type: Comment
type: QuestionComment
has text: `var newnode = l.add(val)` <-- that is wrong
comment on: http://stackoverflow.com/q/28150936

http://stackoverflow.com/comment/44696426
type: Comment
score: 1
has text: We all start somewhere. What's obvious to you or me might not be so obvious to someone starting out, and SO is for programming Questions and Answers. So why we all debate whether to answer the question, some poor guy is tearing his hair out trying to learn. Took me longer to type this than answer the question :). I suppose whether it's a good question or not probably depends on if you're the guy tearing your hair out.
comment on: http://stackoverflow.com/a/28162550
type: AnswerComment

http://stackoverflow.com/q/28187703
upvote count: 1
has body: I must not understand how to change the content of my tag. Here is my html file: simple Enter url: Click me Here is my .js file: function myFunction() { alert('hey'); document.getElementById("results").innerHTML = "Hello World"; } When I click the button the alert pops up but the html does not change to "Hello World". It just stays the same :( What am I doing wrong here. Update: Thanks everyone! Here is what I have working now: HTML: simple Enter url: Click me No Click me My .js file: function say_something(s) { document.getElementById("results").innerHTML = s; } document.getElementById("clickme").addEventListener("click", function(){ var url = document.getElementById('myurl').value; if (url==null || url=="") { alert("Please supply a url"); return false; } say_something( "Hello World [" + url + "]"); }); document.getElementById("noclickme").addEventListener("click", function(){ var url = document.getElementById('myurl').value; if (url==null || url=="") { alert("Please supply a url"); return false; } say_something( "Goodbye [" + url + "]"); });
favorite count: 0
has answer: http://stackoverflow.com/a/28188103
has answer: http://stackoverflow.com/a/28187780
accepted answer: http://stackoverflow.com/a/28187780
has title: Cannot change html content of div tag
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28188103
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/44770468
type: Comment
comment on: http://stackoverflow.com/q/28202077
score: 0
type: QuestionComment
has text: Yes, it was a demonstration. And I think Huangism raises a very good point, thank you

http://stackoverflow.com/comment/44657305
score: 0
has text: that does not seem to work as they just get overwritten by the first statement... any way to provide a sample code? thanks
type: Comment
comment on: http://stackoverflow.com/a/28140462
type: AnswerComment

http://stackoverflow.com/comment/44773973
type: AnswerComment
comment on: http://stackoverflow.com/a/28203764
type: Comment
has text: thanks, I realized this a little too late, when in doubt, add timeOut :)
score: 0

http://stackoverflow.com/a/28230846
has comment: http://stackoverflow.com/comment/90578186
upvote count: 220
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44825454
has comment: http://stackoverflow.com/comment/44824781
has comment: http://stackoverflow.com/comment/44825438
has body: You may better use BroadcastChannel for this purpose. See other answers below. Yet if you still prefer to use localstorage for communication between tabs, do it this way: In order to get notified when a tab sends a message to other tabs, you simply need to bind on 'storage' event. In all tabs, do this: $(window).on('storage', message_receive); The function message_receive will be called every time you set any value of localStorage in any other tab. The event listener contains also the data newly set to localStorage, so you don't even need to parse localStorage object itself. This is very handy because you can reset the value just right after it was set, to effectively clean up any traces. Here are functions for messaging: // use local storage for messaging. Set message in local storage and clear it right away // This is a safe way how to communicate with other tabs while not leaving any traces // function message_broadcast(message) { localStorage.setItem('message',JSON.stringify(message)); localStorage.removeItem('message'); } // receive message // function message_receive(ev) { if (ev.originalEvent.key!='message') return; // ignore other keys var message=JSON.parse(ev.originalEvent.newValue); if (!message) return; // ignore empty msg or msg reset // here you act on messages. // you can send objects like { 'command': 'doit', 'data': 'abcd' } if (message.command == 'doit') alert(message.data); // etc. } So now once your tabs bind on the onstorage event, and you have these two functions implemented, you can simply broadcast a message to other tabs calling, for example: message_broadcast({'command':'reset'}) Remember that sending the exact same message twice will be propagated only once, so if you need to repeat messages, add some unique identifier to them, like message_broadcast({'command':'reset', 'uid': (new Date).getTime()+Math.random()}) Also remember that the current tab which broadcasts the message doesn't actually receive it, only other tabs or windows on the s…
type: Answer
has comment: http://stackoverflow.com/comment/44825315
has comment: http://stackoverflow.com/comment/90580061
has comment: http://stackoverflow.com/comment/71818458
has comment: http://stackoverflow.com/comment/86875300
score: 219
has comment: http://stackoverflow.com/comment/134174481
has comment: http://stackoverflow.com/comment/76358262
has comment: http://stackoverflow.com/comment/85319658
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28230845
answers question: http://stackoverflow.com/q/28230845
has comment: http://stackoverflow.com/comment/88257200
has comment: http://stackoverflow.com/comment/44824694
has comment: http://stackoverflow.com/comment/44825415

http://stackoverflow.com/q/28277514
has title: Getting Object out of string
duplicate of: http://stackoverflow.com/q/4935632
upvote count: 0
has comment: http://stackoverflow.com/comment/44909859
answer count: 1
tagged with: javascript
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/44909407
has body: I am getting an object by name response, which has a property by name attribute. On hovering on response.attribute I see "{"Coupon Circle":"coupon_circle"}" in chrome developer tools.(see Image) On doing below JSON.parse(response.attributes); I get Uncaught SyntaxError: Unexpected identifier What should I do in order to get the object out of it?
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28277550
linked to: http://stackoverflow.com/q/4935632
type: Question

http://stackoverflow.com/comment/44885976
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28264620
score: 0
has text: You could to that with JQuery onCompleted() callback for document.

http://stackoverflow.com/q/28218867
has answer: http://stackoverflow.com/a/28219067
upvote count: 1
type: Question
tagged with: javascript
tagged with: image
has body: I'm trying to load an image in the javascript on a rails app, The javascript works in the application, just the tab image does not load and believe its probably a image path issue, The image is in the images folder. $(function(){ $('.divslide').SlideOut({ Handle: '.handle', pathToTabImage: 'images/menu.png', ... I have tried changing the paths with no luck, Any help would be great, thanks.
tagged with: ruby-on-rails-4
has answer: http://stackoverflow.com/a/28219170
downvote count: 0
has answer: http://stackoverflow.com/a/28219052
favorite count: 0
has comment: http://stackoverflow.com/comment/85854796
has title: Rails 4 Javascript Image Path
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28219126
tagged with: ruby-on-rails
answer count: 4
score: 1

http://stackoverflow.com/q/28142177
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28142440
has body: I have setup a gulpfile.js that will compile my directory of js files to one (minified) source. But I need a small snippet of code to proced it (initializing the object literal that they are modifying), but I cannot seem to figure out how to achieve this. (See gulpfile below) var jshint = require('gulp-jshint'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); gulp.task('build', function() { return gulp.src('src/*.js') .pipe(concat('ethereal.js')) .pipe(gulp.dest('build')) .pipe(rename('ethereal.min.js')) .pipe(uglify()) .pipe(gulp.dest('build')); }); gulp.task('lint', function() { return gulp.src('src/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')); }); gulp.task('watch', function() { gulp.watch('src/*.js', ["lint", "build"]); }) Each file in src modifies an object literal that I need to add to the very beginning of the output script For example, src/Game.js is as follows: Ethereal.Game = function() { // init game code } Notice how it assumes that Ethereal is a real object that it is modifying, which it is. TL;DR How would I add a snippet of code to the beginning of a gulp stream file If that's not possible how would I be able to achieve such an effect with another tool?
tagged with: javascript
tagged with: gulp-concat
answer count: 1
downvote count: 0
score: 1
tagged with: gulp
favorite count: 0
has answer: http://stackoverflow.com/a/28142440
type: AnsweredQuestion
has title: Add string to the beginning of a gulp stream

http://stackoverflow.com/comment/44744390
score: 0
type: Comment
has text: It wasn't me, but I would imagine it's because this problem appears to exist within the code of the 3rd party website. It's not something anyone here will be able to help you with. The best thing you can do is to contact the support service of that website and let them know of the issue.
type: QuestionComment
comment on: http://stackoverflow.com/q/28187988

http://stackoverflow.com/comment/44634338
comment on: http://stackoverflow.com/a/28130225
has text: I edited my answer, so it includes the most crucial part from the link.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44865522
comment on: http://stackoverflow.com/q/28253455
type: Comment
type: QuestionComment
score: 1
has text: Same way you use `i`.

http://stackoverflow.com/q/28226570
tagged with: class
has title: Property shared between classes in javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28226614
linked to: http://stackoverflow.com/q/16063394
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28226614
type: AnsweredQuestion
tagged with: object
has body: function myclass(){ } myclass.prototype = { stuff: {}, getStuff: function(){ return Object.keys(this.stuff).length; } }; var m1 = new myclass(); m1.stuff[5] = 'test'; m1.stuff[6] = 'test'; var m2 = new myclass(); m2.stuff[12] = 'test'; m2.stuff[14] = 'test'; alert(m2.getStuff()); // 4 instead of 2 ?! Can someone plz explain why does the alert print 4? If I created a new instance of my function, the stuff property should be empty.
type: Question
has comment: http://stackoverflow.com/comment/44816756
tagged with: javascript
has comment: http://stackoverflow.com/comment/44816298

http://stackoverflow.com/comment/44775318
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28204583
has text: Then we need to see more of your code, has this been taken from a tutorial? I'm sure the RoyalSlider docs don't appear like that
type: Comment

http://stackoverflow.com/a/28170144
has body: .nextUntil() $('.page').each(function(index) { $(this).prepend($(this).nextUntil('.page')); });
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 4
accepted answer of: http://stackoverflow.com/q/28169874
answers question: http://stackoverflow.com/q/28169874

pyqt
type: Tag
tags question: http://stackoverflow.com/q/28253168
tag name: pyqt

http://stackoverflow.com/a/28237854
has body: I don't see an example value of your photoFileName but if it has backslashes, you would probably have to make sure that the string is escaped properly. For example: //causes errors called(1, 'file\path\img.png'); //successful called(1, 'file/path/img.png');
score: 0
answers question: http://stackoverflow.com/q/28237338
type: Answer

http://stackoverflow.com/comment/44639934
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28133457
score: 0
has text: On Chrome, Set the rows to 2 in the fiddle and watch what happens when you put the cursor before the 9 and spacebar the 9 and 0 to the next line. Keep pressing space.. The 9 and the 0 lock in position. I hate that behavior.

http://stackoverflow.com/comment/44640558
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28133845
has text: could you explain the meaning of if (!/(.*,){2,}/.test(result)) { result = result.replace(',', ''); }
score: 0

http://stackoverflow.com/q/28212834
has comment: http://stackoverflow.com/comment/44791343
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28212921
favorite count: 0
upvote count: 2
has body: I'll try explain what I want to do. I have a resize function which runs when I press a button. This function opens two columns out of window and leave it out when the window is resized. However, I would like to reset that handler when I click on another div later. Just remove or clear that function from memory to avoid the resize. I have read some posts but any of them solve my problem. My function to resize is: function resizeColumnsOut(){ $(window).resize(function() { var widthLeft = $('.column-left').outerWidth()+100, widthRight = $('.column-right').outerWidth()+100, vph = $(window).height(); $('.options').css({'height': vph + 'px', 'overflow': 'hidden'}); $('.column-left').css( {'transform': 'translateX(-'+widthLeft+'px)', 'transition': 'all ease-out .6s'}); $('.column-right').css( {'transform': 'translateX('+widthRight+'px)', 'transition': 'all ease-out .6s'}); }).resize(); } $('[data-menu="close"]').click(function(){ $(this).hide(); resizeColumnsOut(); }); My function to reset the previous function when I click on: function goAbout(){ $('.about').click(function(){ /* Events like .off() or .unbind() don't solve my problem since the resizeColumnsOut() function is already running */ }
has comment: http://stackoverflow.com/comment/44789751
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28212921
type: Question
downvote count: 0
tagged with: javascript
has title: Remove function from memory when click on
tagged with: jquery

http://stackoverflow.com/a/28274820
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28274681
type: Answer
answers question: http://stackoverflow.com/q/28274681
has body: Normally, browsers will not allow your site's JavaScript to read the data from a cross-origin request. This is because your site might be instructing the browser to get information from the user's online banking, company intranet, or some other private site. This is called The Same Origin Policy. A standard called CORS allows a site to give permission to another site to read data from it. Since POST requests can have side effects, an additional layer of security is added. Before the browser will make the POST request, it will make a pre-flight OPTIONS request to ask for permission to make the POST request. Your server is not configured to handle that OPTIONS request (and probably isn't configured to return the CORS headers for the POST request either). You need to set up CORS support if you want to allow your JavaScript to make requests to it from a different origin.
score: 2
downvote count: 0

http://stackoverflow.com/comment/44868037
has text: Thanks! Ah, i ara que veig el teu nom, visca els catalans al StackOverflow ;D
type: AnswerComment
comment on: http://stackoverflow.com/a/28254776
type: Comment
score: 1

http://stackoverflow.com/comment/44882819
comment on: http://stackoverflow.com/q/28262274
score: 0
type: QuestionComment
has text: That's a good question. I never observed the behavior you have. ExtJs always sent the idProperty value, i.e. id as int. What is causing that different behavior in your case ?
type: Comment

http://stackoverflow.com/comment/44945286
comment on: http://stackoverflow.com/q/28268116
type: Comment
has text: I believe you are right @SebastianBochan, but isn't the series definition on the options correct? If not, can you point me to the correct direction? Meanwhile I'm trying to put it into Jsfiddle.net
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44767229
score: 0
type: AnswerComment
has text: that did it. Thanks. Seems like my parameters are being passed. Perhaps something else is the issue. So odd since when I manually put in the values it works fine. If I use parameters I get no results.
type: Comment
comment on: http://stackoverflow.com/a/28196295

http://stackoverflow.com/comment/44691532
type: Comment
type: QuestionComment
has text: I'm assuming you replaced "authorization_code" with your authorization code, right?
comment on: http://stackoverflow.com/q/28159288
score: 0

http://stackoverflow.com/q/28155974
tagged with: javascript
type: UnansweredQuestion
has title: Angular-UI state transition problems
has comment: http://stackoverflow.com/comment/44683222
has answer: http://stackoverflow.com/a/28156044
tagged with: angularjs
type: Question
tagged with: state-machine
score: 0
answer count: 1
tagged with: angular-ui-router
has body: I am using Angular-UI stateProvider to route between different places in my app. In some places, when I call $state.go('newLocation'), the browser will navigate to the newLocation, but immediately return to where I called it from. So I will literally see the newLocation page for a fraction of a second, then be returned to the previous page. However, when I refresh the page in my browser, the stateProvider works as it should. Can anyone think of why this would be happening, or what I could be missing. Thanks!

http://stackoverflow.com/q/28178089
type: UnansweredQuestion
has body: I'm trying to make a script for Google Sheets that uses a spreadsheet to create a form. I'm passing the values in the columns (loaded into the object 'dataObject') of the sheet into an Array of objects as shown. for (var i = 0; i &lt; dataObject.length; i++) { dataObjectArray[i] = { question: dataObject[i][3], type: dataObject[i][4], help: dataObject[i][5], choices: dataObject[i][6], options: dataObject[i][7], validation: dataObject[i][8] } } My goal is to then use the "question" property of each object to make a new item in my Google form. The problem I'm having is that depending on the question type, a completely different method is required to make the form. The first thing I tried was making a dictionary of functions like so: var form = FormApp.create('Foo'); var formDictionary = { "Text": function(){form.addTextItem();}, "Paragraph Text": function(){form.addParagraphTextItem();}, "Multiple Choice": function(){form.addMultipleChoiceItem();}, "Checkboxes" : function() {form.addCheckboxItem();}, "Choose from a list": function(){form.addListItem();}, "Scale": function(){form.addScaleItem();}, "Grid": function(){form.addGridItem();}, "Date": function(){form.addDateItem();}, "Time": function(){form.addDateTimeItem();} }; And then I would call the form creation function like so: for (var i = 1; i &lt; dataObjectArray.length; i++){ formDictionary[dataObjectArray[i].question](); } At the moment, I'm receiving the error: TypeError: Cannot find function undefined in object [object Object]. (line 113, file "Code") I know that there are probably more than a few problems with what I have tried (I have caught a few of them myself), but I can't find a better solution. I'd like to avoid switch statments if possible, though I'll use them if they're my only choice.
has comment: http://stackoverflow.com/comment/44757191
has comment: http://stackoverflow.com/comment/44733654
downvote count: 0
tagged with: google-forms
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44749768
type: Question
has answer: http://stackoverflow.com/a/28178245
upvote count: 1
has title: Is there a way to make a dictionary of methods for an object with JavaScript in Apps Script?
answer count: 1
tagged with: google-apps-script
linked to: http://stackoverflow.com/q/8433459
tagged with: google-sheets
tagged with: javascript

http://stackoverflow.com/comment/44857861
comment on: http://stackoverflow.com/q/28247734
score: 0
type: Comment
type: QuestionComment
has text: @NicholasSmith Thanks but still won't work. Actually my link is localhost:9999/video/{slug}/ , I'm inserting "ng-app" into video template, so that part of video page is embed into chat-app. The .when('/') actually work with localhost:9999/video/{slug}/ .. but it shows the layout but button not functioning. ChatRoomsCtrl not defined...

http://stackoverflow.com/a/28271094
has comment: http://stackoverflow.com/comment/44976723
has comment: http://stackoverflow.com/comment/44976330
has body: The cause of the error you're seeing is that you're using double quotes inside your href attribute, which is confusing the parser. See the problem? href="javascript:reelUp("reel")" The most convenient way to get around that is to use single quotes. href="javascript:reelUp('reel')" Do the same for your down arrow as well. Once you do this, you will still encounter another error, because the elem that you're passing to reelUp() and reelDown() is a string, so this line from reelUp(), as well as the corresponding one from reelDown(), will fail: elem.style.top = down + 'px'; Since elem is a string, not an element, your browser will complain. To fix this, add this: elem = document.getElementById(elem); to the beginning of reelUp() and reelDown(). That'll look up the actual element with that ID. After making these changes, your code works enough that stuff starts moving when you click the arrows. I'm not sure that it necessarily moves the way you want it to, but this will get you to the point where you can debug that. Edit: In order to be able to see the animation, the element &lt;div id="reel"&gt; needs a CSS change. As it is, when you're setting the reel's top property, it's being ignored because that alone isn't enough for the browser to know where you want the reel to go. You also have to set the position property. I don't know exactly what you want, but if you set position to relative, then that will cause the top property to shift the reel up or down relative to its default position. That's what I did when I was testing my answer. So add this to your CSS: #reel { position: relative; }
has comment: http://stackoverflow.com/comment/44975877
has comment: http://stackoverflow.com/comment/44975796
answers question: http://stackoverflow.com/q/28264126
has comment: http://stackoverflow.com/comment/45017268
score: 0
has comment: http://stackoverflow.com/comment/45017475
accepted answer of: http://stackoverflow.com/q/28264126
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44932761

http://stackoverflow.com/a/28181056
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28180861
upvote count: 2
has body: You are attaching a click event to an element that doesn't yet exist, you can either move the JavaScript below the #post_new_table element, or you can place your script within a $( document ).ready() call. $(document).ready(function(){ $("#display_post").click(function(){ $("#post_new_table").toggle(); }); });
accepted answer of: http://stackoverflow.com/q/28180861

http://stackoverflow.com/comment/44625004
score: 0
type: Comment
type: QuestionComment
has text: It's the `insecure` package that allows all writes by default, not the `autopublish` package. But if you execute `Document.update("some-id-of-one-of-your-documents", {$set: {title: "A new title"}})` in the console, you should see some exception or similar if it doesn't work.
comment on: http://stackoverflow.com/q/28124985

http://stackoverflow.com/comment/44905942
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28273889
has text: Use http://mozilla.github.io/mozregression/ to find out exactly what broke it and what fixed it again. Create a bugzilla bug and report your findings there.

http://stackoverflow.com/comment/44734350
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28182449
has text: Well explained. If I understand correctly, the idea of this function is for you to pass in a 32-bit color value and get the separated ARGB color channel in a nice array?
type: AnswerComment

http://stackoverflow.com/comment/44803365
comment on: http://stackoverflow.com/q/28219834
type: Comment
type: QuestionComment
score: 0
has text: I understand what it is saying, what I don't understand is why would this work in previous versions and not this one? It seems like it's a pretty standard issue, if a dialog doesn't exist, it doesn't exist no matter the version, no?

record
type: Tag
tag name: record
tags question: http://stackoverflow.com/q/28262274

http://stackoverflow.com/q/28162528
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28162550
downvote count: 1
has comment: http://stackoverflow.com/comment/44696161
type: Question
has body: I have a web app that I want to run a setInterval function 2 times and then terminate. My code is listed below: var numCalls = 0 setInterval(function(){ document.forms[0].submit(); if (numCalls &gt;2){ window.clearInterval(); } }, 10000); The setInterval function keeps running - any help with getting this code to run with its intended purpose is greatly appreciated.
has comment: http://stackoverflow.com/comment/44696171
score: -1
has comment: http://stackoverflow.com/comment/44696157
has title: Javascript - Stop Running stopInterval After x Times
has comment: http://stackoverflow.com/comment/44696166
answer count: 2
tagged with: setinterval
tagged with: javascript
favorite count: 0
upvote count: 0
has answer: http://stackoverflow.com/a/28162543

http://stackoverflow.com/comment/44887596
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28265412
has text: http://onlinevyapari.com/customer/product-details.php
score: 0

http://stackoverflow.com/q/28140981
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28141114
possible better answer: http://stackoverflow.com/a/28141130
type: Question
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28141130
has title: Selecting parent's next sibling's children in jQuery
tagged with: jquery
has body: This is an illustration of a part of my DOM: I want to trigger an effect on div with class des (which is in an odd div) on click event of div with class but (which is in the previous even div) How can I select des from but?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28141114
score: 6

jquery
tags question: http://stackoverflow.com/q/28236586
tags question: http://stackoverflow.com/q/28184346
tags question: http://stackoverflow.com/q/28191434
tags question: http://stackoverflow.com/q/28147028
tags question: http://stackoverflow.com/q/28165606
tags question: http://stackoverflow.com/q/28227843
tags question: http://stackoverflow.com/q/28241520
tags question: http://stackoverflow.com/q/28219080
tags question: http://stackoverflow.com/q/28187669
tags question: http://stackoverflow.com/q/28182666
tags question: http://stackoverflow.com/q/28205461
tags question: http://stackoverflow.com/q/28171115
tags question: http://stackoverflow.com/q/28240762
tags question: http://stackoverflow.com/q/28204401
tags question: http://stackoverflow.com/q/28243923
tags question: http://stackoverflow.com/q/28213631
tags question: http://stackoverflow.com/q/28261307
tags question: http://stackoverflow.com/q/28154682
tags question: http://stackoverflow.com/q/28155421
tags question: http://stackoverflow.com/q/28133453
tags question: http://stackoverflow.com/q/28121859
tags question: http://stackoverflow.com/q/28127766
tags question: http://stackoverflow.com/q/28207913
tags question: http://stackoverflow.com/q/28192171
tags question: http://stackoverflow.com/q/28186109
tags question: http://stackoverflow.com/q/28247397
tags question: http://stackoverflow.com/q/28266652
tags question: http://stackoverflow.com/q/28211404
tags question: http://stackoverflow.com/q/28192859
tags question: http://stackoverflow.com/q/28231105
tags question: http://stackoverflow.com/q/28141258
tags question: http://stackoverflow.com/q/28250243
tags question: http://stackoverflow.com/q/28184170
tags question: http://stackoverflow.com/q/28258648
tags question: http://stackoverflow.com/q/28212395
tags question: http://stackoverflow.com/q/28123062
tags question: http://stackoverflow.com/q/28225238
tags question: http://stackoverflow.com/q/28253068
tags question: http://stackoverflow.com/q/28270102
tags question: http://stackoverflow.com/q/28179536
tags question: http://stackoverflow.com/q/28192918
tags question: http://stackoverflow.com/q/28187010
tags question: http://stackoverflow.com/q/28273617
tags question: http://stackoverflow.com/q/28161150
tags question: http://stackoverflow.com/q/28186319
tags question: http://stackoverflow.com/q/28160409
tags question: http://stackoverflow.com/q/28159906
tags question: http://stackoverflow.com/q/28177514
tags question: http://stackoverflow.com/q/28275746
tags question: http://stackoverflow.com/q/28155137
tags question: http://stackoverflow.com/q/28132464
tags question: http://stackoverflow.com/q/28208550
tags question: http://stackoverflow.com/q/28169058
tags question: http://stackoverflow.com/q/28208693
tags question: http://stackoverflow.com/q/28263761
tags question: http://stackoverflow.com/q/28157510
tags question: http://stackoverflow.com/q/28136931
tags question: http://stackoverflow.com/q/28273051
tags question: http://stackoverflow.com/q/28159289
tags question: http://stackoverflow.com/q/28195917
tags question: http://stackoverflow.com/q/28183013
tags question: http://stackoverflow.com/q/28158692
tags question: http://stackoverflow.com/q/28144051
tags question: http://stackoverflow.com/q/28232491
tags question: http://stackoverflow.com/q/28231308
tags question: http://stackoverflow.com/q/28164278
tags question: http://stackoverflow.com/q/28232680
tags question: http://stackoverflow.com/q/28219834
tags question: http://stackoverflow.com/q/28192755
tags question: http://stackoverflow.com/q/28235770
tags question: http://stackoverflow.com/q/28207284
tags question: http://stackoverflow.com/q/28145734
tags question: http://stackoverflow.com/q/28239488
tags question: http://stackoverflow.com/q/28132339
tags question: http://stackoverflow.com/q/28160142
tags question: http://stackoverflow.com/q/28124757
tags question: http://stackoverflow.com/q/28179311
tags question: http://stackoverflow.com/q/28143000
tags question: http://stackoverflow.com/q/28177301
tags question: http://stackoverflow.com/q/28243869

http://stackoverflow.com/a/28227564
downvote count: 0
has comment: http://stackoverflow.com/comment/44818341
type: Answer
score: 2
upvote count: 2
has body: I really suggest you use the Dom parser instead of Regex to parse an URL. Using this solution: https://stackoverflow.com/a/13465791/970247. You'll be able to retrieve the domain like this: var myURL = parseURL('https://developer.github.com/v3/'); myURL.host; // = 'developer.github.com'
answers question: http://stackoverflow.com/q/28227482
has comment: http://stackoverflow.com/comment/44818391

http://stackoverflow.com/a/28236290
has body: If you make a boundingBox (THREE.Box3) for both the 'robot' and the 'home' you can use the containsBox method. So something like this: var robotBB = new THREE.Box3().setFromObject(robot); var homeBB = new THREE.Box3().setFromObject(home) Where home and robot are your objects. Now you can do: var robotIsHome = homeBB.containsBox(robotBB); robotIsHome will be true if the robotBB is completely inside homeBB.
upvote count: 5
answers question: http://stackoverflow.com/q/28221590
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44887418
accepted answer of: http://stackoverflow.com/q/28221590
type: Answer
has comment: http://stackoverflow.com/comment/79605739

http://stackoverflow.com/comment/44887259
comment on: http://stackoverflow.com/a/28265244
type: Comment
score: 0
type: AnswerComment
has text: @SpYk3HH do you mean I could remove the `(function ($) {` part? And what else would I have to change for it to work?

http://stackoverflow.com/q/28168198
tagged with: javascript
type: UnansweredQuestion
has title: Nav menu shifting right when bootstrap modal popup displayed
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44724815
answer count: 0
tagged with: twitter-bootstrap
tagged with: nav
type: Question
has body: When modal pops up the right scroll dissapeared the main contend not moving - so that is fine, but nav menu shifting right filling the scroll space. Then when I am closing the popup scroll appeares and menu shifted back. Any ideas how to prevent menu shifting? Using Bootstrap v3.3.1 That is how my menu looks like: MySite About Login here is my modal popup: × Title Click! UPDATE I just found a fix here https://github.com/twbs/bootstrap/issues/14040 .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom { padding-right: 17px; } Does that means that it is a bug in bootstrap? UPDATE 2 The above behaviour applied to all latest WebKit based browsers, but just checked IE 12 and there the whole page shifting right when modal appeared.
has comment: http://stackoverflow.com/comment/44706313
score: 0

http://stackoverflow.com/comment/44892349
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28267763
has text: Why isn't their `app.get('*')` catching GET requests to non-HTML resources, but mine is? EDIT: See comment to question, it's because of the middleware.

http://stackoverflow.com/a/28269620
type: AcceptedAnswer
downvote count: 0
has body: It's a little hacky, but this seems to work. Nodes may overlap partially depending on the stepX size and the amount of nodes per row however. Instead of using relative positioning, like you explained. (0,0) / \ (-1,1) (1,1) / \ / \ (-2,2) (0,2) (0,2) (2,2) I'm using absolute positioning, as follows: (0,0) / \ (0,1) (1,1) / \ / \ (0,2) (1,2) (2,2) (3,2) var TreeDrawer = (function(){ var _depth = 15 , _breadth = 16 , _rootX = canvas.width/2 , _rootY = 59 ; _context.textAlign = "center"; _context.fillStyle = "black"; _context.font = "16px Verdana"; var _drawText = function(partialText, x, y) { _context.fillText(partialText, x, y); } return { drawRoot: function (value) { _drawText(value, _rootX, _rootY); }, drawNode: function(value, row, position) { var stepX = 56; var stepY = 32; // subtract half from x for symmetry var half = (Math.pow(2, row) * stepX) / 2; var x = _rootX + (stepX / 2) + (stepX * position) - half; var y = _rootY + (stepY * row); _drawText(value, x, y); } } }); var _tree = TreeDrawer(); var root = "Raiz"; var rows = [ new Array(2).fill("nodo"), new Array(4).fill("nodo"), new Array(8).fill("nodo"), new Array(16).fill("nodo")]; _tree.drawRoot(root); rows.forEach(function (row, rowIndex) { row.forEach(function (node, index) { // the root is row zero, so I add 1 for the normal nodes. _tree.drawNode(node, rowIndex + 1, index); }); }); Edit: I just now see that this is not achieving the splitting effect, it would be hardto keep on splitting for many rows, thetext space is halving each time.
answers question: http://stackoverflow.com/q/28269220
accepted answer of: http://stackoverflow.com/q/28269220
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28189209
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I don't believe you can prevent moveend being fired. (NB: these aren't jQuery events - Leaflet has its own internal event system.) This is the source for setView: setView: function (center, zoom) { zoom = zoom === undefined ? this.getZoom() : zoom; this._resetView(L.latLng(center), this._limitZoom(zoom)); return this; } _resetView always fires moveend at the end: _resetView: function (center, zoom, preserveMapOffset, afterZoomAnim) { var zoomChanged = (this._zoom !== zoom); if (!afterZoomAnim) { this.fire('movestart'); if (zoomChanged) { this.fire('zoomstart'); } } ... this.fire('moveend', {hard: !preserveMapOffset}); } You could investigate customizing these functions to allow for suppression of the event. Update: Alternatively, you could change your moveend event handler. Have it track a flag, which you set when you don't want the normal operations to happen. For example, you'll have set up your handler similar to: map.on('moveend', myHandler); Have myHandler do something like: function myHandler(e) { if (stopFlag) { return; } else { // Normal operation ... } } Then just enable and disable stopFlag to control the flow. The advantage of this is that you don't have to publish a custom version of Leaflet with your application.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44750192
answers question: http://stackoverflow.com/q/28188743
has comment: http://stackoverflow.com/comment/44750239
accepted answer of: http://stackoverflow.com/q/28188743

http://stackoverflow.com/q/28254407
accepted answer: http://stackoverflow.com/a/35118945
answer count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: html5 video fallback/backup image out of place...?
has answer: http://stackoverflow.com/a/35118945
type: Question
tagged with: javascript
has body: I wrote up the following html which shows a video background and has 2 fallback images(for mobile and old browsers) &lt;div&gt; &lt;video id="video_background" preload="auto" autoplay="true" loop="loop" muted="muted" volume="0"&gt; &lt;!--&lt;source src="whatever......"&gt; Disabled for testing --&gt; &lt;img id="browserFallback src="videos/video.gif" title="Your browser does not support the &lt;video&gt; tag"&gt; &lt;/video&gt; &lt;img id="mobileFallback" style="display:none;" src="videos/video.gif" title="Your browser does not support the &lt;video&gt; tag"&gt; &lt;/div&gt; the below javascript displays the second img gif on mobiles instead of the video: if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { document.getElementById("mobileFallback").style.display = "block"; } however, because I have 2 img objects at the same time like above, the mobile fallback goes out of alignment and only half of it gets displayed for some reason. It works perfectly fine if i remove the "browserFallback" img. Any ideas on why this happens?
score: 0

http://stackoverflow.com/a/28156893
has comment: http://stackoverflow.com/comment/44704670
has comment: http://stackoverflow.com/comment/44764051
score: 0
type: AcceptedAnswer
type: Answer
has body: Famo.us is primarily a rendering/animations framework, so you need to use an external library for that. Most people use jQuery for making Ajax-calls in famo.us. In the callback you can then simply, call the setContent function on the surface to update the content of the surface. There is also a Utility function in famo.us (Utility.loadURL) which can load data from an URL, but it is very rudimentary.
answers question: http://stackoverflow.com/q/28155014
accepted answer of: http://stackoverflow.com/q/28155014

http://stackoverflow.com/q/28162136
tagged with: meteor
score: 0
accepted answer: http://stackoverflow.com/a/28163079
answer count: 1
has body: I have an event that saves a contenteditable area on input: Template.documentPage.helpers({ contenteditable: function() { return '&lt;div class="content" contenteditable="true"&gt;' + this.content + '&lt;/div&gt;' // hack to avoid Blaze's code duplication bug in contenteditable elements } }) Template.documentPage.events({ 'input .content': function(e) { var savedSel = rangy.saveSelection() var document = $(e.target).html() setTimeout(function(){ Documents.update(this._id, {$set: {content: document}}, function(){ rangy.restoreSelection(savedSel) console.log('saved') }) }, 3000) The template: &lt;template name="documentPage"&gt; &lt;div class="editor"&gt; &lt;input class="title" type="text" value="{{title}}"&gt; {{{contenteditable}}} &lt;/div&gt; &lt;/template&gt; I do see saved in the console but the content in the contenteditable div doesn't save. The collection does save when I remove setTimeout. EDIT: I tried Meteor.setTimeOut and Session didn't work either: 'input .content': function(e) { Meteor.setTimeout(function(){ Session.set('ready', true) }, 3000) Tracker.autorun(function(){ if(Session.get('ready')){ var savedSel = rangy.saveSelection() var document = $(e.target).html() console.log(document) Documents.update(this._id, {$set: {content: document}}, function(){ rangy.restoreSelection(savedSel) console.log('saved') Session.set('ready', false) }) } })
has comment: http://stackoverflow.com/comment/44697784
has title: Meteor collection not saving when using setTimeout
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44695941
has answer: http://stackoverflow.com/a/28163079
type: Question

http://stackoverflow.com/q/28222785
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/54405254
linked to: http://stackoverflow.com/q/11628938
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28223950
tagged with: http://stackoverflow.com/tag/json
has title: Converting MVC Model to Knockout JS ViewModel
tagged with: knockout.js
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has body: I am trying to convert my mvc model to knockout viewmodel here: Model public class MyModel { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } . . . public List<MyList1> MyListOne{ get; set; } public List<MyList2> MyListTwo{ get; set; } } Controller public ActionResult Index() { MyModel myModel; var myServiceObject = myServiceManager.GetMyModelByUser(user); myModel = new MyModel { Id = myServiceObject.Id, . . . . }; return View(myModel); } View Model var DynamicModelLoading = function (data) { var self = this; ko.mapping.fromJS(data, {}, self); }; Helper public static string ToJson(this object obj) { JsonSerializerSettings serializerSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }; return JsonConvert.SerializeObject(obj, Formatting.None, serializerSettings); } View ToJson() returns data. But while binding it I am not getting any error and no data either. I am missing something here but not sure what it is. Answer Here is the fix: I was expecting the property name as same as my mvc model, but Json Serializer converts capitalized first letter to lower case by default.
favorite count: 0
has comment: http://stackoverflow.com/comment/44810791
tagged with: asp.net-mvc-4
score: 2
upvote count: 2

http://stackoverflow.com/a/28203828
answers question: http://stackoverflow.com/q/28203696
has body: If you are using exactly the same HTML as in your post, the reason why you don't see the style change is simply due to the CSS. The elements in the markup are defined with some inline styling, and those will take precedence over any styles defined in a class (without the !important). So your class is probably applied correctly, but the border and background displayed are still the ones with higher priority, which are the ones defined inline. If you remove the inline styles and instead use CSS classes it will work as you expect, as long as the divDragOver class takes precedence over the new one that you define. To do that, it is sufficient to define the new class before defining the divDragOver one.
score: 1
has comment: http://stackoverflow.com/comment/44773893
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28203696
upvote count: 1

http://stackoverflow.com/comment/44629253
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28128150
has text: Although I didn't find any reference saying that submit won't work with delegated events. I'd try to do a direct even handling if possible and test. Something like this `$("#myloginform").on("submit", function() `
score: 0

http://stackoverflow.com/q/28131798
score: -1
has answer: http://stackoverflow.com/a/28131889
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/28131866
has comment: http://stackoverflow.com/comment/44636300
accepted answer: http://stackoverflow.com/a/28131889
has answer: http://stackoverflow.com/a/28131866
favorite count: 0
has body: i built my own slideshow, i didn't want to download a library because I just want to show a full background image, and a description. My slideshow is already built. Now I need to create a loading script, because I will insert big images. Can you guys give me any idea of how can i change my code? The slideshow must start when the images are all loaded. I tried to use on load, but it still not working. Here my code: var pics = ["http://www.geant.net/Resources/PartnerResources/Partner%20Resources%20Image%20Library/Image%2010_958642.jpg", "http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg" ]; var descriptions = ["Description number 1", "Description number 2" ]; function displaySlideshow(pics) { var i = 1; setInterval( function() { $("body, #resp-background").css({ 'background-image': 'url(' + pics[i] + ')', '-webkit-transition': 'background-image .25s ease-in-out', 'transition': 'background-image .25s ease-in-out;', '-moz-transition': 'background-image .25s ease-in-out;', 'background-size': 'background-image .25s ease-in-out;', '-o-background-size': 'cover', '-moz-background-size': 'cover', '-webkit-background-size': 'cover' }); $('.s-description').html(descriptions[i]); i++; if (i &gt;= pics.length) i = 0; }, 4200); } displaySlideshow(pics); Jsfiddle here: http://jsfiddle.net/kx1fgsox/
type: AnsweredQuestion
has title: How can i build a loading script for my slideshow?
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery

browser-sync
tags question: http://stackoverflow.com/q/28205034
tag name: browser-sync
type: Tag

http://stackoverflow.com/comment/44801440
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28218863
has text: @Alternatex Right, but even if it were possible, it clearly wouldn't solve his problem because he wouldn't be able to instruct it to bypass or remove the breakpoint, because javascript is halted.

http://stackoverflow.com/a/28246896
downvote count: 0
has comment: http://stackoverflow.com/comment/44873177
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/44878282
score: 6
answers question: http://stackoverflow.com/q/28246879
has comment: http://stackoverflow.com/comment/44873768
has body: To create a client-side collection, just don't give it a name argument. // This collection has a name, and will work on both the server and client Recipes = new Mongo.Collection('recipes'); // This collection is client-only, and does not have a name. // It will not be synchronized with the server. Vegetables = new Mongo.Collection(); // To be more explicit, you can use `null` for the name: Meats = new Mongo.Collection(null);
has comment: http://stackoverflow.com/comment/44873294

http://stackoverflow.com/q/28137213
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Reorder DOM nodes without removing / appending them
type: UnansweredQuestion
has body: My "component" receives an object in this form: { p0: 3, p1: 2, p4: 6, p9: 3 } Object can have a subset of properties p0 .. p9. My component should create Input type=range for each property and allow user to edit any property of current object. When property is edited, new (edited) object is propagated to parent and parent sets it back to all components in program (including my component). My current component has 10 hidden inputs. In SetObject, I remove all displayed inputs (removeChild) and then append (appendChild) only those, that are present in received object. The problem is, that while dragging input with a mouse, property is changed, object is propagated up and down, current input is removed and appended again, and loses focus (no visual change, but can not be dragged any further). What is a nice way to solve it? I would like to keep inputs that are in both previous and new object (to keep focus on them), but I also want them to be ordered correctly.
has comment: http://stackoverflow.com/comment/44646422
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/28137327
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44690512
has text: @skobaljic I need it to be displayed in the cell. It is supposed to be a sort of task in the calender. I stored the data in localStorage like, let's say: Event: Birthday Participants: Kurt, Dave, Kris... etc.... So, it is supposed to be shown in the calendar and be available for a user to edit it whenever he wants.
comment on: http://stackoverflow.com/q/28159142
type: Comment
type: QuestionComment
score: 0

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/28196065
type: Tag

http://stackoverflow.com/comment/44813108
type: QuestionComment
has text: This is the point of classes, change all the `#menu-item-#####` to just a class `.menu-item`, and have a single `hover` event using `this` for the item you are on.
comment on: http://stackoverflow.com/q/28224676
score: 0
type: Comment

http://stackoverflow.com/q/28145259
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44662356
has answer: http://stackoverflow.com/a/28151228
has title: Any way to circumvent cross domain image issue in canvas?
has comment: http://stackoverflow.com/comment/44662367
linked to: http://stackoverflow.com/q/2390232
has comment: http://stackoverflow.com/comment/44662342
has comment: http://stackoverflow.com/comment/44662379
has comment: http://stackoverflow.com/comment/44663164
type: Question
has body: When I try to use canvas.toDataURL("image/jpeg"); on image imported from another domain, I get security error. Is there any way around this issue?
has comment: http://stackoverflow.com/comment/44662383
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
tagged with: html5-canvas
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44666065
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44691634
score: 0
type: Comment
type: AnswerComment
has text: Right, it loops until it hits 21.
comment on: http://stackoverflow.com/a/28160098

http://stackoverflow.com/a/28225809
has body: With CSS, it's awkward to use id values starting with a digit; the simplest thing is to avoid using them. But with what you have, you can do this: $(".item[id='1']").css(/*...*/); Just using #1 as a selector may work in certain select situations provided they don't rely in CSS parsing, but is invalid. If you must have an id value starting with a digit, to use it with a CSS selector, you have to escape it. The escaped version of #1 is #\31, which gets even more awkward when written as a JavaScript string: $("#\\31").css(/*...*/);. But this works and is in-spec: $("#\\31").css(/*...*/); This works in jQuery as of the current version and is not in spec: $("#1").css(/*...*/); It could stop working at any time, however, as it's not in-spec, and breaks if you combine it with various things.
has comment: http://stackoverflow.com/comment/44815110
answers question: http://stackoverflow.com/q/28225668
score: 0
has comment: http://stackoverflow.com/comment/44814820
has comment: http://stackoverflow.com/comment/44814836
has comment: http://stackoverflow.com/comment/44814939
type: Answer
has comment: http://stackoverflow.com/comment/44814903
has comment: http://stackoverflow.com/comment/44815007

http://stackoverflow.com/comment/44848083
type: Comment
has text: your loop executes after jQuery ready...so 1st part of your script already triggered and that was all folks.... you need to move your js after the loop cause you do same thing to each iteration...
comment on: http://stackoverflow.com/q/28243567
score: 0
type: QuestionComment

http://stackoverflow.com/q/28240035
linked to: http://stackoverflow.com/q/11483216
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28240094
duplicate of: http://stackoverflow.com/q/11483216
has body: Why does eval(0047) return a value of 39? (047 and 00047 produce the same result) And Why does eval(056) return a value of 46? But...eval(0048) returns a value of 48, as expected! It has something to do with the leading zeroes obviously, but I can't figure it out, any help would be appreciated.
type: Question
tagged with: eval
answer count: 2
has title: Javascript eval(0047) returns 39
score: 0
has answer: http://stackoverflow.com/a/28240083

http://stackoverflow.com/comment/44759646
comment on: http://stackoverflow.com/q/28196330
type: Comment
type: QuestionComment
score: 0
has text: What about save activeTeam and passiveTeam first, then set player and save player? You don't need to query player again.

meanjs
tags question: http://stackoverflow.com/q/28224139
type: Tag
tag name: meanjs
tags question: http://stackoverflow.com/q/28252771
tags question: http://stackoverflow.com/q/28138498

http://stackoverflow.com/q/28239603
has comment: http://stackoverflow.com/comment/44840579
has body: I have a table in html with some code like this, Jan Feb Mar Apr May Jun Now based on the onClick event, I want to store the value of the month in a variable in c#. For ex. it id "m4" is clicked, I want to store value 4 in my variable. Any ideas will be helpful and appreciated. Thanks.
has answer: http://stackoverflow.com/a/28239839
answer count: 3
type: AnsweredQuestion
has title: Retrieve the html td onClick event value in c#
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28239916
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/28239916
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28239839
has comment: http://stackoverflow.com/comment/44840814
upvote count: 1
tagged with: c#
has answer: http://stackoverflow.com/a/28239691
tagged with: javascript

http://stackoverflow.com/a/28203395
score: 14
answers question: http://stackoverflow.com/q/28203363
has body: You need to use getComputedStyle() to get the styles assigned through the stylesheet. console.log(getComputedStyle(document.getElementById('content')).backgroundColor); console.log(document.getElementById('content').style.color); #content { background-color: #000000; display: inline-block; height: 100px; width: 100px; } &lt;div id="content" style="color:red;"&gt;&lt;/div&gt;
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28203363
type: Answer
upvote count: 14

http://stackoverflow.com/comment/44835057
has text: because there is no `iea_id` in the json data.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28236910

http://stackoverflow.com/q/28248602
has title: Algorithm to mine millions of records
answer count: 1
downvote count: 1
favorite count: 0
tagged with: mining
has answer: http://stackoverflow.com/a/28248746
upvote count: 0
accepted answer: http://stackoverflow.com/a/28248746
type: AnsweredQuestion
tagged with: search
type: Question
tagged with: algorithm
has body: I have more than a million chat records of data in the format of chat_message city timestamp Now, we need to check for keywords related to travel like "travel" or "accomodation" or "hotels" etc. Let us say we have gathered around 15 keywords related to travel. Requirement is to mine the chat message related to travel using the keywords. how? Solution I can think of - Have an array of travel related keywords. Then scan through all the messages for each keyword(some string matching algo). I think the solution is pretty brute force, any more ideas on a more efficient algo to search, or set up of the chat-records or/and keywords?
tagged with: javascript
score: -1

http://stackoverflow.com/comment/44860188
type: Comment
has text: They dissapear because the form is submitted, and the page reloads
score: 2
type: QuestionComment
comment on: http://stackoverflow.com/q/28250268

http://stackoverflow.com/a/28275312
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28275211
score: 1
has body: Your method expand_all only exists within the scope of the function inside $(document).ready(...), in order for you to call it from ScriptManager.RegisterStartupScript it needs to be at the window level, simply move that function outside the $(document).ready(...) &lt;script type="text/javascript" language="javascript"&gt; $(document).ready( function () { .... }); function expand_all() { $(this).closest('tr').next('tr').toggle(); }; &lt;/script&gt;

http://stackoverflow.com/comment/44804678
type: AnswerComment
type: Comment
has text: I do not think this is the root of the problem. `req` is still in scope, it's the `query` property of `req` that is undefined. If it were a scoping error, `req` wouldn't be defined.
score: 0
comment on: http://stackoverflow.com/a/28220240

http://stackoverflow.com/q/28261999
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
has body: i have a rather unusual question. We have a web-based system, which is free programmable for our customers. This means that our customer can control and fetch data through script. Today we use a basic-interpreter, and we would like to switch to JavaScript. the exposed objects has tens of thousands propertys, and its to slow to create all of them when launching the web-application. Therefore, i would like to find out if there is a way of doing it on demand. An example: var reallyLargeObject = {}; //root object, with many many propertys(the propertys has subpropertys in a tree as well. This object is created out of control of our customer. but, in the customer scripts there will be code like: reallyLargeObject.subProperty.subsubProperty = 23; of course this will result in an "object is not defined", But i want to catch this somehow (through some override of some prototype function maybe?) and create the property on demand like: function(subpropertyName){ reallyLargeObject[subpropertyName]=createSubProperty(subpropertyName); } before returning to .subsubProperty call... Is this even possible? Thank's in advance :) /Teo
has comment: http://stackoverflow.com/comment/44881303
has comment: http://stackoverflow.com/comment/44882955
has comment: http://stackoverflow.com/comment/44881321
downvote count: 0
type: Question
type: AnsweredQuestion
score: 3
has title: Create object on demand
has answer: http://stackoverflow.com/a/28262080
accepted answer: http://stackoverflow.com/a/28262080
has comment: http://stackoverflow.com/comment/44881325

http://stackoverflow.com/q/28250375
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/35309718
tagged with: css
answer count: 4
score: 8
has answer: http://stackoverflow.com/a/38085873
type: Question
has title: How to change canvas height and width in angular chart.js
tagged with: javascript
has answer: http://stackoverflow.com/a/29092454
has body: I am developing my first sample code using angular chart.js,I am unable to change custom height and width, How can i change height and width of my canvas. CODE: CSS #myChart{ width:500px; height:500px; } HTML &lt;body ng-controller="LineCtrl"&gt; &lt;canvas id="myChart" &gt;&lt;/canvas&gt; &lt;div class="chart-container"&gt; &lt;linechart data="data" options="options" mode=""&gt;&lt;/linechart&gt; &lt;/div&gt; Javascript 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] } ] }; var options = { scaleOverlay : false, scaleOverride : false, scaleSteps : null, scaleStepWidth : null, scaleStartValue : null, scaleLineColor : "rgba(0,0,0,.1)", scaleLineWidth : 1, scaleShowLabels : true, scaleLabel : "&lt;%=value%&gt;", scaleFontFamily : "'proxima-nova'", scaleFontSize : 10, scaleFontStyle : "normal", scaleFontColor : "#909090", scaleShowGridLines : true, scaleGridLineColor : "rgba(0,0,0,.05)", scaleGridLineWidth : 1, bezierCurve : true, pointDot : true, pointDotRadius : 3, pointDotStrokeWidth : 1, datasetStroke : true, datasetStrokeWidth : 2, datasetFill : true, animation : true, animationSteps : 60, animationEasing : "easeOutQuart", onAnimationComplete : null } var ctx=document.getElementById("myChart").getContext("2d"); var myLineChart = new Chart(ctx).Line(data, options); //console.log(myLineChart)
tagged with: canvas
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/42252718
tagged with: angularjs
upvote count: 8
type: UnansweredQuestion

http://stackoverflow.com/a/28144480
type: Answer
answers question: http://stackoverflow.com/q/28142332
score: 0
has body: Found the reason it wasn't working. There's no need for ".val()" at the end of the jquery function, since extractCode already gets the value. Omitting .val() fixes the issue.

http://stackoverflow.com/a/28263399
answers question: http://stackoverflow.com/q/28263051
upvote count: 1
has body: Another way without jQuery, using data-attributes : var countrySelect = document.querySelector('[name=country]'); var cityOptions = document.querySelectorAll('option[data-country]'); countrySelect.addEventListener('change', function(){ for (var i = 0; i < cityOptions.length; i++){ var opt = cityOptions[i]; opt.style.display = (opt.getAttribute('data-country') === this.value) ? '' : 'none'; } }, false); Select one country Germany England Select one city London Manchester Stuttgard Munchen
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/28231884
type: Answer
answers question: http://stackoverflow.com/q/28231715
has comment: http://stackoverflow.com/comment/44840115
upvote count: 1
downvote count: 1
score: 0
has body: have you tried canvas.toDataURL()? more hardcore way might be canvas.getContext('2d').getImageData() would return ImageData object.

http://stackoverflow.com/q/28157533
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44686553
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44687076
tagged with: c#
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44686814
has title: Data-Binding with Knockout JS
has comment: http://stackoverflow.com/comment/44686442
tagged with: knockout.js
type: Question
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28213219
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28213219
has body: I am having a problem not being able to bind my data and then display it using cshtml. I have tried different methods of making observable arrays and I am thinking, my main problem comes from trying to utilize my supposedly "bounded-data"...The following is my cshtml(c#-html) code, and then my js code. Continuous (Vibratory) Acceleration Maximum (Shock) Acceleration view model: "use strict"; function ViewModel() { // it would make more sense with the current setup to make the ViewModel be the Application, but I have set it up like this in case some day it is desired that this tool creates multiple applications in one session this.application = ko.observable(new Application('New Application', this)); this.requestSearchMode = ko.observable(false); } function Application(name, parentViewModel) {.... this.sections = { gForceSection: initGforceSection(this), pumpSection: initPumpSection(this), calcLoadsSection: initCalcLoadsSection(this) }.... } function initGforceSection(application) { var data = ko.observableArray(); var gForceSection = new Section('G-Forces', data, application); var self = this; var Force = function (name, value) { this.forceName = name; this.forceValue = value; }; var vibForce = { availableVForces: ko.observableArray([ { vForce: "Skid steer loader", value: 4 }, { vForce: "Trencher (rubber tires)", value: 3 }, { vForce: "Asphalt paver", value: 2 }, { vForce: "Windrower", value: 2 }, { vForce: "Aerial lift", value: 1.5 }, { vForce: "Turf care vehicle", value: 1.5 }, { vForce: "Vibratory roller", value: 6 } ]), selectedForces: ko.observable() }; var shockForce = { availableSForces: ko.observableArray([ { sForce: "Skid steer loader", value: 10 }, { sForce: "Trencher (rubber tires)", value: 8 }, { sForce: "Asphalt paver", value: 6 }, { sForce: "Windrower", value: 5 }, { sForce: "Aerial lift", value: 4 }, { sForce: "Turf care vehicle", value: 4 }, { sForce: "Vibratory roller", value: 10 } ]), selectedForces: ko.observable() }; gForceSection.families = ko.o…

http://stackoverflow.com/comment/44726065
type: Comment
comment on: http://stackoverflow.com/a/28177389
has text: just put the above inside an event listener and manipulate it to fit your url etc.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28291218
accepted answer of: http://stackoverflow.com/q/28177632
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28177632
score: 0
has body: Inorder to capture the events the events should be captured through event capturing not via event bubbling.the useCapture flag is my culprit here.Set it to true and it solved my problem.. Bubble vs capture window.addEventListener("click",function(e){console.log(e)},true); document.addEventListener("click",function(e){console.log(e)},true);
type: Answer

http://stackoverflow.com/a/28197377
answers question: http://stackoverflow.com/q/28197039
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44763533
downvote count: 0
has comment: http://stackoverflow.com/comment/44762536
has body: It is said that webkit may need to load the image first. To do this apply the onload first. $img[0].onload = function() { console.log(this.naturalWidth); }
type: Answer
has comment: http://stackoverflow.com/comment/44761225

http://stackoverflow.com/comment/44686051
type: Comment
type: QuestionComment
has text: Your code has a bug when it loads in IE (*main.js*) `Kan de eigenschap offsetWidth van een niet-gedefinieerde verwijzing of een verwijzing naar een lege waarde niet ophalen`. Seems to come from Google Maps api.
score: 0
comment on: http://stackoverflow.com/q/28141827

http://stackoverflow.com/q/28140147
has answer: http://stackoverflow.com/a/34908294
tagged with: getusermedia
favorite count: 0
has body: I'm developing a Chrome Extension that uses the background page to access the user's webcam. Users are given the option to turn the camera off. The stream appears to be being turned off. The relevant functions are no longer receiving the stream. However the webcam light (currently being developed and tested on a mac book pro) does not turn off. Any ideas? Here's my code for setting up the stream: if (navigator.webkitGetUserMedia!=null) { var options = { video:true, audio:false }; navigator.webkitGetUserMedia(options, function(stream) { vid.src = window.webkitURL.createObjectURL(stream); localstream = stream; vid.play(); console.log("streaming"); }, function(e) { console.log("background error : " + e); }); } And here's my method for turning off the stream: function vidOff() { clearInterval(theDrawLoop); ExtensionData.vidStatus = 'off'; vid.pause(); vid.src = ""; localstream.stop(); DB_save(); console.log("Vid off"); } Any obvious I'm missing?
has title: Turn off webcam/camera after using getUserMedia
has answer: http://stackoverflow.com/a/28195344
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44680232
linked to: http://stackoverflow.com/q/11642926
has comment: http://stackoverflow.com/comment/44720834
duplicate of: http://stackoverflow.com/q/11642926
type: Question
answer count: 2
downvote count: 0
upvote count: 45
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28195344
possible better answer: http://stackoverflow.com/a/34908294
score: 45
tagged with: google-chrome-extension

http://stackoverflow.com/comment/44724024
type: Comment
type: QuestionComment
has text: what do you mean with modal element? and no, no error thrown,. wierd thing is i have another modal and that one is working with another condition, so i tried to see if my condition was working, and indeed, it displays the alert y have commented there, but the modal still not showing, already checked for some sintaxys mistakes but im not able to find any.
comment on: http://stackoverflow.com/q/28177405
score: 0

http://stackoverflow.com/comment/44653485
comment on: http://stackoverflow.com/q/28140728
score: 0
type: Comment
type: QuestionComment
has text: @minseong This is not a browser issue

http://stackoverflow.com/comment/44629791
comment on: http://stackoverflow.com/q/28128368
score: 0
type: Comment
type: QuestionComment
has text: @jfriend00 Are you talking about Lexical Environments and Environment Records? (http://www.ecma-international.org/ecma-262/5.1/#sec-10.2) If so these are surely related to, impacted by but separate to scopes.

http://stackoverflow.com/comment/44792714
type: Comment
comment on: http://stackoverflow.com/a/28213416
score: 0
type: AnswerComment
has text: `a + m.salary/p.length` - look at the `p.length` - that makes result average, not sum.

http://stackoverflow.com/q/28195282
favorite count: 0
upvote count: 0
has answer: http://stackoverflow.com/a/28195379
linked to: http://stackoverflow.com/q/21991856
has comment: http://stackoverflow.com/comment/44757560
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44757878
has comment: http://stackoverflow.com/comment/44757316
type: Question
linked to: http://stackoverflow.com/q/24456563
tagged with: javascript
tagged with: jquery
score: -1
has title: popup displays only once
answer count: 2
has answer: http://stackoverflow.com/a/28195622
accepted answer: http://stackoverflow.com/a/28195622
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has body: i have a popup which shows on page load. i want it to be displayed only once. here is my code: (javascript): and html markup here: Important Announcement X i have tried using jquery.cookies and set a counter in my javascript code. this what i have tried: how could i display it only once? i know this question has been asked here and here i have searched a lot but with no success. thanks in advance
possible better answer: http://stackoverflow.com/a/28195379

http://stackoverflow.com/comment/67586261
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28171287
has text: This worked well for me. I wonder if installable triggers are copied over if you programmatically duplicate a spreadsheet file?

http://stackoverflow.com/a/28206756
has body: By default, Knockout will allow the click event to continue to bubble up to any higher level event handlers. For example, if your element and a parent of that element are both handling the click event, then the click handler for both elements will be triggered. Since the href its child of sidebar, when you click on the href the 2 click handler will be triggered, so you need to use clickBubble: false on the slide bar Check here, note 4
type: Answer
accepted answer of: http://stackoverflow.com/q/28206351
has comment: http://stackoverflow.com/comment/44779229
score: 0
answers question: http://stackoverflow.com/q/28206351
type: AcceptedAnswer

http://stackoverflow.com/a/28272902
score: 0
answers question: http://stackoverflow.com/q/28272358
type: Answer
has body: You approached this correctly in how you set up your search models to match the structure of the data you are filtering, i.e. search.customer.name and search.customer.id. All you need to do is to apply the search object as the filter: &lt;li ng-repeat="order in orders | filter: search"&gt; {{order.id}} | id: {{order.customer.id}} name: {{order.customer.name}} &lt;/li&gt; plunker A few other issues: There is no filterBy (unless you create your own) Your first order record has an array of customers - was this intentional? This plunker handles that case

http://stackoverflow.com/a/28139991
has comment: http://stackoverflow.com/comment/44651794
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44651843
has body: Assuming that this is actually the element (depends on how plugin is written) ... you are looking in the wrong direction in the DOM tree. closest() looks up the tree for ancestors. You would need to use find() to look for a descendant of .score
has comment: http://stackoverflow.com/comment/44651912
has comment: http://stackoverflow.com/comment/44651737
has comment: http://stackoverflow.com/comment/44651756
has comment: http://stackoverflow.com/comment/44651637
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28139904
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28139904

http://stackoverflow.com/q/28207007
has title: Bug in sending multiple 2-D Arrays through socket.io
type: Question
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44793766
score: 0
has body: I am noticing a bug in socket.io. I am sending multiple (5) 2-D Array's through socket.io. All of the Array's are coming through, at different lengths/sizes and at different times, if that matters with how node.js or socket.io handle them. But they are seperate so I didn't think it mattered, just mentioning. I have the incoming data from another source that populates Array1, Array2....ect. Here are some examples of what's happening, when sending through socket.io. When I send test1: test1 does populate on the client side. When I send test2: test2 does not populate on the client side. when I send test2, then test1: test1 and test2 populate on the client side. var Array1 = []; var Array2 = []; var Array3 = []; var Array4 = []; var Array5 = []; jsonResults = JSON.stringify({ 'test1': Array1, 'test2': Array2, 'test3': Array3, 'test4': Array4, 'test5': Array5 }); Just for an example of how I am calling variables on the client side var socket = io.connect(); socket.on('message', function(message){ var obj = jQuery.parseJSON(message); var value1 = obj.test1[1][1]; var value2 = obj.test2[0][5]; I have another question, If on the client side I call out a variable that doesn't exist like obj.test1[5][5] when test1 is only [4,5] sometimes it doesn't populate on the client side, for all the variables like test1[1][1] which does exist; Is there a particular reason for this or am I approaching this wrong? Is there a better way to program this from .js side I have to handle multiple 2-D arrays of unknown size coming in at different times. Server Side Listening to outside traffic. // start UDP server listening on port 3001 udpRunningResultsServer.on("listening", function () { var address = udpRunningResultsServer.address(); console.log("UDP Running Results Server listening on port: " + address.port); console.log(" ") }); udpRunningResultsServer.bind(3001); // process datagram udpRunningResultsServer.on("message", function (Runningmsg, Runninginfo) { // check if datagram is full (si…
answer count: 0
type: UnansweredQuestion
tagged with: sockets
tagged with: node.js
has comment: http://stackoverflow.com/comment/44793641
tagged with: socket.io
has comment: http://stackoverflow.com/comment/44779304

http://stackoverflow.com/q/28247629
tagged with: javascript
has body: I am trying to make a button OR direct redirect which redirect user to page where he come from. For example: If someone access my website from bbc post and register. Upon register success page, There should be a button or redirect function which take user back to bbc post or whereever he comes from. I tried following cookie method but not worked also read some posts on stackoverlow but still no luck! function setCookie(name,val,days) { // DATE OBJECT var date = new Date(); // NUMBER OF MILLISECONDS IN A DAY var milliseconds = 86400000; // MULTIPLY, THEN ADD TO CURRENT TIME date.setTime(date.getTime() + (days * milliseconds)); // SET EXPIRATION VARIABLE var expires = '; expires=' + date.toGMTString(); // CONCATENATE TO CREATE COOKIE document.cookie = name + '=' + val + expires + '; path=/'; } window.onload = function(){ if(document.referrer != ''){ // DESTROY ANY PREVIOUS DUPLICATE COOKIE setCookie('referrer','',-1); // CREATE COOKIE ON REGISTRATION PAGE setCookie('referrer',document.referrer,1); } } Can someone give any solution for this?
favorite count: 0
has comment: http://stackoverflow.com/comment/44855791
upvote count: 3
type: UnansweredQuestion
tagged with: http-redirect
tagged with: php
has answer: http://stackoverflow.com/a/28247779
has title: JavaScript redirect back to refer page
score: 3
has comment: http://stackoverflow.com/comment/44855763
has comment: http://stackoverflow.com/comment/44855846
has comment: http://stackoverflow.com/comment/44855775
type: Question
downvote count: 0
answer count: 1

http://stackoverflow.com/a/28237001
score: 1
has comment: http://stackoverflow.com/comment/44835436
has comment: http://stackoverflow.com/comment/44835319
upvote count: 1
has comment: http://stackoverflow.com/comment/44835881
answers question: http://stackoverflow.com/q/28236910
has body: try with proper attribute.since there is no iea_id in your json data it is not giving anything. var resposta= [{"mandioca_iea_id":"1","man_ins_area_00":"0","man_ins_prod_00":"0","man_ins_area_05":"0","man_ins_prod_05":"0","man_ins_area_10":"0","man_ins_prod_10":"0","man_ins_area_13":"0","man_ins_prod_13":"0","id_cid":"1","id_cult":"1"}] for(var i=0; i&lt;resposta.length; i++) { var registro = resposta[i]; console.log(registro.mandioca_iea_id); //it should give 1 } updated: $.post('envia.php', {nome: nome}, function(resposta) { console.log(resposta); var resposta=JSON.parse(resposta); for(var i=0; i&lt;resposta.length; i++) { var registro = resposta[i]; console.log(registro.customerLat); } });
downvote count: 0
has comment: http://stackoverflow.com/comment/44835714
has comment: http://stackoverflow.com/comment/44841845
type: Answer

http://stackoverflow.com/q/28126797
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/28126818
tagged with: regex
upvote count: 15
has answer: http://stackoverflow.com/a/28126806
accepted answer: http://stackoverflow.com/a/28126806
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28126818
downvote count: 0
type: Question
has body: I want to find a specific pattern inside a string. The pattern: (\{\$.+\$\}) Example matche: {$ test $} The problem I have is when the text has 2 matches on the same line. It returns one match. Example: this is a {$ test $} content {$ another test $} This returns 1 match: {$ test $} content {$ another test $} It should returns 2 matches: {$ test $} and {$ another test $} Note: I'm using Javascript
tagged with: javascript
has title: Match a string pattern multiple times in the same line
score: 15

http://stackoverflow.com/a/28144693
upvote count: 1
answers question: http://stackoverflow.com/q/28144575
has body: The problem is, you are trying to add the options to the next row of current 'tr' which would always been the next row available in DOM (the one which was originally next to the current row - Orange row). To add options in row you are preparing in code you have to first add it to DOM and then insert the options tag. Minimal changes to your code : $(document).on("click", '.tdAdd', function () { //alert($(this).closest('tr').index()); var newRow = $(" "); var cols = ""; cols += ' '; cols += ' '; cols += ' '; cols += ' '; newRow.append(cols); newRow.insertAfter($(this).closest("tr")); foo($(this).closest('tr').index() + 1);//add options once the newly created 'select' is available in DOM });
has comment: http://stackoverflow.com/comment/44661242
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44661370
score: 1

http://stackoverflow.com/comment/44877988
score: 0
type: QuestionComment
has text: If the plugin breaks when you change `img` tags to `div` tags then it is most likely because the plugin is looking for `img` tags... if it does not find any then it cannot do, what it is it does.
type: Comment
comment on: http://stackoverflow.com/q/28260313

http://stackoverflow.com/a/28128070
score: 0
has comment: http://stackoverflow.com/comment/45348154
has comment: http://stackoverflow.com/comment/44648146
has comment: http://stackoverflow.com/comment/44794486
accepted answer of: http://stackoverflow.com/q/28125068
has comment: http://stackoverflow.com/comment/44874952
answers question: http://stackoverflow.com/q/28125068
has comment: http://stackoverflow.com/comment/44650294
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44880092
type: Answer
has body: You should take the codec attribute information of the MPD, maybe that's an issue. Does your content play when you append the segments directly to the source buffer? Can you also post your MPD with access to the content? Does the content play using the dash.js or bitdash MPEG-DASH players?

http://stackoverflow.com/q/28145670
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28147187
has comment: http://stackoverflow.com/comment/44665800
has comment: http://stackoverflow.com/comment/44665312
linked to: http://stackoverflow.com/q/28143350
has comment: http://stackoverflow.com/comment/44663408
score: 0
has body: I am using the Weather Underground API, parsing Json, and getting a result. For some reason this is not working to get the right astronomy results like so: http://www.wunderground.com/weather/api/d/docs?d=data/astronomy&amp;MR=1 Moon: Current: Sunrise: Sunset: Here is what I have so far and am getting no results:(updated) $.ajax({ url: "http://api.wunderground.com/api/72df18b7f213607b/astronomy/q/CO/Alamosa.json", dataType : "jsonp", success : function(parsed_json) { var hourly = parsed_json['moon_phase']['current_time']['sunrise']['sunset']; for (index in hourly) { var newHourlyString = moon_phase[index]['hour'] + ' is ' + current_time[index]['hour']; var newHourlyParagraph = $('&lt;p/&gt;').text(newHourlyString); $(".astro").append(newHourlyParagraph); } } });
has title: Weather Underground API Astronomy
has comment: http://stackoverflow.com/comment/44663465
has comment: http://stackoverflow.com/comment/44664199
has comment: http://stackoverflow.com/comment/44665596
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28147187
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44663756
has comment: http://stackoverflow.com/comment/44664124

http://stackoverflow.com/comment/44789296
type: QuestionComment
comment on: http://stackoverflow.com/q/28212681
has text: where is the json coming from?
score: 0
type: Comment

http://stackoverflow.com/comment/126532505
type: Comment
type: AnswerComment
has text: A [slight variation](https://github.com/mw999/react-recording/blob/master/src/utilities/audio.js#L51) of this solution leads to a shorter and sped up audio file. I am completely in the dark when it comes to audio compression, but shouldn't the length stay the same?
comment on: http://stackoverflow.com/a/28417103
score: 0

http://stackoverflow.com/q/28186720
answer count: 2
tagged with: google-maps
upvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28188418
linked to: http://stackoverflow.com/q/1544739
has comment: http://stackoverflow.com/comment/44742367
favorite count: 0
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28187028
has body: The info window and marker is not shown for the places which is already marked by google. for example: if you run the code and click anywhere , a marker and a info window will appear as a result , but this doesn't happen for the places which are alreasy marked such as "The Brunswick","Open Air Theatre" etc.
has title: I am not able to place markers on the places which is already marked by google with other symbols .
linked to: http://stackoverflow.com/q/24234106
score: -1
has comment: http://stackoverflow.com/comment/44741956
type: Question

http://stackoverflow.com/a/28138568
has comment: http://stackoverflow.com/comment/44904262
accepted answer of: http://stackoverflow.com/q/28136974
has comment: http://stackoverflow.com/comment/44749083
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44874802
answers question: http://stackoverflow.com/q/28136974
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44894181
upvote count: 1
has body: here is what I would do: It’s more performant because: No virtual dom required No need to iterate through the whole string (just iterate till max). Assumptions: Anchor tags are: "" closing. That should be the case for valid html. Link text doesn’t add up to max. Code: var longString = "Lorem ipsum dolor link 1 sit amet, consectetur adipiscing elit. Duis in rhoncus nisi. Suspendisse elementum convallis link 1 faucibus. Nam elit nisl, cursus a mauris sit amet, mattis volutpat nulla. Suspendisse fermentum urna in lobortis semper. Vivamus eu commodo diam, ut blandit justo. Etiam at venenatis purus, a lobortis nisl. Ut fringilla mi nibh, id congue est ultricies ut. In maximus vestibulum sodales. Nulla tempor diam bibendum sapien tempus facilisis. Praesent suscipit dolor sed fringilla vulputate. Nulla dapibus est vitae magna sagittis sodales. In finibus semper convallis."; function Filter (str, max) { if (str.length <= max) return str; var i = 0; var counter = 0; var insideAnchor = false; while (i < str.length && counter < max){ i++; if (str[i] === '<' && str[i+1] === 'a')insideAnchor = true; if (insideAnchor && str[i] === '>' && str[i-1] ==='a' && str[i-2] === '/')insideAnchor = false; if (insideAnchor === false)counter ++; } return str.substring(0,i); } document.getElementById("me").innerHTML = '>>>' + Filter(longString, 21) + '<<<';

http://stackoverflow.com/a/28212317
type: Answer
has body: First of all, you don't wait for asynchronous $http.get() to finish so console.log() will always print out undefined. Second, maybe you could think about using then() rather than success(). http://bit.ly/18xIHio The following should work just fine for you. /* JS */ app.controller('myControl', function($http) { var ctrl = this; $http.get('http://www.data.fi/data.json').then(function (response) { ctrl.content = response; // use response.data to get the payload }).catch(function (error) { ctrl.content = error; }).finally(function() { console.log(ctrl.content); }); }); &lt;!-- HTML --&gt; &lt;div ng-controller="myControl as ctrl"&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28211842
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44790380
has comment: http://stackoverflow.com/comment/44789398
downvote count: 0

http://stackoverflow.com/comment/44750146
type: QuestionComment
has text: I couldn't see any return statement from looptest function. Can you change it? Also to achieve the desired functionality, you should have state maintained in your code.
comment on: http://stackoverflow.com/q/28191407
score: 0
type: Comment

http://stackoverflow.com/comment/44775864
has text: @Bergi that's curious, wasn't aware of that. Any reference? (cannot google it)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28204858
type: Comment

http://stackoverflow.com/a/28157939
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44710762
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44687511
has body: You don't want $('#text').slideToggle(); That's for moving up and down as you've discovered. For left to right, you'll want $('#text').animate();, and just style it yourself. jQueryUI already has this built in with their slide effect.
type: Answer
accepted answer of: http://stackoverflow.com/q/28157839
score: 2
answers question: http://stackoverflow.com/q/28157839

http://stackoverflow.com/comment/44768992
has text: My guess would be that since you're using an onclick attribute, you're not actually binding the function as the handler to the event. Instead, your binding an anonymous function that executes the function.
comment on: http://stackoverflow.com/q/28201351
type: Comment
type: QuestionComment
score: 1

css
tags question: http://stackoverflow.com/q/28241423
tags question: http://stackoverflow.com/q/28163362
tags question: http://stackoverflow.com/q/28252161
tags question: http://stackoverflow.com/q/28130266
tags question: http://stackoverflow.com/q/28212150
tags question: http://stackoverflow.com/q/28261099
tags question: http://stackoverflow.com/q/28184514
tags question: http://stackoverflow.com/q/28132966
tags question: http://stackoverflow.com/q/28235706
tags question: http://stackoverflow.com/q/28206886
tags question: http://stackoverflow.com/q/28257589
tags question: http://stackoverflow.com/q/28248900
tags question: http://stackoverflow.com/q/28153057
tags question: http://stackoverflow.com/q/28209135
tags question: http://stackoverflow.com/q/28177569
tags question: http://stackoverflow.com/q/28250984
tags question: http://stackoverflow.com/q/28246522
tags question: http://stackoverflow.com/q/28160280
tags question: http://stackoverflow.com/q/28203363
tags question: http://stackoverflow.com/q/28137399
tags question: http://stackoverflow.com/q/28163255
tags question: http://stackoverflow.com/q/28240921
tags question: http://stackoverflow.com/q/28234549
tags question: http://stackoverflow.com/q/28133855
tags question: http://stackoverflow.com/q/28263461
tags question: http://stackoverflow.com/q/28131481
tags question: http://stackoverflow.com/q/28131241
tags question: http://stackoverflow.com/q/28184475
tags question: http://stackoverflow.com/q/28274259
tags question: http://stackoverflow.com/q/28213390
tags question: http://stackoverflow.com/q/28221167
tags question: http://stackoverflow.com/q/28231742
tags question: http://stackoverflow.com/q/28253115
tags question: http://stackoverflow.com/q/28219087
tags question: http://stackoverflow.com/q/28202811
tags question: http://stackoverflow.com/q/28249608
tags question: http://stackoverflow.com/q/28199712
tags question: http://stackoverflow.com/q/28166625
tags question: http://stackoverflow.com/q/28277106
tags question: http://stackoverflow.com/q/28140150
tags question: http://stackoverflow.com/q/28123200
tags question: http://stackoverflow.com/q/28228585
tags question: http://stackoverflow.com/q/28202167
tags question: http://stackoverflow.com/q/28184212
tags question: http://stackoverflow.com/q/28129072
tags question: http://stackoverflow.com/q/28149730
tags question: http://stackoverflow.com/q/28173800
tags question: http://stackoverflow.com/q/28146809
tags question: http://stackoverflow.com/q/28195591
tags question: http://stackoverflow.com/q/28269249
tags question: http://stackoverflow.com/q/28257674
tags question: http://stackoverflow.com/q/28154643
tags question: http://stackoverflow.com/q/28135388
tags question: http://stackoverflow.com/q/28223423
tags question: http://stackoverflow.com/q/28244039
tags question: http://stackoverflow.com/q/28160693
tags question: http://stackoverflow.com/q/28191305
tags question: http://stackoverflow.com/q/28243478
tags question: http://stackoverflow.com/q/28133245
tags question: http://stackoverflow.com/q/28244895
tags question: http://stackoverflow.com/q/28207345
tags question: http://stackoverflow.com/q/28244473
tags question: http://stackoverflow.com/q/28249695
tags question: http://stackoverflow.com/q/28174609
tags question: http://stackoverflow.com/q/28258353
tags question: http://stackoverflow.com/q/28178263
tags question: http://stackoverflow.com/q/28138675
tags question: http://stackoverflow.com/q/28239241
tags question: http://stackoverflow.com/q/28275762
tags question: http://stackoverflow.com/q/28261727
tags question: http://stackoverflow.com/q/28213845
tags question: http://stackoverflow.com/q/28192072
tags question: http://stackoverflow.com/q/28201623
tags question: http://stackoverflow.com/q/28232747
tags question: http://stackoverflow.com/q/28271324
tags question: http://stackoverflow.com/q/28213795
tags question: http://stackoverflow.com/q/28272587
tags question: http://stackoverflow.com/q/28264389
tags question: http://stackoverflow.com/q/28205915
tags question: http://stackoverflow.com/q/28273029

http://stackoverflow.com/comment/44881765
type: Comment
has text: @Max_Salah yeah, It's possible! see [this fiddle](http://jsfiddle.net/71w7tagr/37/) put all these stuff into a `if`
comment on: http://stackoverflow.com/a/28261789
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44754039
comment on: http://stackoverflow.com/q/28181832
type: QuestionComment
has text: @DomAdams Added html. Don't have much. It's literally just a iframe.
score: 0
type: Comment

http://stackoverflow.com/comment/44737840
type: Comment
type: QuestionComment
has text: if it's really critical to get page source validated could write the scipt tag into the page using `document.write` or create a script tag using js and append it to head
comment on: http://stackoverflow.com/q/28184342
score: 0

http://stackoverflow.com/comment/44839996
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28236139
has text: Ah, but it would not eat up the grey space, it would just create a horizontal scroll, I see. Thanks!

http://stackoverflow.com/comment/44624344
comment on: http://stackoverflow.com/a/28125416
type: AnswerComment
score: 0
type: Comment
has text: How do I pass the current rating value as a parameter though?

http://stackoverflow.com/comment/117339074
comment on: http://stackoverflow.com/a/28165893
score: 0
type: AnswerComment
type: Comment
has text: Presence channels provide realtime updates regarding whether a member is present on a channel or not (online/offline). So, yes. More info on this can be found in the docs.

http://stackoverflow.com/comment/44896511
has text: No sir .. both not the same domain name .
type: AnswerComment
comment on: http://stackoverflow.com/a/28270399
score: 0
type: Comment

http://stackoverflow.com/q/28277197
downvote count: 0
has answer: http://stackoverflow.com/a/28641590
tagged with: jquery
favorite count: 0
has title: Drag and drop elements with touch support
tagged with: drag-and-drop
type: Question
has body: I try to implement a drag and drop interface on my website. There will be a list of elements on the left and about 15 places to move them on right. Then on a form submit, I will retrieve the elements in these places and get their attributes for back-end calculations. I found a plugin about it: dhtmlgoodies It is exactly what I want to do, but unfortunately, it doesn't support touchscreens. I found also the HTML5 Drag and Drop but most of the reviews were "stay away from it". Is there any way to make it support touch or any other plugin that will work with the same way? I found also JQuery UI Draggable and Sortable but I couldn't find any similar example with the first link.
upvote count: 2
answer count: 1
tagged with: jquery-ui
tagged with: javascript
type: UnansweredQuestion
score: 2

http://stackoverflow.com/comment/44878197
score: 0
type: Comment
type: QuestionComment
has text: Iteration seems to be the only solution that doesn't required source code transformation. If you are OK with preprocessing your code, then you could simply transform all CallExpressions and inject the Identifier name into the function.
comment on: http://stackoverflow.com/q/28260389

http://stackoverflow.com/q/28187005
answer count: 1
tagged with: onfocus
accepted answer: http://stackoverflow.com/a/28189567
has body: I've had great success with the following in the latest IE/Chrome: &lt;input value="Test"/&gt; &lt;script&gt; require(["dojo/on", "dojo/query", "dojo/domReady!"], function(on, query){ var blah = query("input")[0]; on(blah, "focus", function(e){ this.setSelectionRange(0,9999); }); }); &lt;/script&gt; The purpose is to select all the text in an input element when they click it (just like how it selects all text when tabbing in by default), so when they start typing it erases what was in there and starts afresh. However, in Firefox (SeaMonkey too) even with the above code something SOMETIMES unselects the text on mouseup and reverts to the default case of putting the caret where the user clicks and selecting nothing. You will always see that the text is all selected at least for a split second. What can I do? Any suggestions? See fiddle here: http://jsfiddle.net/avxra2q2/11/
tagged with: http://stackoverflow.com/tag/html
tagged with: dojo
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28189567
has comment: http://stackoverflow.com/comment/44742574
tagged with: javascript
has title: Having trouble selecting all input element text on mouse click in Firefox
score: 0

http://stackoverflow.com/q/28209919
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/44465004
tagged with: event-loop
tagged with: javascript
has title: nodejs: setImmediate callback executed after setTimeout(fn, 0) inconsistent with the nodejs doc describes
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44784909
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/72834122
has body: This is what the Node document said setImmediate(callback, [arg], [...]) To schedule the "immediate" execution of callback after I/O events callbacks and before setTimeout and setInterval . Returns an immediateObject for possible use with clearImmediate(). Optionally you can also pass arguments to the callback. However, if you run the following code you'll find the result not as expected. var fs = require('fs'); console.time('start'); setImmediate(function () { console.log('immediate'); console.timeEnd('start'); }); setTimeout(function() { console.log('timeout'); console.timeEnd('start'); }, 0); process.nextTick(function () { console.log('nextTick'); console.timeEnd('start'); }); The output is the following, setImmediate callback just executed after setTimeout callback. So do I misunderstand something in the Node document? nextTick start: 2ms timeout start: 2ms immediate start: 2ms
tagged with: node.js
has comment: http://stackoverflow.com/comment/137047101
has comment: http://stackoverflow.com/comment/44798215
tagged with: settimeout
score: 1

http://stackoverflow.com/a/28185469
has comment: http://stackoverflow.com/comment/44739873
type: Answer
has comment: http://stackoverflow.com/comment/44740034
answers question: http://stackoverflow.com/q/28185401
has comment: http://stackoverflow.com/comment/44740310
has comment: http://stackoverflow.com/comment/44740571
score: 0
has comment: http://stackoverflow.com/comment/44739699
has body: AngularUI bootstrap has a ngModal module, you can use that to display the table in a modal pop-up with buttons and what not. Check it out.

http://stackoverflow.com/comment/45021176
comment on: http://stackoverflow.com/a/28257733
has text: last question sir how to convert this one to accept multiple upload?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28226461
downvote count: 0
favorite count: 0
has title: How to create an object in which the object itself is a function?
has body: I have a javascript object from which I created from a constructor. var obj = new Obj(); It has several functions but I wish to also use it as follows; obj(); Obj is defined as: function obj() { this.blah = function () { }; } How can I do this?
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44816111
has answer: http://stackoverflow.com/a/28226623
has comment: http://stackoverflow.com/comment/44816131
upvote count: 1
has answer: http://stackoverflow.com/a/28226557
has answer: http://stackoverflow.com/a/28226549
tagged with: javascript
type: Question
answer count: 3

http://stackoverflow.com/q/28234744
score: 0
has answer: http://stackoverflow.com/a/28234923
tagged with: javascript
type: UnansweredQuestion
answer count: 1
has title: Call jquery plugin on app load and on every state change in angularjs
has body: In my AngularJS app I want to call: $('.nano').nanoScroller({ alwaysVisible: true }); When the app loads, and then when the state changes. For non-angular apps I would do: $(document).ready(function(){ $('.nano').nanoScroller({ alwaysVisible: true }); }); $(document).ajaxComplete(function(){ $('.nano').nanoScroller({ alwaysVisible: true }); }); I've looked at using a directive: .directive('nanoScoller', function() { return { $('.nano').nanoScroller({ alwaysVisible: true }); }; }); But how would I call that in the same way as above?
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/44814793
type: AnswerComment
has text: @alex: See above. To use a digit at the beginning of an ID selector in CSS *validly*, you must escape it.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225700

http://stackoverflow.com/comment/45197478
type: QuestionComment
has text: huh. As I know image tag send request as soon as it possible. Using js you can intercept browser window/tab close event, and add image to your dom. But, in this case, I think, better send ajax request. Also, you can add image with no srs attribute, and set this attribute on close. May be it is have sense to send empty alert (alert()) after request.
type: Comment
comment on: http://stackoverflow.com/q/28219970
score: 0

http://stackoverflow.com/comment/48949541
has text: I can't find any answer about this issue :(, when i go to support page of telerik, they advice me upgrade version, so i give up
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28205772
score: 0

http://stackoverflow.com/comment/44684260
comment on: http://stackoverflow.com/a/28156495
has text: doesn't really explain what is happening here. You should simply point him to the answer of 'what is an IIFE'
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28231643
has comment: http://stackoverflow.com/comment/44826538
has title: How to properly work with a scope which might have been destroyed
has comment: http://stackoverflow.com/comment/44826320
has comment: http://stackoverflow.com/comment/44826767
type: Question
has comment: http://stackoverflow.com/comment/44826200
has comment: http://stackoverflow.com/comment/44826575
has comment: http://stackoverflow.com/comment/44825829
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/44825616
has comment: http://stackoverflow.com/comment/44825755
has comment: http://stackoverflow.com/comment/44826043
has comment: http://stackoverflow.com/comment/44827502
tagged with: javascript
has body: I have a lot of code like this: app.directive(... function(...) { return function($scope...) { // add utilties like safeApply, handleError etc. decorateScope($scope); /** * Starts some-XXXX request that will run in the background for a while */ $scope.doSomething = function() { someService.doSomethingThatTakesAWhile(...) .then(function(result) { // success! $scope... // DANGER! }) .finally(function(result) { $scope.$apply(); // DANGER! }) .catch($scope.handleError.bind($scope)); // DANGER! }; };}); The three lines marked with DANGER! bear an awful fallacy: By the time the service has completed the requested action, $scope might have been destroyed (e.g. because it was part of a page that is not active anymore; my page system uses ng-if, etc.), and operating on a destroyed $scope is certainly not a good idea. Is there an Angular way out of this mess?
has comment: http://stackoverflow.com/comment/44825550
score: 0
tagged with: angularjs
tagged with: lifecycle
tagged with: asynchronous
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44826529

http://stackoverflow.com/comment/44666478
type: AnswerComment
has text: Its a simililar problem that you should be able to work through especially after the hint provided. inspect the `FCTTIME` object in each and pull out the necessary info.
type: Comment
comment on: http://stackoverflow.com/a/28147187
score: 0

hiveql
tag name: hiveql
tags question: http://stackoverflow.com/q/28187894
type: Tag

http://stackoverflow.com/q/28194897
has comment: http://stackoverflow.com/comment/44756747
has body: This must habe been asked a million times, but I can't find a solution to fit my needs. I need to regex to check if a string contains an url, then get it. So I have this : var regexToken = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&amp;\/\/=]+)|((mailto:)?[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g; while( (matchArray = regexToken.exec( source )) !== null ) { var result = matchArray[0]; } return result; This can retrieve : http(s)|ftp://domain.com http(s)|ftp://www.domain.com http(s)|ftp://www.domain.com/with/path But I need to modify that so it could also retrieve url that just begin with www : www.domain.com/with/path How to do that ? I'm really noob with regex...
tagged with: regex
has title: JS regex to check url
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28196143
type: Question
has comment: http://stackoverflow.com/comment/44756840
has comment: http://stackoverflow.com/comment/44756728
answer count: 2
has answer: http://stackoverflow.com/a/28195025
linked to: http://stackoverflow.com/q/27745
tagged with: javascript
score: 0

http://stackoverflow.com/a/28200429
answers question: http://stackoverflow.com/q/28200110
has comment: http://stackoverflow.com/comment/44767480
has comment: http://stackoverflow.com/comment/44767428
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44767152
has body: By not specifying the type in DS.attr(), it just passes the raw object through, you can see that here: http://emberjs.jsbin.com/zitobi/2/edit
has comment: http://stackoverflow.com/comment/44767737
upvote count: 2
has comment: http://stackoverflow.com/comment/44767611
has comment: http://stackoverflow.com/comment/44767082

http://stackoverflow.com/q/28126206
downvote count: 0
favorite count: 0
has title: Sort divs by value
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: sorting
has body: I am trying to sort articles by a child div inside using js. My article html using Expression Engine looks like this: {count} {first_name} {last_name} {relationship} {if '{relationship:results_grid:total_rows search:session="Race" sort="desc"}' >= 10 && '{relationship:results_grid:total_rows search:session="Race" sort="desc"}' <= 24} {relationship:results_grid:total_rows search:session="Race" sort="desc"} {if:elseif '{relationship:results_grid:total_rows search:session="Race"}' >= 25 && '{relationship:results_grid:total_rows search:session="Race"}' <= 49} {relationship:results_grid:total_rows search:session="Race" sort="desc"} {if:elseif '{relationship:results_grid:total_rows search:session="Race"}' >= 50} {relationship:results_grid:total_rows search:session="Race" sort="desc"} {if:else} {relationship:results_grid:total_rows search:session="Race" sort="desc"} {/if} {/relationship} I basically want to sort the articles by div.totalRows descending. I have so far only managed to return the values, but i'm not sure what to do next. Heres what I have so far: var badgeRaces = document.getElementById('races').getElementsByClassName("totalRows"); function badgeRacesCount(i){ for(var i = 0; i < badgeRaces.length; i++){ return badgeRaces[i].innerHTML; } } Any help would be appreciated.

http://stackoverflow.com/comment/44802261
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28219354
has text: This line confuses me: *"When a checkbox is changed to 'checked' then look to see if any of the sibling checkboxes are 'checked', if it is then .click() the parent of the checkbox."* - which checkbox?

http://stackoverflow.com/comment/44813428
has text: possible duplicate of [How do JavaScript closures work?](http://stackoverflow.com/questions/111102/how-do-javascript-closures-work)
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28225138

twitter-bootstrap
tags question: http://stackoverflow.com/q/28139016
tags question: http://stackoverflow.com/q/28252143
tags question: http://stackoverflow.com/q/28248961
tags question: http://stackoverflow.com/q/28255610
tags question: http://stackoverflow.com/q/28213338
tags question: http://stackoverflow.com/q/28219381
tags question: http://stackoverflow.com/q/28180000
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/28145582
tags question: http://stackoverflow.com/q/28241912
tags question: http://stackoverflow.com/q/28260193
tags question: http://stackoverflow.com/q/28276539
tags question: http://stackoverflow.com/q/28254670
tags question: http://stackoverflow.com/q/28126052
tags question: http://stackoverflow.com/q/28177405
tags question: http://stackoverflow.com/q/28222430
tags question: http://stackoverflow.com/q/28122503
tags question: http://stackoverflow.com/q/28237624
tags question: http://stackoverflow.com/q/28157652
tags question: http://stackoverflow.com/q/28250740
tags question: http://stackoverflow.com/q/28132732
tags question: http://stackoverflow.com/q/28160086
tags question: http://stackoverflow.com/q/28225925
tags question: http://stackoverflow.com/q/28252483
tags question: http://stackoverflow.com/q/28234894
tags question: http://stackoverflow.com/q/28247310
tags question: http://stackoverflow.com/q/28250009
tags question: http://stackoverflow.com/q/28235554
tags question: http://stackoverflow.com/q/28174509
tags question: http://stackoverflow.com/q/28249154
tags question: http://stackoverflow.com/q/28156968
tags question: http://stackoverflow.com/q/28182968
tags question: http://stackoverflow.com/q/28201525
tags question: http://stackoverflow.com/q/28216890
tags question: http://stackoverflow.com/q/28129656
tags question: http://stackoverflow.com/q/28239648
tags question: http://stackoverflow.com/q/28272899
tags question: http://stackoverflow.com/q/28181938
tags question: http://stackoverflow.com/q/28177917
tags question: http://stackoverflow.com/q/28149903
tags question: http://stackoverflow.com/q/28183157
tags question: http://stackoverflow.com/q/28239591
tags question: http://stackoverflow.com/q/28219769
tags question: http://stackoverflow.com/q/28212481
tags question: http://stackoverflow.com/q/28230773
tags question: http://stackoverflow.com/q/28177139
tags question: http://stackoverflow.com/q/28137452
tags question: http://stackoverflow.com/q/28219080
tags question: http://stackoverflow.com/q/28203589
tags question: http://stackoverflow.com/q/28250957
tags question: http://stackoverflow.com/q/28238197
tags question: http://stackoverflow.com/q/28270102
tags question: http://stackoverflow.com/q/28194108
tags question: http://stackoverflow.com/q/28157533
tags question: http://stackoverflow.com/q/28208388
tags question: http://stackoverflow.com/q/28170744
tags question: http://stackoverflow.com/q/28188825
tags question: http://stackoverflow.com/q/28262013
tags question: http://stackoverflow.com/q/28227497
tags question: http://stackoverflow.com/q/28175209
tags question: http://stackoverflow.com/q/28162139
tags question: http://stackoverflow.com/q/28195481
tags question: http://stackoverflow.com/q/28238377
type: Tag
tags question: http://stackoverflow.com/q/28193744
tags question: http://stackoverflow.com/q/28140705
tags question: http://stackoverflow.com/q/28243053
tags question: http://stackoverflow.com/q/28228447
tags question: http://stackoverflow.com/q/28203564
tags question: http://stackoverflow.com/q/28172785
tags question: http://stackoverflow.com/q/28254150
tags question: http://stackoverflow.com/q/28187944
tags question: http://stackoverflow.com/q/28247242
tags question: http://stackoverflow.com/q/28231416
tags question: http://stackoverflow.com/q/28215213
tags question: http://stackoverflow.com/q/28261508
tags question: http://stackoverflow.com/q/28197453
tags question: http://stackoverflow.com/q/28220571
tags question: http://stackoverflow.com/q/28253261
tags question: http://stackoverflow.com/q/28158339

http://stackoverflow.com/comment/44911742
comment on: http://stackoverflow.com/q/28278626
type: Comment
type: QuestionComment
score: 2
has text: Try setting the character set just before you query then. http://php.net/manual/en/mysqli.set-charset.php - 9 times out of 10, is the fix.

http://stackoverflow.com/q/28142654
answer count: 3
has comment: http://stackoverflow.com/comment/44656910
has answer: http://stackoverflow.com/a/28142673
downvote count: 0
has comment: http://stackoverflow.com/comment/44656962
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/44657009
duplicate of: http://stackoverflow.com/q/17189642
favorite count: 0
has body: Hi I have an object that I have filled from data in a CSV file. One of my ids is called "Disk_Usage(MB)" I try using my object.Disk_Usage(MB) but receive an error because javascript thinks disk usage is a function and that MB is a variable. I receive a reference error on the console saying MB is not defined.
type: UnansweredQuestion
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/4968406
has comment: http://stackoverflow.com/comment/44656937
has answer: http://stackoverflow.com/a/28142674
has title: How to access object value with ( ) parentheses in name?
linked to: http://stackoverflow.com/q/17189642
has answer: http://stackoverflow.com/a/28142701

list
tags question: http://stackoverflow.com/q/28261912
type: Tag
tags question: http://stackoverflow.com/q/28132494
tags question: http://stackoverflow.com/q/28259973
tag name: list
tags question: http://stackoverflow.com/q/28138964

http://stackoverflow.com/a/28226733
has comment: http://stackoverflow.com/comment/44817528
has comment: http://stackoverflow.com/comment/44816883
downvote count: 0
has comment: http://stackoverflow.com/comment/44817333
has comment: http://stackoverflow.com/comment/44827967
has comment: http://stackoverflow.com/comment/44816817
score: 2
has comment: http://stackoverflow.com/comment/44817498
upvote count: 2
has comment: http://stackoverflow.com/comment/44816796
has comment: http://stackoverflow.com/comment/44817165
has comment: http://stackoverflow.com/comment/44818689
has comment: http://stackoverflow.com/comment/44816969
has comment: http://stackoverflow.com/comment/44817125
has comment: http://stackoverflow.com/comment/44817546
type: Answer
has body: FINAL EDIT: After many misunderstandings, your problem is finally clear to me. To summarise what's in the comments, here is the situation: You have a module There are several files in this module All these files depend on a configuration whose path is unknown to the module itself This module does not do much on its own, and is meant to be used by other applications These applications should inject a configuration path into the module before it can be used Since you cannot modify dynamically what a module exports, you should use another approach. As with most situations that you encounter in programming, there is not one way which is always right, as much pedends on your requirements and limitations. The easiest way to do this (which I don't recommend) is to use a global variable, which you set in your myModule.js file and will be used by the other files in your module. The biggest drawback of this approach is that you wouldn't be able to use multiple instances of the module at the same time with different configurations. Also, any other module could easily modify (deliberately or not) you configuration at any time, by simply changing the value of the global variable, so it's also a security risk. A much better way, which will probably require more work on your part - depending on how many files you have - is to implement some kind of Inversion of Control (IoC). In your case, you could turn all your exports into functions that accept a config, and then initialise them by passing the active configuration after you require the module. I don't know the specifics of your implementation, so here is some sample code: // submodule1.js module.exports = function(config) { // return something that uses the configuration } // myModule.js var fs = require('fs'); var submodule1 = require('./submodule1'); var submodule2 = require('./submodule2'); // ... module.exports = function(configPath){ var config = JSON.parse(fs.readFileSync(configPath)); var sm1 = submodule1(config); var sm…
answers question: http://stackoverflow.com/q/28226632

http://stackoverflow.com/q/28240609
has answer: http://stackoverflow.com/a/28240678
favorite count: 0
has body: I dynamically created a textbox in php: echo '&lt;td&gt;&lt;input name="txtEmail" id="txtEmail" type="text" /&gt; &lt;/td&gt;'; Now i wanna pass the value of this textbox in javascript funcion. I have a updatebutton and i am passing the value on the onclick event, but it is not working. Here is my updatebutton code: echo '&lt;td&gt;&lt;input id="btnUpdate" type="submit" name="btnUpdate" value = "Update" onclick="updateButton(' . document.getElementsByName('txtEmail')[0].value . ')" /&gt; &lt;/td&gt;'; Here is my JavaScript function: function updateButton(custEmail) { alert (custEmail); }
has comment: http://stackoverflow.com/comment/44844367
type: UnansweredQuestion
tagged with: php
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44842326
has answer: http://stackoverflow.com/a/28240648
score: -1
has title: How to get html textbox value in PHP
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/44842349
tagged with: javascript

http://stackoverflow.com/comment/44884801
type: Comment
comment on: http://stackoverflow.com/a/28263576
score: 0
type: AnswerComment
has text: so tnx .how ever can i pass arguments using this method `data.url("shoot.bat")`? arguments are important i my case

http://stackoverflow.com/q/28171174
has comment: http://stackoverflow.com/comment/44711708
has body: I wanted to have a placeholder on my date input, &lt;input type="date" id="birthday"&gt; however due to the W3C spec we can't do this so, I have amended my item to a text input &lt;input type="date" id="birthday"&gt; and on focus I change the input type to date. $(document.body).on('focus', '#birthday', function (event) { event.preventDefault(); if($(this).attr('type') !== 'date') { $(this).attr('type','date'); } }); This is fine in the desktop browser (where supported), on Android, iPhone 4 and other devices however on the iPhone 6 when the input has focus we still get the text keyboard and not the date selector keyboard for the input. Does anyone have any ideas of how I can get the correct keyboard to be shown? I know it may be better to use or write a JS datepicker but I would like to use the native HTML5 date input. When the item loses focus and I click back on it the correct keyboard is shown. I tried to include code so when we gain the focus, we create a blur event then reintroduce the focus or a click event but this doesn't seem to work (see below). Has anyone had this problem before? $(document.body).on('focus', '#birthday', function (event) { event.preventDefault(); // this doesn't work if($(this).attr('type') !== 'date') { $(this).attr('type','date'); $(this).blur(); // perhaps this should be in a callback? $(this).click(); } });
type: Question
tagged with: iphone
tagged with: ios
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44711769
has title: iPhone 6 / iOS 8.1.2 - Setting input type='date' with JavaScript gets wrong Keyboard
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44932825
comment on: http://stackoverflow.com/a/28288638
score: 2
type: AnswerComment
has text: Aha! Thankyou Alexander- I am still fairly confused as to why Safari behaves in this way, though I certainly won't lose any sleep over it ;) Thanks very much for the help, certainly deserves the bounty! The solution seems quite simple in hindsight, though as always with these things, it takes the right perspective to figure it out.
type: Comment

http://stackoverflow.com/comment/44788363
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28210667
score: 1
has text: @MadBrozzeR: You really won't gain _any_ performance by copying part of the `Array` functionality. It's a native object that's well-optimized in modern browsers. Writing your own implementation will negate that optimization, not to mention the loops you'd have to jump through to actually make it work.

http://stackoverflow.com/comment/44680937
has text: http://stackoverflow.com/questions/7391567/when-using-settimeout-do-you-have-to-cleartimeout
comment on: http://stackoverflow.com/a/28154462
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44717503
type: QuestionComment
comment on: http://stackoverflow.com/q/28167925
has text: @eigenchris Have considered this, don't be sorry it's useful to give some context. The problem is that this is a process that will happen many many times (this process is tied to mouse movement), and there will be a lot of overlapping rectangles (slight shifts), because there are many more possible rectangles than indices that is likely to be more expensive. As is computing when a rectangle has been absorbed by other rectangles on each change.
score: 0
type: Comment

http://stackoverflow.com/comment/44912456
score: 0
type: Comment
type: QuestionComment
has text: im sorry the table code is too long because of the vbscripts included im new in this site. can't upload an image of the table also
comment on: http://stackoverflow.com/q/28279029

http://stackoverflow.com/comment/44848059
comment on: http://stackoverflow.com/a/28241121
has text: It's hard to say without looking at your code and understanding your intentions, but I'd opt for whatever works right and looks cleanest.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28250996
accepted answer: http://stackoverflow.com/a/28251553
downvote count: 0
score: 1
favorite count: 0
has body: I usually extend constructor functions with the .prototype property, to have multiple instances reference the same code (instead of having several identical code), like this: function Effect(){} Effect.prototype.run = function(){} However, due to the structure of my current project, I would like to do something like this: Define effects object, with effect options: var effects = { e1 : { run: function(){console.log(this);} }, e2 : { run: function(){console.log(this);} } } Create Effect instance using the object definitions function Effect(effect) { this.run = effect.run; } Now I can create several instances (maybe hundreds) var E1 = new Effect(effects.e1); var E2 = new Effect(effects.e2); var E3 = new Effect(effects.e2); ..... However I'm concerned, if the .run functions will be defined multiple times. Will these new instances reference the same function (defined in the effects object), or will they create a new 'local' function for each instance, using up memory space?
type: Question
has title: When do javascript reference a function, that are used in constructors?
upvote count: 1
has answer: http://stackoverflow.com/a/28251553
answer count: 1
has comment: http://stackoverflow.com/comment/44861683
tagged with: javascript
linked to: http://stackoverflow.com/q/8433459
type: AnsweredQuestion

http://stackoverflow.com/q/28132995
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28133092
accepted answer: http://stackoverflow.com/a/28133092
type: AnsweredQuestion
downvote count: 0
tagged with: knockout.js
type: Question
score: 1
has title: background binding with knockout
has body: I have the following knockout bindings... I want to remove the img tag and instead apply background images to the button. I have tried multiple examples all over the web, including from knockout, but I haven't been able to get it to work. data-bind="style: {background: 'url('../../Content/images/levels/' + $index() + '.png')' repeat-none left}" What am I doing wrong?
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/44701372
type: QuestionComment
comment on: http://stackoverflow.com/q/28159958
type: Comment
has text: What information do you get when you log the debug information from the Pusher JavaScript library? https://pusher.com/docs/debugging#pusher_logging
score: 0

http://stackoverflow.com/q/28278584
downvote count: 0
tagged with: javascript
favorite count: 0
has body: CasperJS doesn't open some sites. Example - https://play.google.com. PhantomJs opens Google Play and hasn't any problems. But Casper doesn't want. Casper returns I tried add --ignore-ssl-errors=true --ssl-protocol=tlsv1 OR --ssl-protocol=any --web-security=no And again Nothing helps. What I can do for this? I need functions of Casper and I can't use Phantom. my Js file: var casper = require('casper').create(); var url = casper.cli.get(0); casper.userAgent ( 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36' ); casper.start(url, function() { /* func here */ var js = this.evaluate(function() { return document; }); this.echo ( js.all[0].outerHTML ); }); casper.run(); Maybe someone has an idea? What the problem? Thanks.
has answer: http://stackoverflow.com/a/28283109
tagged with: casperjs
has title: CasperJS doesn't open some sites
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44913432
score: 2
tagged with: phantomjs
has answer: http://stackoverflow.com/a/30118966
tagged with: https
linked to: http://stackoverflow.com/q/26415188
type: Question
answer count: 2

http://stackoverflow.com/comment/44927825
score: 0
type: Comment
has text: Thanks flareartist you guide me to the right direction, all fixed :)
comment on: http://stackoverflow.com/a/28236720
type: AnswerComment

http://stackoverflow.com/a/48770127
score: 69
has body: I used '%j' option in console.log to print JSON objects console.log("%j", jsonObj);
answers question: http://stackoverflow.com/q/28149462
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/133518231
upvote count: 70

http://stackoverflow.com/q/28206082
has comment: http://stackoverflow.com/comment/44778424
has body: I want to add a class for some elements in jquery, and then i want to add a new class for the elements with the new class, but it does not working. my code: jQuery(document).ready(function () { jQuery('.nagyul').click(function () { jQuery(this).removeClass('nagyul'); }); jQuery('.ajtoo').click(function () { jQuery(this).removeClass('ajtoo'); }); jQuery('.indulas').click(function () { jQuery('.indulas').not(this).addClass('masodik'); }); jQuery('.masodik').click(function () { jQuery('.masodik').not(this).addClass('harmadik'); }); jQuery('.harmadik').click(function () { jQuery('.harmadik').not(this).addClass('negyedik'); }); jQuery('.negyedik').click(function () { jQuery('.negyedik').not(this).addClass('otodik'); }); jQuery('.otodik').click(function () { jQuery('.otodik').not(this).addClass('hatodik'); }); jQuery('.hatodik').click(function () { jQuery('.hatodik').not(this).addClass('hetedik'); }); jQuery('.hetedik').click(function () { jQuery('.butorok').removeClass('butorok'); }); }); jQuery represents $, but the wordpress doesn't understand it just this way. The website is: http://www.honlapkell.hu/room/fooldal/ Every object has on the picture a class called "indulas", and my plan to remove the class "butorok" from the background picture if the user clicked on every object. So it would be colorful too.
linked to: http://stackoverflow.com/q/26291389
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44778349
type: Question
has comment: http://stackoverflow.com/comment/44777841
has title: Jquery addClass for an added class
score: 0
linked to: http://stackoverflow.com/q/203198
duplicate of: http://stackoverflow.com/q/26291389
tagged with: javascript
has comment: http://stackoverflow.com/comment/44777800
tagged with: jquery
has comment: http://stackoverflow.com/comment/44777794

http://stackoverflow.com/comment/44846328
has text: is there other way to do this in chrome
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28242779
type: AnswerComment

http://stackoverflow.com/q/28253758
tagged with: asynchronous
has title: What is the proper way to submit HTML form after asynchronous data load?
type: AnsweredQuestion
tagged with: javascript
has body: Silly that I can't find this so I apologize in advance if I have duplicated, but I have looked through search engines and SO without finding what I need. What is the proper way to submit an HTML form upon user click but only after I have asynchronously loaded data from a 3rd party API to fill in for some of the form's hidden fields? I tried this structure, which has not worked: form onclick = function1() function1() calls function apicall that retrieves info from 3rd party api and in its completion handler then calls function2 function2 checks all form fields and returns true if form should be submitted, false if it should not With this structure, my form is always submitted, although both the 3rd party api function completion handler and function2 are working properly on their own. function2 can return false all day long but the form still submits. What can I do about this? The asychronous timing seems alright but somehow the return false is not getting back to the FORM element. Thank you for any tips or code samples.
tagged with: forms
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44866153
answer count: 1
has answer: http://stackoverflow.com/a/28253841
accepted answer: http://stackoverflow.com/a/28253841
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28232205
tagged with: data-files
type: Question
has title: D3 error with data file
tagged with: javascript
has answer: http://stackoverflow.com/a/28232349
score: 0
accepted answer: http://stackoverflow.com/a/28232349
answer count: 1
tagged with: d3.js
has body: i'm on the project for finishing my degree on computation, and i have a problem with D3, basically it works if I pass the data directly to the code, but with the data on a file, it says "n does not exist". I don't know why is this happening, here's my code: PD: If anyone needs a sample of my data file, just ask for it. Thanks in advance! Causa básica
type: AnsweredQuestion

http://stackoverflow.com/a/28279832
has body: You could use some regex like this...I think this will round as well as cut off... var newstring = string.replace(/[0-9]*\.[0-9]*/g, function(x){ return (+x).toFixed(2) }); Then you can apply that whereever, in a paths d attribute etc jsfiddle
has comment: http://stackoverflow.com/comment/44919436
answers question: http://stackoverflow.com/q/28270661
has comment: http://stackoverflow.com/comment/44939527
has comment: http://stackoverflow.com/comment/44951490
accepted answer of: http://stackoverflow.com/q/28270661
upvote count: 2
has comment: http://stackoverflow.com/comment/44914507
has comment: http://stackoverflow.com/comment/44914936
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44961567
has comment: http://stackoverflow.com/comment/44956680
has comment: http://stackoverflow.com/comment/44914249
type: Answer
has comment: http://stackoverflow.com/comment/44958736
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44977135

angularjs
tags question: http://stackoverflow.com/q/28183051
tags question: http://stackoverflow.com/q/28177694
tags question: http://stackoverflow.com/q/28187244
tags question: http://stackoverflow.com/q/28269852
tags question: http://stackoverflow.com/q/28235639
tags question: http://stackoverflow.com/q/28159178
tags question: http://stackoverflow.com/q/28139163
tags question: http://stackoverflow.com/q/28159832
tags question: http://stackoverflow.com/q/28209744
tags question: http://stackoverflow.com/q/28137431
tags question: http://stackoverflow.com/q/28130659
tags question: http://stackoverflow.com/q/28195438
tags question: http://stackoverflow.com/q/28221328
tags question: http://stackoverflow.com/q/28186053
tags question: http://stackoverflow.com/q/28204822
tags question: http://stackoverflow.com/q/28125161
tags question: http://stackoverflow.com/q/28262101
tags question: http://stackoverflow.com/q/28180031
tags question: http://stackoverflow.com/q/28142078
tags question: http://stackoverflow.com/q/28247528
tags question: http://stackoverflow.com/q/28269136
tags question: http://stackoverflow.com/q/28226525
tags question: http://stackoverflow.com/q/28198555
tags question: http://stackoverflow.com/q/28240874
tags question: http://stackoverflow.com/q/28267360
tags question: http://stackoverflow.com/q/28179757
tags question: http://stackoverflow.com/q/28255284
tags question: http://stackoverflow.com/q/28256642
tags question: http://stackoverflow.com/q/28237167
tags question: http://stackoverflow.com/q/28138008
tags question: http://stackoverflow.com/q/28170247
tags question: http://stackoverflow.com/q/28194672
tags question: http://stackoverflow.com/q/28232694
tags question: http://stackoverflow.com/q/28189647
tags question: http://stackoverflow.com/q/28153954
tags question: http://stackoverflow.com/q/28181858
tags question: http://stackoverflow.com/q/28194313
tags question: http://stackoverflow.com/q/28181100
tags question: http://stackoverflow.com/q/28175785
tags question: http://stackoverflow.com/q/28183651
tags question: http://stackoverflow.com/q/28205324
tags question: http://stackoverflow.com/q/28250957
tags question: http://stackoverflow.com/q/28256521
tags question: http://stackoverflow.com/q/28232185
tags question: http://stackoverflow.com/q/28180633
tags question: http://stackoverflow.com/q/28202069
tags question: http://stackoverflow.com/q/28212395
tags question: http://stackoverflow.com/q/28211586
tags question: http://stackoverflow.com/q/28147422
tags question: http://stackoverflow.com/q/28269722
tags question: http://stackoverflow.com/q/28197316
tags question: http://stackoverflow.com/q/28232049
tags question: http://stackoverflow.com/q/28172811
tags question: http://stackoverflow.com/q/28271303
tags question: http://stackoverflow.com/q/28168626
tags question: http://stackoverflow.com/q/28272387
tags question: http://stackoverflow.com/q/28198604
tags question: http://stackoverflow.com/q/28140341
tags question: http://stackoverflow.com/q/28195892
tags question: http://stackoverflow.com/q/28277065
tags question: http://stackoverflow.com/q/28264297
tags question: http://stackoverflow.com/q/28270029
tags question: http://stackoverflow.com/q/28191373
tags question: http://stackoverflow.com/q/28139243
tags question: http://stackoverflow.com/q/28161131
tags question: http://stackoverflow.com/q/28199396
tags question: http://stackoverflow.com/q/28168572
tags question: http://stackoverflow.com/q/28199990
tags question: http://stackoverflow.com/q/28210753
tags question: http://stackoverflow.com/q/28226691
tags question: http://stackoverflow.com/q/28165023
tags question: http://stackoverflow.com/q/28166111
tags question: http://stackoverflow.com/q/28260537
tags question: http://stackoverflow.com/q/28202047
tags question: http://stackoverflow.com/q/28278975
tags question: http://stackoverflow.com/q/28153586
tags question: http://stackoverflow.com/q/28217194
tags question: http://stackoverflow.com/q/28228886
tags question: http://stackoverflow.com/q/28227497
tags question: http://stackoverflow.com/q/28154449

http://stackoverflow.com/comment/44735486
type: Comment
has text: p.s. excessive GC activity is a valid concern when using immutable objects. But it is extremely unlikely to be an issue in "normal" code, especially code that is binding data to HTML DOM elements. The user just does not change the value nearly fast enough for GC slowdowns to ever be noticeable. Now, if you were coding the render loop of a WebGL animation then you might need to concern yourself with minimizing object allocations. But usually it just is not a measurable concern.
type: AnswerComment
comment on: http://stackoverflow.com/a/28171725
score: 0

http://stackoverflow.com/q/28140611
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Div's height change when float
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44652899
has answer: http://stackoverflow.com/a/28140692
accepted answer: http://stackoverflow.com/a/28140692
tagged with: javascript
has comment: http://stackoverflow.com/comment/44652863
type: Question
score: 0
answer count: 1
has body: I have a two divs and one of them will be floated to the left(the first one).But I realized that it's height and width change and I don't want that.Where's the problem? Here's my code with js used for floating the div: function batch() { var projects = ["Batch Script Tutorial", "Manage your PC", "Yahoo joke"]; var text = ""; var i; for (i = 0; i < projects.length; i++) { text += projects[i] + " "; } document.getElementById("batch").style.float = "left"; document.getElementById("showbatch").innerHTML = text; } .project { background-color: #5318a0; border-top-right-radius: 15px; border-bottom-left-radius: 15px; box-shadow: 2px 2px 3px black; color: #efedf2; font-family: helvetica, sans-serif; font-size: 20px; font-weight: normal; padding: 5px 7px; text-align: left; } .project:hover { background-color: #8358ba; border-radius: 2px; box-shadow: 2px 2px 3px black; color: #efedf2; font-family: helvetica, sans-serif; font-size: 20px; font-weight: normal; padding: 5px 7px; text-align: left } .project:active { background-color: #462076; border-radius: 2px; box-shadow: 2px 2px 1px white; color: #efedf2; font-family: helvetica, sans-serif; font-size: 20px; font-weight: normal; padding: 5px 7px; text-align: left } Projects

http://stackoverflow.com/q/28173413
possible better answer: http://stackoverflow.com/a/28173684
has answer: http://stackoverflow.com/a/28173446
has answer: http://stackoverflow.com/a/28173684
tagged with: javascript
has body: I have an object I want to use as a model for my angular controller. var SchedulingModel = function() { this.weekdays = Weekdays; this.scheduleType = "2"; this.customerType = "1"; this.timesOfTheMonth = TimesOfTheMonth; this.waivers = []; } angular controller: $scope.model = SchedulingModel; When I try and access model.weekdays and model.timesOfTheMonth they are both undefined... console.log($scope.model.timesOfTheMonth); console.log($scope.model.weekdays); Why is this?
score: 0
answer count: 2
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28173446
has title: Javascript and using an MVC style model (with angular)
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/44863315
type: Comment
type: QuestionComment
has text: Hi Lorenz..Sorry for that ..next time onwards that will not happen again ..
score: 0
comment on: http://stackoverflow.com/q/28252049

http://stackoverflow.com/comment/44787821
type: Comment
comment on: http://stackoverflow.com/a/28210476
score: 0
type: AnswerComment
has text: I installed skipper and tried, it didn't worked. Again I installed sails@beta still not working. Having same error.

http://stackoverflow.com/a/28237435
has comment: http://stackoverflow.com/comment/44840562
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/44840430
downvote count: 0
has comment: http://stackoverflow.com/comment/44837005
has comment: http://stackoverflow.com/comment/44836927
has comment: http://stackoverflow.com/comment/44838869
accepted answer of: http://stackoverflow.com/q/28235792
has comment: http://stackoverflow.com/comment/44839609
answers question: http://stackoverflow.com/q/28235792
has comment: http://stackoverflow.com/comment/44836646
score: 4
has body: You would first need to put the actual filter element into the svg element of the map, otherwise assigning a filter to a path or g won't work because the filter will be undefined. So you're going to need to do this in Javascript. But assigning a filter by classname in CSS is as far as i can see impossible because it will only work with the url() function of CSS. That won't fly with the dynamic SVG embedded in Leaflet's overlaypane. You can however assign it with Javascript: // Get the SVG element from the overlayPane var svg = map.getPanes().overlayPane.firstChild, // Create filter element svgFilter = document.createElementNS('http://www.w3.org/2000/svg', 'filter'), // Create blur element svgBlur = document.createElementNS('http://www.w3.org/2000/svg', 'feGaussianBlur'); // Set ID attribute of filter svgFilter.setAttribute('id', 'blur'); // Give room to blur to prevent clipping svgFilter.setAttribute('x', '-100%'); svgFilter.setAttribute('y', '-100%'); svgFilter.setAttribute('width', '500%'); svgFilter.setAttribute('height', '500%'); // Set deviation attribute of blur svgBlur.setAttribute('stdDeviation', 3); // Append blur element to filter element svgFilter.appendChild(svgBlur); // Append filter element to SVG element svg.appendChild(svgFilter); After that you can use the filter on polygons, linestrings, etc: // Creating a polygon and adding to the map var polygon = L.polygon([[10, 10],[-10,10], [-10,-10],[10,-10]]).addTo(map); // Set filter attribute on the polygon polygon._path.setAttribute('filter', 'url(#blur)'); That's it, here's a working example on Plunker: http://plnkr.co/edit/JTNgeXuiBaL8LIbmkVjz?p=preview
type: AcceptedAnswer

http://stackoverflow.com/comment/44631134
comment on: http://stackoverflow.com/q/28127403
type: QuestionComment
type: Comment
score: 2
has text: Clicking "Browse" opens the File Upload window for me. Besides that though, if you're shooting for IE 8 support, you should know that the `files` property wasn't supported until IE 10.

http://stackoverflow.com/comment/44789130
comment on: http://stackoverflow.com/a/28212284
has text: the controller can set the id value and thus be controlled from their on. ng-show will take the latest of the id value and change by itself.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44888626
type: Comment
type: QuestionComment
has text: I have a document, that is a course and in this course, the user should be able to sort the entries.
comment on: http://stackoverflow.com/q/28144362
score: 0

http://stackoverflow.com/comment/44654543
type: Comment
type: QuestionComment
has text: @Juhana, I disagree. Loading all of angular for example is always a big problem for web apps. I've seen apps that have included splash screens for the first page hit just for that.
score: 0
comment on: http://stackoverflow.com/q/28141452

http://stackoverflow.com/q/28188555
has body: change text of button when i click it. when i click on the button if it show make it hide . $(function () { if ($(".clickMe").text() == 'show') { $(".clickMe").text("hide") } else { $(".clickMe").text("show") } }); ShowDetials
score: 0
downvote count: 2
has title: change text of button when i click it
tagged with: javascript
type: UnansweredQuestion
answer count: 4
tagged with: jquery
has answer: http://stackoverflow.com/a/28188605
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28188587
has answer: http://stackoverflow.com/a/34744228
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28188657
upvote count: 2

http://stackoverflow.com/q/28212590
has comment: http://stackoverflow.com/comment/44789105
tagged with: c#
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/44795008
answer count: 1
downvote count: 0
tagged with: .net
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: Why Array.Length = 1 when empty array is passed to function via ajax?
has comment: http://stackoverflow.com/comment/44789134
has body: I am having a bit of a difficulty grasping this one: var data = { // ... files: $("#asgnNew-Popup .attachments-block").find(".file").length &gt; 0 ? $("#asgnNew-Popup .attachments-block").find(".file").map(function() { return $(this).attr("data-fileid"); }).get() : JSON.stringify([]), // ... }; This is part of my data parameter which is passed along with POST type request into C# .Net controller. public class Dto { // ... public int[] Files { get; set; } // ... } All it basically translates into is either an array of ints or an empty array: files: [1,2,3] or files: [] There is a slight problem with empty array. If it is specified as [] I get no data item files included in the post request. So I had to wrap it in JSON.stringify(). But the strangest thing happens when I do something like this on the server: postdata.Files.Length I get a value of 1 returned (expecting a zero). And when I check that value: postData.Files[0] I get a value of 0 when I am not expecting there to be any values at all. Can anybody shed some light what is happening here ?
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28214822
type: Question

http://stackoverflow.com/a/45560733
score: 1
downvote count: 0
type: Answer
has body: The d3fc-discontinuous-scale component adapts any other scale (for example a d3 time scale) and adding the concept of discontinuities. These discontinuities are determined via a 'discontinuity provider' the built in discontinuitySkipWeekends allows you to skip weekends. Here's an example: const skipWeekendScale = fc.scaleDiscontinuous(d3.scaleTime()) .discontinuityProvider(fc.discontinuitySkipWeekends()); And here's a complete demo: https://bl.ocks.org/ColinEberhardt/0a5cc7ca6c256dcd6ef1e2e7ffa468d4
upvote count: 1
answers question: http://stackoverflow.com/q/28129412

http://stackoverflow.com/comment/44913734
type: AnswerComment
type: Comment
has text: You can use jQuery with `jQuery.parseJSON("[0.1, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.2]");`
comment on: http://stackoverflow.com/a/28242556
score: 0

http://stackoverflow.com/comment/49429321
comment on: http://stackoverflow.com/a/30672405
score: 0
type: Comment
has text: Hey brenzy, certainly an issue there if the error message doesn't display so i'll need to fix that up. Just don't understand why some users on IE11/Win10 can use the location search and some can't. But i'll try fix that error first.
type: AnswerComment

http://stackoverflow.com/comment/44805347
type: Comment
has text: If you use this on the client side your API key will be visible to everybody, and everybody can (ab)use it. If you are writing a server side script, for example for usage with node.js, it will be as safe as in PHP.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28221107

http://stackoverflow.com/a/28265667
has comment: http://stackoverflow.com/comment/44888074
score: 0
has comment: http://stackoverflow.com/comment/44888029
upvote count: 1
has comment: http://stackoverflow.com/comment/44888332
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/44888564
has body: This simple regex is all you need: / {0,2}\n/g Basically, it works on the premise that previously "replaced" strings will already have two spaces preceding each line feed, so it captures and replaces those as well. var str = "First line\nSeconnd Line \nThirdLine \\n"; str = str.replace(/ {0,2}\n/g, ' \n'); // str === "First line \nSeconnd Line \nThirdLine \\n" See what it captures here, and see what it replaces here. EDIT Sorry, my previous assumption had been that you wanted line feeds to be replaced by two spaces, then another line feed. I didn't notice that you wanted the line feed escaped. However, that's easy enough to do: replace(/ {0,2}\n/g, ' \\n'); Just escape the backslash, see the newer version here.
answers question: http://stackoverflow.com/q/28265580
type: Answer
accepted answer of: http://stackoverflow.com/q/28265580

http://stackoverflow.com/comment/44640370
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28132708
type: AnswerComment

http://stackoverflow.com/comment/44742304
type: Comment
comment on: http://stackoverflow.com/a/28186842
has text: Yes, maybe you are right. justifies your downvote. But personally i learnt jQuery before javascript. anyways, i will keep your advice in mind.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28124651
has body: I have encountered a problem with an API I want to use. The API returns plain JSON but its a cross domain AJAX call so I have to use jsonp. $.ajax({ type: "GET", url: url + query, contentType: "application/json", dataType: "jsonp", success: function(data){ console.log(data); } }); The problem is when I change the dataType to "json" an error occurs: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'X' is therefore not allowed access. This is because its a cross domain ajax call. But when it is jsonp it says: Uncaught SyntaxError: Unexpected token : In other words it does not recognize the json format. I am using jquery for the ajax call. Any suggestions how to solve this?
has answer: http://stackoverflow.com/a/28124779
downvote count: 0
has title: Cross domain AJAX called with JSONP returns plain JSON
type: Question
linked to: http://stackoverflow.com/q/2067472
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: jsonp
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28124726
has comment: http://stackoverflow.com/comment/44622714
type: UnansweredQuestion

http://stackoverflow.com/q/28252990
tagged with: java
has title: AES javascript encryption and Java decryption
type: Question
linked to: http://stackoverflow.com/q/27179685
tagged with: encoding
has body: I've already implemented RSA encryption in javascrypt and RSA decryption in java which is just a simple process. But the problem I've to encrypt a large amount of data which is not possible for RSA at a single go, either I should have to split the data to be encrypted (which will complicate the process) or use AES with RSA encryption and decryption. So I opted to go for AES with RSA encryption and decryption. Here is my javascript code which use Crypto-js Output in Jsp encrypted: U2FsdGVkX192e9xprFPyuWu3Rxv2+CDMXiu2/TtNDwExvo4Dstx1mbqCHgds27Ng7zhYayVLjifeG15cuHI7hHfmEWvVeo7DDmOUsZmQAEM= secretPasses: 23f96d28ae9f9c1c8c37050f79acdb37 encode: a7dHG/b4IMxeK7b9O00PATG+jgOy3HWZuoIeB2zbs2DvOFhrJUuOJ94bXly4cjuEd+YRa9V6jsMOY5SxmZAAQw== In my post method of servlet, I used sysout to check the received data is same or not. The secret pass I'm getting is the same, encoded data is also the same. The problem is, encode data changed its form in the jsp itself while doing the conversion from encrypted to encode. I tried to pass "encrypted" directly via ajax, but it's pointing error, if I put "alert(typepof encrypted);", it alerts as "Object". How can I pass the original encrypted data to servlet? System.out.println("secretpasses: "+request.getParameter("secretPasses")); System.out.println("encode: "+request.getParameter("encode")); Output in Java : secretpasses: 23f96d28ae9f9c1c8c37050f79acdb37 encode: a7dHG/b4IMxeK7b9O00PATG+jgOy3HWZuoIeB2zbs2DvOFhrJUuOJ94bXly4cjuEd+YRa9V6jsMOY5SxmZAAQw== Also it would be welcome if I can get some examples for AES encryption in Javascript and decryption in Java. I notified that it's AES with RSA encryption and decryption, but it's not inserted into current code. If I can get the AES part working, I can do RSA appropriately by encrypting the AEs key.
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28253296
has comment: http://stackoverflow.com/comment/44864927
tagged with: cryptography
linked to: http://stackoverflow.com/q/27220297
has comment: http://stackoverflow.com/comment/44864878
upvote count: 3
tagged with: encryption
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28253296

http://stackoverflow.com/comment/44906463
type: QuestionComment
comment on: http://stackoverflow.com/q/28275954
score: 2
has text: "it doesn't work" is not clear problem statement. What happens? How does this differ from what you expect to happen? What have you done to debug it?
type: Comment

email
tags question: http://stackoverflow.com/q/28191677
tags question: http://stackoverflow.com/q/28192381
tags question: http://stackoverflow.com/q/28253055
tags question: http://stackoverflow.com/q/28196827
tags question: http://stackoverflow.com/q/28275176
tags question: http://stackoverflow.com/q/28226227
tags question: http://stackoverflow.com/q/28163274
tags question: http://stackoverflow.com/q/28185680
tags question: http://stackoverflow.com/q/28248532
tags question: http://stackoverflow.com/q/28212683
type: Tag
tags question: http://stackoverflow.com/q/28160619
tag name: email

http://stackoverflow.com/comment/44831408
type: QuestionComment
comment on: http://stackoverflow.com/q/28234904
type: Comment
has text: possible duplicate of [Simplest code for array intersection in javascript](http://stackoverflow.com/questions/1885557/simplest-code-for-array-intersection-in-javascript)
score: 0

http://stackoverflow.com/q/28250810
upvote count: 2
type: UnansweredQuestion
score: 1
downvote count: 1
type: Question
has body: Hi I am using jsPdf for making pdf of html content, it is going fine for short content and creating pdf , but when I am trying to use it on large content with html2canvas.js (for rendering css), it is not creating pdf. Any suggestions or sample code for this would be helpful.Thank you.
has answer: http://stackoverflow.com/a/42377046
tagged with: jspdf
answer count: 2
has answer: http://stackoverflow.com/a/28737739
tagged with: javascript
tagged with: html2canvas
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: jsPdf using html2canvas.js for export pdf from html is not working for large data
tagged with: css

http://stackoverflow.com/comment/44626445
has text: It's explicitly not a dependency of most angular.js apps, and the question was not tagged jquery. Including it unnecessarily is not good practice.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28126460

http://stackoverflow.com/comment/44767711
has text: Try the manual https://docs.angularjs.org/guide/scope. Also go through the tutorial on the documentation site ... do each step, well wortth the time
score: 2
comment on: http://stackoverflow.com/q/28200727
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44901432
has text: David a div element is not really intended for editing so the prevent default or return false does not work. I changed your fiddle to use an input end then your code works: http://jsfiddle.net/pwmspdm4/3/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28273182

http://stackoverflow.com/comment/44724317
has text: thanks for your response. I tried to implement it as follow in header and in body Upload but its not responding
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28177135
type: Comment

http://stackoverflow.com/q/28133167
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28133221
type: Question
downvote count: 0
has title: JavaScript Dynamic Fade Background Image
has comment: http://stackoverflow.com/comment/44638967
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44638927
accepted answer: http://stackoverflow.com/a/28133221
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web
has body: I'm trying to change the background image of my application dynamically at an interval of 5 seconds from 5 images and then repeat. Here's my JS code: &lt;script type="text/javascript"&gt; $(function() { var body = $('body'); var backgrounds = new Array( 'url(img/bg/bk.jpg)', 'url(img/bg/nb.jpg)', 'url(img/bg/la.jpg)', 'url(img/bg/ts.jpg)', 'url(img/bg/bh.jpg)' ); var current = 0; function nextBackground() { body.css( 'background', backgrounds[current = ++current % backgrounds.length] ); setTimeout(nextBackground, 5000); } setTimeout(nextBackground, 5000); body.css('background', backgrounds[0]); }); &lt;/script&gt; Here's my CSS: body { background: no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; padding-top: 40px; padding-bottom: 40px; } But it doesn't work. Even the background is blank-white. The &lt;body&gt; doesn't have any attributes.
favorite count: 0
has comment: http://stackoverflow.com/comment/44638948
upvote count: 1
tagged with: css
linked to: http://stackoverflow.com/q/28128700

http://stackoverflow.com/a/28157767
has comment: http://stackoverflow.com/comment/44688124
has comment: http://stackoverflow.com/comment/44689950
downvote count: 0
has comment: http://stackoverflow.com/comment/44687703
has body: Use module.exports to make the io object available to other modules. app.js: var express = require('express'); var app = express(); var http = require('http').createServer(app).listen(3001); var io = require('socket.io')(http); app.io = io; module.exports = app; require('./functions') functions.js: var io = require('./app').io; io.on('connection', function(socket) { console.log('a user connected'); );
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28157620
has comment: http://stackoverflow.com/comment/44688829
has comment: http://stackoverflow.com/comment/44690619

http://stackoverflow.com/q/28249688
has comment: http://stackoverflow.com/comment/44859551
accepted answer: http://stackoverflow.com/a/28249755
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44859144
favorite count: 0
has comment: http://stackoverflow.com/comment/44859153
tagged with: ajax
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/44859103
has answer: http://stackoverflow.com/a/28249755
score: 0
upvote count: 1
downvote count: 1
answer count: 1
has body: I will try to explain my problem in a simple way. My code looks like these. A web page, systemView.php, has following code <?php require_once 'Common_Function.php'; ?> <?php A(); ?> Common_Function.php is <?php include 'systemView_Function.php'; include 'database.php'; ?> systemView.php has A() as well as B() <?php function A() { D(); // a function in database.php //and show a few button on the page } function B($number) { D(); // a function in database.php //some codes to show something in the page } if (isset($_POST['B'])) { B($_POST['B']); } ?> A() function will show some buttons on the page when called. When one of the buttons is clicked. javascript will then call B() by ajax. This function in js is $(".abutton").click(function(){ $("#two").empty(); var number = parseInt($(this).text()); $.ajax({ url: "./systemView_Function.php", type: "POST", data: {"B": number}, dataType: "JSON", success: function(data) { $("#two").append(data); } }); }) Now the problem is when D() is not included in B(), the codes run successfully and shows something in id="two" div. However, if D() is included in B(), console in browser shows errors, and nothing in second div.
has title: PHP function cannot be called
has comment: http://stackoverflow.com/comment/44859128
tagged with: javascript

http://stackoverflow.com/a/28151509
downvote count: 0
has comment: http://stackoverflow.com/comment/44674559
has comment: http://stackoverflow.com/comment/44674489
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44674418
has comment: http://stackoverflow.com/comment/44674598
has body: This is just because you can't make multiple HTML items with same id and expect this to work. Give them different ids or make this CSS classname-based. For example you can make first element have id="save1" and first dialogue id="dialog1" Class based solution would be: give the link class="save" and the dialog class="dialog" instead of id. Then the javaScript would be like: Put the &lt;a&gt; and the dialog div in same section &lt;div class="section"&gt; so they could have same parent element. Then: (function() { $('a.save').click(function(event) { event.preventDefault(); $(this).parents(".section:first").find(".dialog").dialog({ modal: true, scrollable: false, draggable: false, resizable: false, width: 450, height: 445 }) }) })();
answers question: http://stackoverflow.com/q/28151422

http://stackoverflow.com/comment/44727279
type: Comment
comment on: http://stackoverflow.com/q/28178989
score: 0
type: QuestionComment
has text: `io.socket` and `socket`, one or both are undefined, check them.

http://stackoverflow.com/a/28253663
has comment: http://stackoverflow.com/comment/44866015
type: Answer
has comment: http://stackoverflow.com/comment/44865950
has body: You need Underscore.js as listed in your require statement.
downvote count: 1
has comment: http://stackoverflow.com/comment/44865970
answers question: http://stackoverflow.com/q/28253636
upvote count: 0
score: -1

http://stackoverflow.com/comment/44773265
has text: Yes, I believe if you are only looking at that field as a date type then you can always set the `date` field to midnight of the current date. Then with the `expireAfterSeconds` set to the number of seconds in a day, it should remove the document at midnight the next day.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28203455

http://stackoverflow.com/q/28277347
type: Question
has body: This code is for click event but i want onchange event like on select option. Can anybody suggest me how to add onchange event on this ajax code? Thank you in advance.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44908974
has comment: http://stackoverflow.com/comment/44908981
has answer: http://stackoverflow.com/a/28277735
answer count: 3
has answer: http://stackoverflow.com/a/28277722
has answer: http://stackoverflow.com/a/28277384
favorite count: 0
tagged with: ajax
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to add onchange event on ajax?
linked to: http://stackoverflow.com/q/12750307
score: 1
downvote count: 1

http://stackoverflow.com/q/28128693
accepted answer: http://stackoverflow.com/a/28128767
has body: how I can get the list value of all attribute from HTML evlemnt via loop now from my code i have three attr i want obtain the value of all three attr in one list via loop how i can do it ? example: f1="hi" f2=" how" f3=" are" f4="you" in button Element i want get all of them together
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28128776
has title: How to get the value of more than one attribute of element in JavaScript dom via loop
possible better answer: http://stackoverflow.com/a/28128775
has answer: http://stackoverflow.com/a/28128775
has answer: http://stackoverflow.com/a/28128767
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/44748111
has text: Actually I forgot it too. I had to check it with some quick test in the browser console. :) But I glad to be able to help.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28190123

observable
tags question: http://stackoverflow.com/q/28252536
tag name: observable
type: Tag

http://stackoverflow.com/a/28172519
has body: use split and pop: var str1="tag:youtube.com,2008:video:VrtMalb-XcQ"; str1.split(':').pop()
answers question: http://stackoverflow.com/q/28172505
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44723776
has comment: http://stackoverflow.com/comment/44714299
has comment: http://stackoverflow.com/comment/44714393
upvote count: 2
has comment: http://stackoverflow.com/comment/44714209

http://stackoverflow.com/comment/44839144
score: 0
has text: I didn't receive an edit. Look, you can do whatever you want with the info we extracted from the select box when the click event happens. I'm not very well versed in google analytics, but you can simply call the tracking function there and pass it some data to track that data. It really isn't that hard, let alone rocket science, so play around a bit. Google analytics is _just a function_ so you can call it there instead of on click. Good luck.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28236409

http://stackoverflow.com/comment/44699125
score: 0
type: AnswerComment
has text: Yes, thanks for your help. Its also worked at search filter menu.
type: Comment
comment on: http://stackoverflow.com/a/28159724

http://stackoverflow.com/comment/44898461
type: QuestionComment
comment on: http://stackoverflow.com/q/28270831
score: 0
has text: Darrn @CerlinBoss thank you for reminding!
type: Comment

http://stackoverflow.com/comment/44741864
type: QuestionComment
comment on: http://stackoverflow.com/q/28186664
has text: Build the string on-the-fly based on user input.
score: 0
type: Comment

http://stackoverflow.com/q/28247207
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28304510
tagged with: javascript
tagged with: google-apps-script
has answer: http://stackoverflow.com/a/28247274
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/76905925
has answer: http://stackoverflow.com/a/32828008
answer count: 4
has comment: http://stackoverflow.com/comment/44855465
score: 2
type: AnsweredQuestion
has body: I'm trying to make a Google Sheet that opens to an assigned sheet automatically for a large team using their gmail addresses when accessing it. How do I slice a string in Apps Scripts? The "email.slice" on line three is just something I made up as a place holder. function onOpen() { var email = Session.getActiveUser().getEmail(); var username = email.slice[0:-9]; var ss= SpreadsheetApp.openById(username); SpreadsheetApp.setActiveSpreadsheet(ss); }
upvote count: 3
has title: How do I slice strings in Google Apps Script like in Python?
accepted answer: http://stackoverflow.com/a/28247274
possible better answer: http://stackoverflow.com/a/28304510

http://stackoverflow.com/comment/44872589
type: Comment
score: 0
has text: `setTimeout(clickAds, 35000);` and remove `location.reload()` from true condition :) remove `.get(0)` (change to first())... take a look to debugger console...
comment on: http://stackoverflow.com/q/28248584
type: QuestionComment

http://stackoverflow.com/comment/44873465
comment on: http://stackoverflow.com/q/28257667
has text: Perhaps you have other JavaScript errors interfering with the execution of the function. Have you debugged your code or examined the browser's console for errors?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28206477
score: 4
has comment: http://stackoverflow.com/comment/65873656
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28196415
type: Answer
has body: First things first: you should never be getting that 500 error, because you should be validating those fields in your controller code before using them! As for the request still being processed despite your CORS settings: what you're seeing is the intended behavior, but I empathize with your confusion. Here's what you have to understand about CORS and POST requests: POST requests don't trigger a preflight request from the browser as long as they use a common content type header like application/x-www-form-urlencoded. The reason for this is that it has long been the case that regular old HTML forms are allowed to freely POST to a different origin. When you do a regular jQuery $.post, it uses that same content type, so the server can't distinguish it from a regular form POST and lets it through. The browser, upon receiving the empty Access-Control-Allow-Origin header, says "no way Jose" and refuses to show the response, but by that time the ship has sailed--that POST request has been processed. If you don't want any requests from non-whitelisted origins to be processed by Sails, you can set the securityLevel in your CORS config to 1 (high) or 2 (very high): module.exports.cors = { allRoutes: true, origin: require('./local.js').hosts, // this is 'http://localhost', securityLevel: 1 } This will cause Sails to return a 403 response to any request from a disallowed domain. The difference between high and very high is that high will still allow cross-origin requests from different protocols (so your Postman requests will still work), whereas very high locks everything down tight.
upvote count: 4
has comment: http://stackoverflow.com/comment/65889951
answers question: http://stackoverflow.com/q/28196415

http://stackoverflow.com/q/28188730
has answer: http://stackoverflow.com/a/44555445
type: Question
accepted answer: http://stackoverflow.com/a/28237964
tagged with: kendo-grid
tagged with: javascript
has comment: http://stackoverflow.com/comment/44746171
answer count: 3
score: 3
has answer: http://stackoverflow.com/a/28191783
downvote count: 0
has body: I have locked command column in the Grid (see image below). I would like to replace default buttons with custom icons (or with set of icons supplied with Kendo). How can I easily do it? I tried to find something in documentation but without luck. Thanks for any advice. EDIT: added button code command: [ { name: "destroy", text: $translate.instant('REMOVE'), className: "btn-destroy" }, { name: "detail", text: $translate.instant('DETAIL'), click: function(e) { var clickedRow = this.dataItem($(e.currentTarget).closest("tr")); var id = clickedRow.id; GlobalHelperService.redirectTo("/milestone-sequences/detail/"+id); return false; } } ],
has comment: http://stackoverflow.com/comment/44746091
favorite count: 0
tagged with: kendo-ui
possible better answer: http://stackoverflow.com/a/28191783
has answer: http://stackoverflow.com/a/28237964
has title: Kendo Grid command column - how to replace buttons with icons?
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/q/28222631
has body: I want to make floating HTML5 element move back and forward on my page. Exactly like SmoothDivScrolling that is already out there. I did try SmoothDivScrolling and it is not working well with the layout of my page. So I have started to write my own. If I give a position to my element using CSS I will be able to retrieve the position with: element = document.getElementById(image); position = element.style.left; // removing px from the value position = parseInt(position.substring(0,position.length-2)); This will return the left position of the element inside its parent only if the CSS contain: left:0px; As mentioned, I want my elements to be floating because I plan to have many more than one element; Now since I want to animate my element I have to change the position by changing the value of 0px with: fish.style.left = (newPosition)+'px'; It is working if I provide the style of my floating element with: position:relative; //This doesnt really afect my floating left:0px; //this does So I tried to retrieve the position with DOM instead of CSS using: var element = document.getElementById(image); var rect = element.getBoundingClientRect(); position = rect.left; Now this is working. It retrieves the position of the element relative to the body even if no left positioning was specified in the style. I am wondering if there is way to change the position of that element without going trough CSS style. Because each element might have different width, floating them take care of the positioning. If I provide a position to each of them they won't be floating anymore. The floating option avoid all the math involved on positioning. But if it's really needed I guess I will do the math. Any suggestions? Here is the full code for who ever wants to reinvent the wheel with me
has answer: http://stackoverflow.com/a/28224099
answer count: 1
tagged with: javascript
has title: Positioning floating element using JavaScript (for animation)
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28224099
score: 0
type: Question

http://stackoverflow.com/comment/44865637
has text: @JuanMendes i understand it was `JSON.parse(data)` throwing error so i don't understand how double parsing it would fix error. That's why i was asking it ;)
score: 0
comment on: http://stackoverflow.com/q/28253334
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28261698
tagged with: javascript
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44882079
has title: Magento: Category Management and iframe not refresh
answer count: 0
tagged with: iframe
has body: I have Magento 1.9.1. and I am in Category Management. When I click on a child (category) or a node (sub-category) in the tree, the right column, with the iframe and the fileds, doesn't refresh automatically. I see the circle with the "loading" but after the page doesn't change. I have to refresh manually the browser page to see the fields with the right content. What is the event/script that updates the content of the iframe on click? What is a best tool/plugin to check this problem? Thanks
upvote count: 1
type: Question
tagged with: magento
tagged with: categories

http://stackoverflow.com/comment/44784600
comment on: http://stackoverflow.com/q/28209959
has text: Your `setCookie` does not return a value so you can not call it in `alert`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/52432723
comment on: http://stackoverflow.com/a/28250697
score: 0
type: AnswerComment
type: Comment
has text: @Bergi do you need to await the async function examle getExample() from outside code?

http://stackoverflow.com/q/28274573
tagged with: browserify
answer count: 1
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has body: I am trying to loop over array of strings and require them with require and for some reason this is not working. This is working: console.log(require('./siteParts/testis')); This is not: var siteParts = ['testis']; siteParts.forEach(function(part) { console.log(require('./siteParts/' + part)); Error: Cannot find module './siteParts/testis' });
score: 1
has answer: http://stackoverflow.com/a/28274629
type: Question
accepted answer: http://stackoverflow.com/a/28274629
downvote count: 0
tagged with: javascript
has title: Js browserify require from array of strings does not working

http://stackoverflow.com/comment/44730050
comment on: http://stackoverflow.com/a/28180478
has text: you just change `element.find('.on-focus')[0].focus();` by the code above
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44648712
type: Comment
comment on: http://stackoverflow.com/q/28138228
type: QuestionComment
score: 0
has text: @Mouser Oh, absolutely, give me a few minutes

recursion
type: Tag
tags question: http://stackoverflow.com/q/28160993
tags question: http://stackoverflow.com/q/28139962
tags question: http://stackoverflow.com/q/28238082
tag name: recursion
tags question: http://stackoverflow.com/q/28181911
tags question: http://stackoverflow.com/q/28179694
tags question: http://stackoverflow.com/q/28205317
tags question: http://stackoverflow.com/q/28152191

http://stackoverflow.com/q/28266689
type: AnsweredQuestion
tagged with: browser
has answer: http://stackoverflow.com/a/28267088
tagged with: credit-card
answer count: 1
has body: Often you can enter pages, which has disabled paste from Clipboard, like input password or Credit card numbers, which is very silly, because who keeps in memory complex passwords or CC numbers? People like to use password keepers for those things. I found that problem is in: ... b.bind("paste",function(){return!1} ... How to deal with it? How to unbind interception of paste method?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28267088
has title: How to enable paste on HTML page with locked "Cmd+V"?
tagged with: clipboard
score: 0
type: Question
tagged with: passwords

http://stackoverflow.com/a/28269738
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28269722
score: 2
has body: You are passing arguments to the service function, it is not an array it is just array like. And it is a collection of all arguments passed into the function validateMyname. If you want to just pass name you could just do: return myService.validateXY(arg); So in short: Line1 - You are just using the passing in value via the function's argument which is a local variable arg defined in the scope of that function. Line2 - You are accessing the special argument object that was passed in from the line after LINE1 if you are looking to pass variable number of arguments transferred from controller function to your service function you could do so by using function.apply: myService.validateXY.apply(null, arguments); //null provided you don't refer to context via this.
answers question: http://stackoverflow.com/q/28269722
upvote count: 2

highcharts
tags question: http://stackoverflow.com/q/28216308
tags question: http://stackoverflow.com/q/28228284
tags question: http://stackoverflow.com/q/28234919
tags question: http://stackoverflow.com/q/28124459
tags question: http://stackoverflow.com/q/28126688
tags question: http://stackoverflow.com/q/28204923
tags question: http://stackoverflow.com/q/28184263
tags question: http://stackoverflow.com/q/28203689
tags question: http://stackoverflow.com/q/28195267
tags question: http://stackoverflow.com/q/28134299
tags question: http://stackoverflow.com/q/28146999
tags question: http://stackoverflow.com/q/28154539
tags question: http://stackoverflow.com/q/28177759
tags question: http://stackoverflow.com/q/28234530
tags question: http://stackoverflow.com/q/28162210
tags question: http://stackoverflow.com/q/28211074
tags question: http://stackoverflow.com/q/28220721
tags question: http://stackoverflow.com/q/28131249
tags question: http://stackoverflow.com/q/28181179
tags question: http://stackoverflow.com/q/28186100
tags question: http://stackoverflow.com/q/28216832
tags question: http://stackoverflow.com/q/28150493
tags question: http://stackoverflow.com/q/28231809
tags question: http://stackoverflow.com/q/28209259
tags question: http://stackoverflow.com/q/28248855
tags question: http://stackoverflow.com/q/28124757
tags question: http://stackoverflow.com/q/28152130
tags question: http://stackoverflow.com/q/28274507
tags question: http://stackoverflow.com/q/28262074
tags question: http://stackoverflow.com/q/28272350
tags question: http://stackoverflow.com/q/28148633
tags question: http://stackoverflow.com/q/28181128
tags question: http://stackoverflow.com/q/28244646
tags question: http://stackoverflow.com/q/28212504
tags question: http://stackoverflow.com/q/28170479
tags question: http://stackoverflow.com/q/28276592
tags question: http://stackoverflow.com/q/28198049
tags question: http://stackoverflow.com/q/28268116
tags question: http://stackoverflow.com/q/28165946
type: Tag
tags question: http://stackoverflow.com/q/28209607
tag name: highcharts
tags question: http://stackoverflow.com/q/28176725

http://stackoverflow.com/tag/pdf
tags question: http://stackoverflow.com/q/28175982
tags question: http://stackoverflow.com/q/28196065
tags question: http://stackoverflow.com/q/28159688
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/28244078
tags question: http://stackoverflow.com/q/28157652
tags question: http://stackoverflow.com/q/28235720
tags question: http://stackoverflow.com/q/28226488
tags question: http://stackoverflow.com/q/28182007
tags question: http://stackoverflow.com/q/28207106
tags question: http://stackoverflow.com/q/28197179

http://stackoverflow.com/a/28207357
answers question: http://stackoverflow.com/q/28207274
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44780312
has comment: http://stackoverflow.com/comment/44779869
type: Answer
has body: Event target section $(".data") and target selector ".marks" both added after page load so you delegate() method won't target section .data selector class you should use parent selector that is load on page load or document for delegate selector section $(document).delegate(".marks","keyup",function () { if ($('#txtmarks1').val().length &gt; 2) { if ($('#txtmarks1').val() &gt; 100) { alert("does not exceed 100"); } } })
has comment: http://stackoverflow.com/comment/44780063
has comment: http://stackoverflow.com/comment/44779811
downvote count: 0
has comment: http://stackoverflow.com/comment/44779903
score: 1
has comment: http://stackoverflow.com/comment/44780268
accepted answer of: http://stackoverflow.com/q/28207274
upvote count: 1

http://stackoverflow.com/comment/44722648
has text: I know the traveling salesman problem, but in this case the idea is to determine the best route out of a point A visiting various points and coming back to a point A. In my case I will not go back to point A, need to find the best point end.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28176724

http://stackoverflow.com/a/28167328
answers question: http://stackoverflow.com/q/28166706
upvote count: 1
has comment: http://stackoverflow.com/comment/44705153
has body: If you make functions instead of objects you can keep track of this: class Child constructor: (@id) -&gt; console.log "new child #{@id}" animations: -&gt; start: =&gt; console.log @, "#{@id} start animation" custom: -&gt; rotate: =&gt; console.log @, "#{@id} custom rotate animation" Then just call the function, that will return an object. child.animations().start()
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28166706
score: 1

http://stackoverflow.com/comment/44846935
type: Comment
comment on: http://stackoverflow.com/q/28226532
score: 0
type: QuestionComment
has text: @RamisWachtler I tried his suggestion, you can check it on the website now, still not working :(, still takes you to the about if youve already pressed Enter

http://stackoverflow.com/q/28164405
possible better answer: http://stackoverflow.com/a/28164470
has title: having some javascript trouble, for loop. turning a number into its string value
type: Question
tagged with: for-loop
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28164471
accepted answer: http://stackoverflow.com/a/28164471
has comment: http://stackoverflow.com/comment/44699515
favorite count: 0
has answer: http://stackoverflow.com/a/28164483
has answer: http://stackoverflow.com/a/28164470
answer count: 4
has comment: http://stackoverflow.com/comment/44699491
upvote count: 1
type: AnsweredQuestion
has body: I am looking to make a program that will concotate(sp?) a real number no matter the length into a string. for these purposes 1234 is fine turning into "one""two""three""four" or "onetwothreefour" or w/e. I was attempting to do this by iterating through the real number and then go through the array. my output in node is undefined through my console.log()'s shown below. Not really too sure what to do since Im new to this any help is greatly appreciated. var datArray = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] var toEnglish = function (number) { for ( var i = 0; i &lt;= number.length; i++ ) { var newNumber = datArray[number[i]]; newNumber = newNumber + newNumber; } console.log(newNumber); return newNumber; } toEnglish(1234);
score: 1
has answer: http://stackoverflow.com/a/28164475

http://stackoverflow.com/comment/44756503
has text: IF a client has a large share of users on ie6 (god forbid) then its more then acceptable that they should require ie6 compatability
type: QuestionComment
comment on: http://stackoverflow.com/q/28194786
score: 2
type: Comment

http://stackoverflow.com/q/28131082
score: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: So, I'm chaining together sequential ajax, to load an array of urls in order. Originally I used .then() instead of .always(), and either way it works fine - provided that all urls existed. However, since there's a possibility of missing files, I wanted to compensate for that, and then finally, inform the user of which files were missing, in order to make it easier to rectify. However, the problem is, on a missing file/404, the code executes, like it should, but then exits the loop, preventing any further ajax calls. So I figure, I need some way of either handling the fail() and forcing a success regardless, or some other way of overriding the default behavior on a 404, so it continues progressing through the loop. Unfortunately, the closest Google results, were how to do the opposite (force a failure on success). var missing=[]; uLoadList.reduce(function(prev, cur, index) { return prev.then(function(data) { return $.ajax("/wiki/"+cur).always(function(data) { var temp = $('#mw-content-text',data); temp = $('pre',temp); if(temp.length &gt; 0) { //handle success }else{ //handle failure missing.push(cur); } }); }); }, $().promise()).done(function() { if(missing.length &gt; 0) { //notify of missing objects } //continue on. }); One final note, to alleviate confusion: the URLs, and the script itself, are on a MediaWiki site - so even if a 404 is returned, there will always be page content, and will contain the element with the id of "mw-content-text".
upvote count: 1
answer count: 1
has title: Jquery Ajax prevent fail in a deferred sequential loop
favorite count: 0
accepted answer: http://stackoverflow.com/a/28140912
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28140912
downvote count: 0

http://stackoverflow.com/comment/44876122
has text: The functions here aren't returning anything at all. Perhaps you are wanting to ask why the value of the `state` variable isn't what you expect?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28259147
score: 2

http://stackoverflow.com/comment/44628766
comment on: http://stackoverflow.com/a/28127922
score: 0
type: AnswerComment
has text: Thank you! I'll have to look into this.
type: Comment

http://stackoverflow.com/q/28239406
tagged with: angularjs
type: UnansweredQuestion
score: 0
has title: JQuery UI Datepicker and Angular JS in custom Umbraco Dashboard
has body: I recently built a custom dashboard with the help of Sebastiaan forums in this post: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60887-Custom-dashboard-Umbraco-update-service However, I have now modified my code in an attempt to make the interface more user friendly by including a datepicker on two fields so that our users can pass two dates into our web services and have a result returned. The problem is, I am receiving the following Javascript errors in Firebug when I try and access my Dashboard in the back office: Error: Argument 'AxumUpdateService' is not a function, got undefined cb@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:17:79 xa@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:17:187 Jc/this.$gethttp://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:53:310 k/&lt;@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:44:274 n@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:7:72 k@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:44:139 e@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:40:139 y/&lt;@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:39:205 Odhttp://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:158:14 u/j.success/&lt;@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:100:347 Uc/e/j.promise.then/i@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:79:432 Uc/e/j.promise.then/i@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:79:432 Uc/e/j.promise.then/i@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:79:432 Uc/e/j.promise.then/i@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:79:432 Uc/g/&lt;.then/&lt;@http://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:80:485 Xc/this.$gethttp://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:92:268 Xc/this.$gethttp://localhost:60282/umbraco/lib/angular/1.1.5/angular.min.js:90:140 Xc/…
has answer: http://stackoverflow.com/a/28364915
type: Question
tagged with: javascript
tagged with: jquery-ui-datepicker
has comment: http://stackoverflow.com/comment/44841573
tagged with: umbraco
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44841851

http://stackoverflow.com/q/28255360
accepted answer: http://stackoverflow.com/a/28255431
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 0
upvote count: 1
tagged with: knockout.js
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28255431
tagged with: javascript
has body: Here is the code and i can't figured out why it doesn't work, or what i have to change to make it work... this is not updated: &lt;strong data-bind="text: SelectedId" /&gt; http://jsfiddle.net/ZP79w/732/ I want to have an object which has the value of id of the selected value.
answer count: 1
has title: How to get the id of the selected item in KnockoutJS
favorite count: 0

http://stackoverflow.com/comment/44811264
type: QuestionComment
has text: Yes but it wasn't in ES6, I think, because there's no good reason to use such a property
score: 0
comment on: http://stackoverflow.com/q/28222228
type: Comment

http://stackoverflow.com/q/28253227
tagged with: jquery
has answer: http://stackoverflow.com/a/28253438
type: UnansweredQuestion
tagged with: android
tagged with: webview
has body: I'm developing an app which has to: Open a webpage in a Webview; Check the available links and click on the link which contains a certain word (I.e. http://www.domain.com/myword); after the click, the link will open in the same webview. I tried the following code but it' giving this error "E/Web Console(6169): Uncaught SyntaxError: Unexpected identifier at null:1". WebSettings myBrowserSettings = myBrowser.getSettings(); myBrowserSettings.setJavaScriptEnabled(true); Log.d("Stefano", "JS enabled"); myBrowser.loadUrl("javascript:document.getElementsByTagName('a[href*='myWord']')[0].click();"); Can you help me? Consider that I'm using document.getElementsById('My ID') in another part of the app (to click a button) and it's working correctly; but here, i'm not able to get getElementsByTagName working. Thanks for your time and availability UPDATE: I replaced 'a[href*='myWord']' with \"a[href*='myWord']\" as suggested by the user but now i have this error E/Web Console(2683): Uncaught TypeError: Cannot call method 'click' of undefined at null:1. Any idea?
type: Question
has title: Android - Click on webpage link with Javascript
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/44889209
comment on: http://stackoverflow.com/a/28266152
has text: In the provided demonstration it appears that the parenthesis are captured as well - surely this would be unwanted behaviour?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28271668
answers question: http://stackoverflow.com/q/28271413
score: 0
has body: You can use select event of the later datePicker for manipulating the values, onSelect : function () { var newDate = $(this).datepicker('getDate'); if($(this).prop("id")=="plecare"){ //If plecare select event , set minDate for sosire $("#sosire").datepicker( "option", "minDate", newDate); } } And here is a demo Fiddle Note: if you want to add "+1 day" to minDate then you should use , var newDate = $(this).datepicker('getDate'); newDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()+1); I hope this is what you want.
type: Answer

http://stackoverflow.com/q/28236585
has answer: http://stackoverflow.com/a/28236642
has title: how to prevent bubbling event when use Turbolinks.visit(path)
tagged with: turbolinks
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/28236687
has body: I use aspnetmvcturbolinks in own project and I have reload page with Turbolinks.visit(path) when user add text in input . but,when page changed I check this keyup event of input is fire more one and I add return false but not work . $(document).on("ready page:load", function() { $('input[name=keyword]').keyup(function (e) { alert(); var $text = $(this).val(); if ($text.length &gt; 1) { $('html, body').animate({ scrollTop: 0 }, 600, function() { Turbolinks.visit('@searchUrl' + '?keyword=' + $text); }); } if ($text.length == 0) { Turbolinks.visit('@searchUrl'); } return false; }); $(document).on('change', 'select[name="order"]', function() { Turbolinks.visit('@searchUrl'); }); $(document).on('change', 'select[name="count"]', function() { Turbolinks.visit('@searchUrl'); }); }); what is solution? thanks
score: 0
answer count: 2

http://stackoverflow.com/q/28126983
favorite count: 0
has body: I'm developing an Angular single page app by using Restangular and ui-router. Now i met an issue, i need to call some initial server api to get some global data before any directive or controller is instantiated and after angular is bootstrapped (angular.bootstrap). My app is bootstrapped manually by call angular.bootstrap instead of using ng-app directive. Updated: Thanks @alp and @radim-köhler. I have tried both the 'resolve' and the 'run' method, but it seems that either of them can resolve my issue. I have tried them with following code. My requirement is both the 'hello-world' directive and the 'HomeCtrl' can be blocked or delayed to be instantiated until the resolve1 or resolve2 is resolved, but now the test result is: The resolve2 specified in $stateProvider.state's resolve object only can block the instantiation of HomeCtrl, hello-world directive is still be instantiated before the resolve2 is resolved. The resolve1 in the module's 'run' method can NOT block any of them (HomeCtrl controller or hello-world directive). I also create this in Plunker Maybe i need to wrap the hello-wrold directive and the HomeCtrl into another controller and declare an abstract or normal state for the controller, right? angular.module('app', ['restangular', 'ui.router']) .directive('helloWorld', function() { console.log('Initialize hello-world directive.'); return { restrict: 'E', scope: { name: '@' }, template: 'Hello {{name}}' } }) .controller('HomeCtrl', function($scope) { console.log('Initialize home page.'); $scope.content = 'This is in HomeCtrl'; }) .config(function($stateProvider, $urlRouterProvider) { $stateProvider.state('home', { url: '/', controller: 'HomeCtrl', template: ' {{content}} ', resolve: { init: function($q) { return $q(function(resolve, reject) { setTimeout(function() { console.log('Resolving2 ...'); // resolve2 resolve(); }, 1000 * 3); }); } } }); $urlRouterProvider.otherwise('/'); }) .run(function(Restangular, $q) { console.log('App module is starting...')…
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28132793
type: Question
tagged with: restangular
has title: In Angular, Is there a way to do some initial logic before any controller or directive is instantiated but after the app is bootstrapped?
answer count: 3
has answer: http://stackoverflow.com/a/28127021
upvote count: 1
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/28132793
possible better answer: http://stackoverflow.com/a/28127048
has answer: http://stackoverflow.com/a/28127048
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/q/28169866
has body: I want to show different divs depending on the text input. Here is the HTML markup: Genau! Und jetzt en guete! Naja, denk doch nochmal scharf nach! I created a jquery function to fire the different div boxes but it doesnt work: Here is the JS code: $(document).ready(function () { $('form').submit(function () { var code = $('#sesam').val(); if (code === 'respect') { $(".box").hide(1000); $(".richtig").show("slow"); } else { $(".box").hide(1000); $(".falsch").show("slow"); } }); }); If I use alerts to test it, it works, but not with the divs. Also jsfiddle gives me some errors: http://jsfiddle.net/c0anytrj/ I just want to check the value and then show one div or another.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
type: AnsweredQuestion
has title: Check text input and show a div accordingly
has answer: http://stackoverflow.com/a/28169918
accepted answer: http://stackoverflow.com/a/28169918
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/28179885
downvote count: 0
tagged with: coordinates
type: Question
tagged with: mobile
tagged with: javascript
upvote count: 3
has title: Scrolling messes up my canvas mouse coordinates - Javascript Telerik Mobile
tagged with: canvas
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28179984
has body: Getting the mouse coordinates on the canvas always works unless I have to scroll and then it goes wrong. y can end up being a negative number while it is on the canvas. Here is my code: code block creating canvas: var width = (document.getElementById('assessmentSectionForm' + platform).clientWidth); var height = Math.round(theSection.thePicture.ySize * (width / theSection.thePicture.xSize)) var canvas = buildCanvas(Math.round(width), height, false, true); //var canvas = document.getElementById('assessmentImage'); var ctx = canvas.getContext("2d"); _context = ctx; _canvas = canvas; canvas.addEventListener("mousedown", relMouseCoords, false); function getting coordinates: function relMouseCoords(event) { var totalOffsetX = 0; var totalOffsetY = 0; var canvasX = 0; var canvasY = 0; var sect = _currentSection; var currentElement = this; do { totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft; totalOffsetY += currentElement.offsetTop - currentElement.scrollTop; } while (currentElement = currentElement.offsetParent) if (event.pageX || event.pageY) { canvasX = event.pageX - totalOffsetX; canvasY = event.pageY - totalOffsetY; } //alert( 'x: ' + canvasX + ' y: ' + canvasY); for (var x = 0; x &lt; _currentSection.allHotSpots.length; x++) { if (_currentSection.allHotSpots[x].myPicZoom === _currentPicZoomCode) { scaleTheHotSpot(_currentSection.allHotSpots[x], _currentSection.thePicture); } } for (var i = 0; i &lt; _currentSection.allHotSpots.length; i++) { if (canvasX &gt; _currentSection.allHotSpots[i].topLeft[0] &amp;&amp; canvasX &lt; _currentSection.allHotSpots[i].bottomRight[0] &amp;&amp; canvasY &gt; _currentSection.allHotSpots[i].topLeft[1] &amp;&amp; canvasY &lt; _currentSection.allHotSpots[i].bottomRight[1] &amp;&amp; _currentSection.allHotSpots[i].myPicZoom === _currentPicZoomCode) {... The rest of relMouseCoords is irrelevant because the mouse coords should be correct before I get to where I cut it off. Why does this code not account for scrolling?…
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/55677
tagged with: telerik
score: 3

http://stackoverflow.com/comment/44653321
comment on: http://stackoverflow.com/a/28140199
has text: JSFiddle isn't saving the code properly. You can use the instructions I've added in the answer. **PS. Make sure to add jQuery 1.7+ support from the left menubar**
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28151860
has comment: http://stackoverflow.com/comment/44693190
type: AcceptedAnswer
upvote count: 50
has body: I have a reasonable experience with React, and basically none with Angular. So what I'm going to say about Angular is from things I read and heard from other people. React Pros Easy to learn Isolated components are easier to maintain The "Always Re-render" way of React is nice to keep it easier to understand when things get complex Flux is a really good alternative to the MVC pattern. The one-way data flow helps with maintainability and keeping data and DOM elements consistent. Combined with Immutable.JS data structures, it's the cherry on top of the cake :) Cons Doesn't play nice with DOM manipulation libs (e.g.: jQuery) It really changes the way you do things, particularly if you're using Flux, which is good, but it takes a little getting used to. I found some cases where the re-rendering every time slows down the app when the components handle a large dataset on the render method. Optimising performance in these cases can get a little bit tricky. Angular Pros Good documentation Members of the community are helpful (it's easy to find good answers here on SO). Two-way data binding makes some things really easy to implement Cons Performance issues: To make two-way data binding it has to check for changes in your data model. It also has to parse your HTML to make it's magic work. This slows things down, and, if the app is running on a mobile device, it drains the battery faster Logic in spread across HTML and JS: code harder to understand, maintain and debug. v2 coming to fix some issues, but making all v1 code obsolete
type: Answer
has comment: http://stackoverflow.com/comment/44690727
has comment: http://stackoverflow.com/comment/68240933
accepted answer of: http://stackoverflow.com/q/28151067
score: 49
answers question: http://stackoverflow.com/q/28151067
downvote count: 1

http://stackoverflow.com/comment/44713166
score: 0
comment on: http://stackoverflow.com/a/28171769
type: AnswerComment
has text: @Karl-AndréGagnon Sorry, Yup.. That must be `.next()`.. A typo.
type: Comment

http://stackoverflow.com/q/28179440
has answer: http://stackoverflow.com/a/28179879
downvote count: 0
has comment: http://stackoverflow.com/comment/44728161
favorite count: 0
has title: How can I change the border colour of a using JavaScript?
has body: I'm trying to change the colour of a in my .html file. Here is what I have but for some reason it doesn't seem to be working. My .html file: Computers Price Location And now my .js file: function changeBorderColor() { var table = document.getElementById("table_row").getElementsByTagName("td"); table.style.borderColor = "red"; } Why doesn't my change colour when I activate the changeBorderColor() function? Thanks in advance for any tips and help!
has comment: http://stackoverflow.com/comment/44728089
has answer: http://stackoverflow.com/a/28179647
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44728038
possible better answer: http://stackoverflow.com/a/28179535
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28179535
has answer: http://stackoverflow.com/a/28179484
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28179484
tagged with: html-table
tagged with: function

http://stackoverflow.com/comment/44762272
type: QuestionComment
has text: when you click on one show it and hide the other and vice versa
score: 1
comment on: http://stackoverflow.com/q/28197887
type: Comment

http://stackoverflow.com/a/28273906
type: Answer
answers question: http://stackoverflow.com/q/28262337
score: 2
downvote count: 0
upvote count: 2
has body: I was using tinyMCE editor. The issue was that it automatically encode all the html code entered if any. I had to use $decoded_content = html_entity_decode($content); and then pass the result to html purifier.

http://stackoverflow.com/q/28231558
favorite count: 0
tagged with: regex
has answer: http://stackoverflow.com/a/28231620
type: AnsweredQuestion
has title: Javascript RegExp test class name
score: 1
accepted answer: http://stackoverflow.com/a/28231625
has comment: http://stackoverflow.com/comment/44825606
upvote count: 1
possible better answer: http://stackoverflow.com/a/28231620
type: Question
tagged with: javascript
has body: I have to test classnames of different nodes in event delegation method I am using : the test case I am using is function clickHandler(e){ var evt = e || window.event; target = evt.target || evt.srcElement, cls = target.className,id = target.id; if(/\bcell\b/i.test(cls)){ //perform some action is node having classname cell is clicked } } but this particular test is match for nodes with classname .cell as well as .cell-validation-text. The above test return true for both these nodes. How can i modify my regExp so as my above test returns true only for node having class .cell and false for .cell-validation text
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28231625
has comment: http://stackoverflow.com/comment/44825452

configuration-files
type: Tag
tags question: http://stackoverflow.com/q/28232660
tag name: configuration-files

http://stackoverflow.com/a/28206608
answers question: http://stackoverflow.com/q/28206205
has body: The way this is written it will only return the first result OR the last result in @Mai example. Also rString and result is a string which can only hold one value so no matter what it will only return one of them. You can try an array instead. You can see it running here http://jsfiddle.net/p4arbzcu/ function randomString(length, chars) { // not sure why this function is called randomString... var result = []; // holds url endings var urlEnd = ""; // holds current url for (var i = length; i &gt; 0; --i) { urlEnd += chars; result[result.length] = urlEnd; // adds current url to url endings } return result; } var rString = randomString(4, '0'); window.alert(rString); // displays allert with url endings array
score: 0
type: Answer

http://stackoverflow.com/comment/44978249
has text: I think that most of your confusion is being caused because you are approaching JavaScript from a conventional object-oriented perspective. JS is very different. I've changed your jsbin to give you some examples http://jsbin.com/dejenaxizi/2/edit?js,console I don't have time to explain it all to you, but you can find more info here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28269368

header
tags question: http://stackoverflow.com/q/28253949
type: Tag
tags question: http://stackoverflow.com/q/28131481
tags question: http://stackoverflow.com/q/28156249
tags question: http://stackoverflow.com/q/28174370
tag name: header
tags question: http://stackoverflow.com/q/28265899

http://stackoverflow.com/q/28164274
has body: Whenever you have an element with its display property set to none, and you try to trigger a transition so that it "fades in", it jumps quickly to full opacity, unless you add a timeout. Do you have any idea of how to get around this? The timeout works, kinda, but not as well as I would like. Here's what I have: fadeIn: function(speed) { var len = this.length, speed = speed || '1000', transitionString = 'opacity ' + speed + 'ms'; while (len--) { el = this[len]; //*this* is an object containing DOM elements (function motherLoop(el, len) { setTimeout(function () { el.style.display = 'block'; el.style.transition = transitionString; el.style.opacity = 0; //timeout needed for transition to trigger... (function babyLoop(el, len) { setTimeout(function () { el.style.opacity = 1; if(len--) babyLoop(el, len); }, 10); })(el, len); function transitionEnd() { el.removeEventListener('transitionend', transitionEnd); el.style.opacity = ''; el.style.transition = ''; } el.addEventListener('transitionend', transitionEnd); if(len--) motherLoop(el, len); }, 50); })(el, len); } return this; } As you can see, it is really messy code, but so far the timeout has been the only thing I find that works. This only happens if the element has its display set to none, though. And it's sometimes set to none because I have another method that hides given element. As you can see, I first set the (hidden) element to display: block, I add the CSS transition, set its opacity to 0 and then to 1. It is when switching to opacity: 1 that the timeout is crucial for the transition to trigger. Is there anything you can see that I'm doing wrong? What I'd like to do, specifically, is not rely on the timeouts, because they don't work well (the transition still doesn't trigger sometimes), and because they don't seem "natural". As a side effect, I'd like to learn why this happens, if you could help. Thank you.
has comment: http://stackoverflow.com/comment/44703485
tagged with: fadein
has comment: http://stackoverflow.com/comment/44704811
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/28167405
tagged with: triggers
linked to: http://stackoverflow.com/q/3331353
tagged with: transition
type: Question
has title: Changing quickly between opacities doesn't trigger transition
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/44852473
type: AnswerComment
has text: @Shomz Can you check my question ? [LINK](http://stackoverflow.com/questions/28176243/imagecreatefromgif-from-base64-encoded-animated-gif-in-post)
comment on: http://stackoverflow.com/a/28242867
type: Comment
score: 0

http://stackoverflow.com/comment/44685999
comment on: http://stackoverflow.com/q/28156835
has text: Answered your question :) Tell me if it works..
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28255066
upvote count: 2
answers question: http://stackoverflow.com/q/28255035
has comment: http://stackoverflow.com/comment/44868588
type: Answer
has comment: http://stackoverflow.com/comment/44868571
score: 2
has body: if you write a function, you have to run it
downvote count: 0
has comment: http://stackoverflow.com/comment/44868553

http://stackoverflow.com/comment/44756574
type: QuestionComment
comment on: http://stackoverflow.com/q/28194518
has text: Thanks I'll try more and let you know. Though I have been messing with it for some time. The result is that the entire JQuery suggestion stops working and Chrome starts suggesting stuff offline.
score: 0
type: Comment

http://stackoverflow.com/q/28191560
has body: I am learning about css,jquery etc. I thought this code would remove the border around the words "haha", but it does not. haha does a script "refresh" the browser page completely? Any help on this?
answer count: 2
downvote count: 2
accepted answer: http://stackoverflow.com/a/28191615
tagged with: javascript
has title: running jquery script in HTML
possible better answer: http://stackoverflow.com/a/28191741
has answer: http://stackoverflow.com/a/28191741
type: AnsweredQuestion
upvote count: 0
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28191615
tagged with: http://stackoverflow.com/tag/html
score: -2

http://stackoverflow.com/comment/67383008
comment on: http://stackoverflow.com/q/28276972
type: Comment
type: QuestionComment
score: 3
has text: I specifically searched for these terms in order to make everyone out there who thinks this is a good idea *an appeal*: **Please, please, don't do this.** Seriously. For the love of God. Don't. do. this.

http://stackoverflow.com/a/28175475
type: Answer
has body: something like this? http://jsfiddle.net/upjy4s5b/ using jquery and formatting your html structure with classes allows you to find different things in relation to other things. calling the bootstrap modal via jquery call instead of the inline call allows for easy transfer of the information you want. $(document).ready(function() { $('.edit').on('click', function() { var name = $(this).closest('.item').find('.name').html(); var count = $(this).closest('.item').find('.count').html(); $('#myModal').find('.modal-body').find('.itemName').html(name); $('#myModal').find('.modal-body').find('.itemCount').html(count); $('#myModal').modal('show'); }); }); &lt;ul class="list"&gt; &lt;li class="item"&gt; &lt;span class="name"&gt;Item 1&lt;/span&gt; &lt;span class="count"&gt;Count 1&lt;/span&gt; &lt;a href="#" class="edit"&gt;Edit&lt;/a&gt; &lt;/li&gt; &lt;li class="item"&gt; &lt;span class="name"&gt;Item 2&lt;/span&gt; &lt;span class="count"&gt;Count 2&lt;/span&gt; &lt;a href="#" class="edit"&gt;Edit&lt;/a&gt; &lt;/li&gt; &lt;li class="item"&gt; &lt;span class="name"&gt;Item 3&lt;/span&gt; &lt;span class="count"&gt;Count 3&lt;/span&gt; &lt;a href="#" class="edit"&gt;Edit&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div class="modal fade" id="myModal"&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" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; Name: &lt;span class="itemName"&gt;&lt;/span&gt; Count: &lt;span class="itemCount"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-…
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28175209
answers question: http://stackoverflow.com/q/28175209

http://stackoverflow.com/q/28259010
tagged with: google-drive-api
has body: Hi I am developing an android app for a robotics competition. In the app we have buttons that add numbers to text boxes. I would like to get the number and save it to a locally stored Google sheet. Or to try to explain it the Google spreadsheet will be downloaded first then the app will put data in it on each separate device and when we are back on the internet it will upload to Google's servers I cannot find any way to do this and I am new and don't know how to save things yet so please explain carefully. So far the link hasn't been helpful. Can you even put data in a local table I could really use more specific examples I have figured out how to make the app save data then read it to a text box but now I want to put that data in google sheets and the api documentation has not been helpful
has answer: http://stackoverflow.com/a/28274474
tagged with: android
has title: How to save data to Local google sheets
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28274474
tagged with: java
downvote count: 1
type: Question
tagged with: google-sheets
upvote count: 0
tagged with: javascript
score: -1
linked to: http://stackoverflow.com/q/13838963
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28123613
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28123596
has comment: http://stackoverflow.com/comment/44620892
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28123596
has comment: http://stackoverflow.com/comment/44643398
score: 6
has comment: http://stackoverflow.com/comment/44620882
has comment: http://stackoverflow.com/comment/44643463
has comment: http://stackoverflow.com/comment/44643828
has body: You aren't "updating the prototype value". You are writing the new value to the local object and not to the prototype chain. The local property masks the one higher up the chain. alert(a.u); looks at a, finds a u and alerts it. alert(b.u); looks at b, doesn't find a u, looks up the prototype chain, finds a u and alerts it. Compare: var A = function() { } A.prototype.u = 2; var a = new A(); var b = new A(); a.u = 4; A.prototype.u = 6; alert(a.u); alert(b.u);
has comment: http://stackoverflow.com/comment/44643835

http://stackoverflow.com/comment/44909515
score: 0
type: Comment
has text: you set this button position to relative .. so i just make it fixed. ..
comment on: http://stackoverflow.com/a/28277547
type: AnswerComment

http://stackoverflow.com/comment/44677852
type: Comment
type: QuestionComment
has text: Have you made any attempt at this?
comment on: http://stackoverflow.com/q/28150493
score: 0

http://stackoverflow.com/comment/44850437
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28244042
has text: This is not an answer. This should be a comment.
score: 0

http://stackoverflow.com/a/28412655
type: AcceptedAnswer
has body: In the webapp generator, all bootstrap.js files get concatenated into the plugins.js file. If you look in your index.html file (in the app folder) you should see the block of code I've added here note the build:js scripts/plugins.js - that's what tells grunt to concatenate the files into the plugins.js file You can rename plugins.js to bootstrap.min.js in that line if you'd like
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28272899
accepted answer of: http://stackoverflow.com/q/28272899
upvote count: 1

http://stackoverflow.com/comment/44656417
type: Comment
comment on: http://stackoverflow.com/a/28142388
score: 1
has text: @TheIronDeveloper—that's an option, but it will return either *null* or a string, which are different Types.
type: AnswerComment

node.js
tags question: http://stackoverflow.com/q/28184948
tags question: http://stackoverflow.com/q/28278630
tags question: http://stackoverflow.com/q/28135409
tags question: http://stackoverflow.com/q/28237225
tags question: http://stackoverflow.com/q/28172552
tags question: http://stackoverflow.com/q/28213019
tags question: http://stackoverflow.com/q/28205874
tags question: http://stackoverflow.com/q/28243119
tags question: http://stackoverflow.com/q/28253658
tags question: http://stackoverflow.com/q/28172507
tags question: http://stackoverflow.com/q/28217462
tags question: http://stackoverflow.com/q/28179509
tags question: http://stackoverflow.com/q/28207007
tags question: http://stackoverflow.com/q/28266081
tags question: http://stackoverflow.com/q/28149573
tags question: http://stackoverflow.com/q/28237271
tags question: http://stackoverflow.com/q/28196415
tags question: http://stackoverflow.com/q/28174042
tags question: http://stackoverflow.com/q/28274741
tags question: http://stackoverflow.com/q/28183153
tags question: http://stackoverflow.com/q/28156543
tags question: http://stackoverflow.com/q/28273300
tags question: http://stackoverflow.com/q/28251319
tags question: http://stackoverflow.com/q/28121870
tags question: http://stackoverflow.com/q/28254533
tags question: http://stackoverflow.com/q/28227480
tags question: http://stackoverflow.com/q/28268803
tags question: http://stackoverflow.com/q/28196421
tags question: http://stackoverflow.com/q/28136650
tags question: http://stackoverflow.com/q/28263368
tags question: http://stackoverflow.com/q/28138386
tags question: http://stackoverflow.com/q/28267376
tags question: http://stackoverflow.com/q/28156886
tags question: http://stackoverflow.com/q/28147694
tags question: http://stackoverflow.com/q/28141543
tags question: http://stackoverflow.com/q/28256983
tags question: http://stackoverflow.com/q/28221469
tags question: http://stackoverflow.com/q/28201164
tags question: http://stackoverflow.com/q/28141168
tags question: http://stackoverflow.com/q/28179195
tags question: http://stackoverflow.com/q/28227380
tags question: http://stackoverflow.com/q/28158667
tags question: http://stackoverflow.com/q/28231970
tags question: http://stackoverflow.com/q/28205869
tags question: http://stackoverflow.com/q/28159580
tags question: http://stackoverflow.com/q/28143064
tags question: http://stackoverflow.com/q/28185715
tags question: http://stackoverflow.com/q/28275775
tags question: http://stackoverflow.com/q/28241032
tags question: http://stackoverflow.com/q/28243961
tags question: http://stackoverflow.com/q/28124608
tags question: http://stackoverflow.com/q/28182305
tags question: http://stackoverflow.com/q/28144049
tags question: http://stackoverflow.com/q/28160906
tags question: http://stackoverflow.com/q/28191243
tags question: http://stackoverflow.com/q/28247346
tags question: http://stackoverflow.com/q/28174167
tags question: http://stackoverflow.com/q/28251903
tags question: http://stackoverflow.com/q/28134271
tags question: http://stackoverflow.com/q/28139894
tags question: http://stackoverflow.com/q/28127585
tags question: http://stackoverflow.com/q/28260057
tags question: http://stackoverflow.com/q/28196503
tags question: http://stackoverflow.com/q/28197336
tags question: http://stackoverflow.com/q/28136710
tags question: http://stackoverflow.com/q/28224896
tags question: http://stackoverflow.com/q/28265548
tags question: http://stackoverflow.com/q/28240731
tags question: http://stackoverflow.com/q/28221165
tags question: http://stackoverflow.com/q/28220456
tags question: http://stackoverflow.com/q/28225458
tags question: http://stackoverflow.com/q/28168348
tags question: http://stackoverflow.com/q/28262291
tags question: http://stackoverflow.com/q/28123381
tags question: http://stackoverflow.com/q/28122342
tags question: http://stackoverflow.com/q/28219550
tags question: http://stackoverflow.com/q/28264255
tags question: http://stackoverflow.com/q/28124578
tags question: http://stackoverflow.com/q/28162968
tags question: http://stackoverflow.com/q/28229633

http://stackoverflow.com/q/28279046
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/45160481
tagged with: task
linked to: http://stackoverflow.com/q/20020981
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: gruntjs
has body: I'm searching for a grunt task where I can replace a string in a file with text from another file. e.g.: In the Gruntfile: -> src: strings.txt / index.html -> dist: index-replaced.html In the strings.txt: placeholder-1: lorem ipsum.... placeholder-2: lorem impsum blabla... In the Index.html: Here comes the placeholder text {{placeholder-1}} In the Index-replaced.html: Here comes the placeholder text lorem ipsum.... If seen all this tasks where you can specify your replacements in the gruntfile.js, but this doesn't match my needs. So anyone any idea? thx
tagged with: replace
has comment: http://stackoverflow.com/comment/45584506
downvote count: 0
score: 1
favorite count: 0
has title: Grunt Task for String Replacement

http://stackoverflow.com/q/28209607
tagged with: button
has answer: http://stackoverflow.com/a/28272981
has body: I'd like to use a custom printing button for my Highcharts graph. Now, I succeeded in adding it, however, I don't know how to make it display those default printing options (Export as PNG, SVG, JPG, PDF). And how to make disappear that default printing button. This is the code: exporting: { buttons: { 'myButton': { _id: 'myButton', symbol: 'url(http://geodev.grid.unep.ch/images/button_download.png)', onclick: function () { alert('click!') } } } } And here is a fiddle. Is there any simple approach for that in the "onClick" event it says: "Display all print options"? Thanks for any suggestions!
has title: How to use a custom download button with default printing options in Highcharts?
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/28272981
type: Question
tagged with: highcharts
answer count: 1
has comment: http://stackoverflow.com/comment/44789231
tagged with: javascript
has comment: http://stackoverflow.com/comment/44788177
tagged with: export

http://stackoverflow.com/comment/44903525
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28274294
has text: still does nothing when I go over the div with my mouse, console is empty and tooltip won't show

http://stackoverflow.com/comment/44831224
score: 0
comment on: http://stackoverflow.com/q/28232737
type: Comment
type: QuestionComment
has text: @chandings its not empty it contains lot of code line,I am adding it in the qn anyway, please check

http://stackoverflow.com/q/28271867
downvote count: 0
tagged with: url
favorite count: 0
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/28272003
has answer: http://stackoverflow.com/a/28271939
type: AnsweredQuestion
has body: Am wanting to pass three variables, one a constant the other two from a date picker, through the URL using Ajax. Am able to pass the constant through fine however the variables for the dates are just being passed as the variable name. Below is the code for the date pickers: Go The variables range1 and range2 contain the dates to be passed, the function to create the URL and pass the variables is below: function dateRangeFunction() { var range1 = document.getElementById('range1').value; var range2 = document.getElementById('range2').value; if(range1 == null || range1=="") { alert("Please Select A Date To Search From"); return; } $.ajax({ type: 'GET', url: 'daterangedetails.php?pt=7&rngstrt=" + range1 + "&rngfin=" + range2', success: function (data) { document.getElementById('rangeDetails').innerHTML = data; } }); } Doing an alert on the two variables shows the correct dates as selected, however when passed via the URL and using $_GET to echo the resultant variable on rngstrt and rngfin in the daterangedetails.php only gives the variable names as "range1 " & " range2. The pt value is passed correctly. The code used to echo the variables is: <?php session_start(); include 'dbconnect.php'; $dateFrom = $_GET['rngstrt']; $dateTo = $_GET['rngfin']; $rangeType = $_GET['pt1']; echo "Date From: ".$_GET['rngstrt']." "; echo "Date To: ".$dateTo." "; echo "Date: ".$criteriaDate." "; echo "Type: ".$rangeType; ?> Any help would be greatly appreciated, I was thinking maybe I have to put the variables into an array?? But am unsure how to do that if that's how I should go.
score: 1
possible better answer: http://stackoverflow.com/a/45266120
has answer: http://stackoverflow.com/a/45266120
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28272003
has title: Pass multiple variables via Ajax through variable to PHP not working
answer count: 3

http://stackoverflow.com/q/28264880
tagged with: javascript
has comment: http://stackoverflow.com/comment/44886507
score: 0
has comment: http://stackoverflow.com/comment/44886537
answer count: 1
has answer: http://stackoverflow.com/a/28264924
has comment: http://stackoverflow.com/comment/44886558
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44886528
tagged with: css
has body: I currently have a html page which needs to create a div which is the full width of the page. I am trying to organize divs within that position by percentage rather that px. .question is the class associated with the div which needs to be full page My css code looks as follows : .question { position: absolute; min-height: 100%; min-width: 100%; } #titlepage{ position: relative; top: 30%; width: 50%; text-align: center; overflow: auto; margin-left: auto; margin-right: auto; } html, body { background-color: #A0B8C8; height:100%; width:100%; } &lt;body ontouchmove="BlockMove(event);"&gt; &lt;div class="question"&gt; &lt;div id="titlepage"&gt; &lt;h1&gt; test data &lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; The aim is for the #titlepage div to be 30% of screen size from the top and centered. At the minute it is 30% from top, but the margin auto isn't setting it to be centered horizontally. Any help is appreciated, as well as an explanation why. Thank you *Edit html added. It doeesn't appear to work with mine. Is it possible that something is overriding it? **Edit. I appear to have fixed it by adding right:0; left:0; so it looks like this : .titlepage{ position: absolute; top: 30%; width: 50%; text-align: center; margin: 0 auto; right: 0; left: 0; } Can anyone explain why?
has comment: http://stackoverflow.com/comment/44886746
type: Question
has title: Positioning Div elements by percentage

http://stackoverflow.com/a/28162151
downvote count: 0
has comment: http://stackoverflow.com/comment/44696913
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28162140
accepted answer of: http://stackoverflow.com/q/28162140
score: 1
has body: I have done this few days back. It is as simple as the code below. :) On fiddle. Number.prototype.nth= function(){ var n= Math.round(this), t= Math.abs(n%100), i= t%10; if(i&lt;4 &amp;&amp; (t&lt;4 || t&gt; 20)){ switch(i){ case 1:return n+'st'; case 2:return n+'nd'; case 3:return n+'rd'; } } return n+'th'; } Date.prototype.nthofMonth= function(){ var today= this.getDate(),m=this.getMonth(), day= ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][this.getDay()], month= ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][m]; return [(m+1)+'-'+today,'the ', Math.ceil(today/7).nth(), day, 'of', month, 'in', this.getFullYear()].join(' '); } var date=new Date().nthofMonth(); console.log(date);
type: AcceptedAnswer

validation
tags question: http://stackoverflow.com/q/28151074
tags question: http://stackoverflow.com/q/28274898
tags question: http://stackoverflow.com/q/28161676
tags question: http://stackoverflow.com/q/28139163
tags question: http://stackoverflow.com/q/28142742
tags question: http://stackoverflow.com/q/28201075
tags question: http://stackoverflow.com/q/28172968
tags question: http://stackoverflow.com/q/28195481
tags question: http://stackoverflow.com/q/28184342
tags question: http://stackoverflow.com/q/28254004
type: Tag
tags question: http://stackoverflow.com/q/28197793
tag name: validation
tags question: http://stackoverflow.com/q/28207274
tags question: http://stackoverflow.com/q/28143317
tags question: http://stackoverflow.com/q/28227862
tags question: http://stackoverflow.com/q/28248747
tags question: http://stackoverflow.com/q/28187478
tags question: http://stackoverflow.com/q/28205828
tags question: http://stackoverflow.com/q/28219420
tags question: http://stackoverflow.com/q/28162263
tags question: http://stackoverflow.com/q/28168151
tags question: http://stackoverflow.com/q/28171937
tags question: http://stackoverflow.com/q/28147583
tags question: http://stackoverflow.com/q/28246836
tags question: http://stackoverflow.com/q/28240705
tags question: http://stackoverflow.com/q/28193664
tags question: http://stackoverflow.com/q/28227623
tags question: http://stackoverflow.com/q/28123438
tags question: http://stackoverflow.com/q/28172757
tags question: http://stackoverflow.com/q/28248532
tags question: http://stackoverflow.com/q/28163149
tags question: http://stackoverflow.com/q/28226191
tags question: http://stackoverflow.com/q/28178219
tags question: http://stackoverflow.com/q/28177197
tags question: http://stackoverflow.com/q/28122656
tags question: http://stackoverflow.com/q/28152830
tags question: http://stackoverflow.com/q/28129274
tags question: http://stackoverflow.com/q/28170538
tags question: http://stackoverflow.com/q/28186707
tags question: http://stackoverflow.com/q/28207288

http://stackoverflow.com/q/28209248
tagged with: extjs
score: 0
tagged with: sencha-architect
has body: I am trying to retain the position of the scrollbar in formpanel to show after form refresh . But i am unable to find any solution.Please help me by suggesting solution for this. Thanks &amp; Regards Sumanth K.P
has answer: http://stackoverflow.com/a/28277942
has title: EXT-JS 4.2.1 retain the current Position of scrollbar of form - panel
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/77089812
tagged with: scrollbar
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44783558
tagged with: javascript

http://stackoverflow.com/comment/44709217
has text: Hii. No I want to creat object to set Selected Value. I just Want to set using Value field.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28169904
type: AnswerComment

http://stackoverflow.com/comment/44689307
has text: It is considered best practice to not modify native objects' prototypes because it may create naming conflicts in the future if a new method or property with the same name is added
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28158538

http://stackoverflow.com/comment/44743144
comment on: http://stackoverflow.com/q/28185146
has text: you first add $this->autoRender = false; in your function
score: 0
type: Comment
type: QuestionComment

php
tags question: http://stackoverflow.com/q/28160803
tags question: http://stackoverflow.com/q/28238377
tags question: http://stackoverflow.com/q/28196827
tags question: http://stackoverflow.com/q/28122120
tags question: http://stackoverflow.com/q/28265899
tags question: http://stackoverflow.com/q/28158925
tags question: http://stackoverflow.com/q/28164636
tags question: http://stackoverflow.com/q/28271048
tags question: http://stackoverflow.com/q/28258483
tags question: http://stackoverflow.com/q/28160192
tags question: http://stackoverflow.com/q/28176036
tags question: http://stackoverflow.com/q/28177302
tags question: http://stackoverflow.com/q/28185892
tags question: http://stackoverflow.com/q/28135009
tags question: http://stackoverflow.com/q/28276101
tags question: http://stackoverflow.com/q/28186048
tags question: http://stackoverflow.com/q/28191287
tags question: http://stackoverflow.com/q/28151239
tags question: http://stackoverflow.com/q/28226141
tags question: http://stackoverflow.com/q/28160846
tags question: http://stackoverflow.com/q/28144354
tags question: http://stackoverflow.com/q/28146044
tags question: http://stackoverflow.com/q/28124712
tags question: http://stackoverflow.com/q/28249577
tags question: http://stackoverflow.com/q/28137668
tags question: http://stackoverflow.com/q/28236910
tags question: http://stackoverflow.com/q/28199689
tags question: http://stackoverflow.com/q/28152306
tags question: http://stackoverflow.com/q/28275954
tags question: http://stackoverflow.com/q/28124964
tags question: http://stackoverflow.com/q/28175982
tags question: http://stackoverflow.com/q/28240984
tags question: http://stackoverflow.com/q/28225732
tags question: http://stackoverflow.com/q/28141263
tags question: http://stackoverflow.com/q/28132303
tags question: http://stackoverflow.com/q/28205573
tags question: http://stackoverflow.com/q/28249688
tags question: http://stackoverflow.com/q/28201488
tags question: http://stackoverflow.com/q/28222332
tags question: http://stackoverflow.com/q/28122737
tags question: http://stackoverflow.com/q/28192384
tags question: http://stackoverflow.com/q/28137492
tags question: http://stackoverflow.com/q/28177117
tags question: http://stackoverflow.com/q/28224902
tags question: http://stackoverflow.com/q/28125226
tags question: http://stackoverflow.com/q/28214361
tags question: http://stackoverflow.com/q/28237611
tags question: http://stackoverflow.com/q/28167215
tags question: http://stackoverflow.com/q/28187478
tags question: http://stackoverflow.com/q/28209899
tags question: http://stackoverflow.com/q/28228963
tags question: http://stackoverflow.com/q/28186308
tags question: http://stackoverflow.com/q/28171058
tags question: http://stackoverflow.com/q/28199611
tags question: http://stackoverflow.com/q/28128083
tags question: http://stackoverflow.com/q/28138155
tags question: http://stackoverflow.com/q/28229193
tags question: http://stackoverflow.com/q/28208907
tags question: http://stackoverflow.com/q/28148962
tags question: http://stackoverflow.com/q/28129589
tags question: http://stackoverflow.com/q/28266963
tags question: http://stackoverflow.com/q/28235101
tags question: http://stackoverflow.com/q/28194242
tags question: http://stackoverflow.com/q/28133204
tags question: http://stackoverflow.com/q/28151696
tags question: http://stackoverflow.com/q/28229946
tags question: http://stackoverflow.com/q/28239843
tags question: http://stackoverflow.com/q/28275478
tags question: http://stackoverflow.com/q/28221206
tags question: http://stackoverflow.com/q/28176089
tags question: http://stackoverflow.com/q/28215510
tags question: http://stackoverflow.com/q/28164373
tags question: http://stackoverflow.com/q/28208321
tags question: http://stackoverflow.com/q/28185991
tags question: http://stackoverflow.com/q/28220805
tags question: http://stackoverflow.com/q/28277718
tags question: http://stackoverflow.com/q/28227274
tags question: http://stackoverflow.com/q/28136553
tags question: http://stackoverflow.com/q/28226168
tags question: http://stackoverflow.com/q/28145458

http://stackoverflow.com/comment/44765907
has text: *"What type of tree structure this data represents"* I don't think this object structure has a specific name. It's an object with nested objects and arrays.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28199765
type: Comment

http://stackoverflow.com/a/28122824
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28122603
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28122603
score: 1
has body: You can use classes instead of id's $('.bar').click(function () { $('.foo').hide(); // hide previous elements $(this).next().show('slow'); // show next element in the DOM (it will be &lt;div&gt; with class 'foo') }); Example
type: AcceptedAnswer

http://stackoverflow.com/q/28167484
downvote count: 2
has title: Javascript function overloading, pls explain John Resig (Jquery way) article
has comment: http://stackoverflow.com/comment/44705057
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44705203
has answer: http://stackoverflow.com/a/28167792
accepted answer: http://stackoverflow.com/a/28167792
answer count: 1
tagged with: javascript
favorite count: 0
has body: I understand implementing JavaScript overloading based on arguments object, or by explicit checking type of and length of arguments.please explain this article: http://ejohn.org/blog/javascript-method-overloading/.
score: 0
has comment: http://stackoverflow.com/comment/44705003
upvote count: 2

http://stackoverflow.com/comment/44879661
type: Comment
has text: Thanks for the help. I am using CoffeeScript and I just realized I think CoffeeScript is re-declaring `objects` as a local var in my button click handler. I think that's the whole problem. Thanks again.
type: AnswerComment
comment on: http://stackoverflow.com/a/28261130
score: 0

http://stackoverflow.com/a/28184555
has comment: http://stackoverflow.com/comment/44741155
score: 1
answers question: http://stackoverflow.com/q/28183652
upvote count: 1
has comment: http://stackoverflow.com/comment/44741188
has comment: http://stackoverflow.com/comment/44740449
has body: Hi alex the code actually works, just remove +this.content' +to +'click to start editing on the div' +`, since you are creating the object without content. We replace this.content with this. var finde = Documents.findOne({_id:this._id}) return '&lt;div class="content" contenteditable="true"&gt;' +finde.content + '&lt;/div&gt;' And put the Template where this helper is used inside a waitOn on the Route. waitOn:function(){ if(this.ready()){ //render the template }else{ //render the loading template } } if you console.log(this). You will get object {}.
has comment: http://stackoverflow.com/comment/44741061
has comment: http://stackoverflow.com/comment/44740324
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44740550
accepted answer of: http://stackoverflow.com/q/28183652
has comment: http://stackoverflow.com/comment/44781705
type: Answer
has comment: http://stackoverflow.com/comment/44738264
has comment: http://stackoverflow.com/comment/44738270

http://stackoverflow.com/a/28260988
has body: You forgot the quotation marks around the if attribute value. Try Without the quotes, the browser (Chrome) parses this line as
type: AcceptedAnswer
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28260839
upvote count: 1
has comment: http://stackoverflow.com/comment/44886990
answers question: http://stackoverflow.com/q/28260839
downvote count: 0

http://stackoverflow.com/q/28172726
tagged with: testing
type: Question
tagged with: tdd
has answer: http://stackoverflow.com/a/28175828
accepted answer: http://stackoverflow.com/a/28175828
has title: When running jasmine tests, how can I know if I am in a describe block, beforeEach block or it block?
tagged with: spy
answer count: 1
has comment: http://stackoverflow.com/comment/44715102
downvote count: 0
tagged with: javascript
score: 4
tagged with: jasmine
has comment: http://stackoverflow.com/comment/44715973
upvote count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/44714548
type: AnsweredQuestion
has body: I need to throw an exception if a utility is used outside of an 'it' or 'beforeEach' block in my tests. Example - describe('some test', function(){ useUtil(); // should throw exception beforeEach(function(){ useUtil() // should work }) it('should test something', function(){ useUtil() // should work }) }) The util creates spies, and I want to make sure they are created in a way that allows Jasmine to clean them after every suite.

http://stackoverflow.com/q/28234886
favorite count: 0
has title: setting time interval on google timeline chart
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44831827
score: 2
answer count: 0
downvote count: 0
has body: I have a google timeline chart with a lot of info per line and I need to set the chart to display in hourly intervals. Does anyone know how to set that option for the timeline chart I have looked here timeline options on google api page but cannot see where to set the interval to lets say hourly Thanks All
type: Question
tagged with: charts
tagged with: javascript
has comment: http://stackoverflow.com/comment/44831595
upvote count: 2
has comment: http://stackoverflow.com/comment/95503092
has comment: http://stackoverflow.com/comment/44831554

graphics
tag name: graphics
tags question: http://stackoverflow.com/q/28276226
type: Tag
tags question: http://stackoverflow.com/q/28246742
tags question: http://stackoverflow.com/q/28126661

http://stackoverflow.com/q/28225690
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has body: I am working with the signature_pad lib to accept signature for my web app. I am having an issue after loading a saved signature. Assuming I am working with a blank signaturePad, I create some signature and save it. After refreshing the page, this is what shows up. Notice it moves to the right and also seems like its zoomed in slightly. Any idea why this may be happening? Here is some code I am working with: &lt;canvas class="signature-canvas" height="150" width="500" id="signatureCanvas"&gt;&lt;/canvas&gt; var canvas = document.querySelector("canvas#signatureCanvas"); scope.signaturePad = new SignaturePad(canvas); scope.c2 = document.createElement('canvas'); scope.ctx = scope.c2.getContext('2d'); scope.img = new Image(); scope.img.crossOrigin = "Anonymous"; scope.img.onload = function() { scope.drawSig(); } scope.img.src = scope.signature; scope.drawSig = function(){ scope.ctx.drawImage(scope.img, 0, 0); scope.imgStr = scope.c2.toDataURL("image/png", ""); scope.signaturePad.fromDataURL( scope.imgStr ); };
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has title: Canvas image moves slightly to right onload
score: 2
answer count: 0
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44815081
tagged with: canvas
has comment: http://stackoverflow.com/comment/44815043
tagged with: javascript

http://stackoverflow.com/a/28256257
downvote count: 0
upvote count: 17
type: Answer
has comment: http://stackoverflow.com/comment/44870927
has body: You can use the onpopstate event. window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + JSON.stringify(event.state)); }; For more info, see the MDN page about the onpopstate event.
score: 17
accepted answer of: http://stackoverflow.com/q/28256198
answers question: http://stackoverflow.com/q/28256198
type: AcceptedAnswer

http://stackoverflow.com/a/28188657
type: Answer
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28188555
has body: It's better to apply some attribute (like class) to indicate state of button. Also, when you click on link, browser will follow it, prevent that (if needed effect). And your function is fired only once when everything is loaded, but not when clicking element. Bind click event to element: $(document).ready(function() { $(".btn").click(function(e) { e.preventDefault(); // prevent from following link. if ($(this).hasClass('active')) { $(this) .removeClass('active') .text('Show Details'); } else { $(this) .addClass('active') .text('Hide Details'); } }); }); .btn { text-decoration: none; border: 1px solid green; padding: 5px 10px; font-weight: bold; color: #454545; } Show Details

http://stackoverflow.com/a/28169615
answers question: http://stackoverflow.com/q/28169249
has body: Using the close() function alone might work. In your case try this: window.open('','_parent',''); closeWindow(); function closeWindow() { close(); } You can also use it this way: window.open('','_parent','').Function(closeWindow()); //close after the new window has been opened function closeWindow() { close(); }
type: Answer
score: 0

http://stackoverflow.com/q/28166097
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28166130
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/44703512
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44702559
has comment: http://stackoverflow.com/comment/44702598
upvote count: 1
has title: Check that click event already exist on JQuery 1.11.1
linked to: http://stackoverflow.com/q/1515069
favorite count: 0
has comment: http://stackoverflow.com/comment/44702501
has body: I´m looking for all internet and I cannot find a situation like mine. I have a jsp(lets call it A.jsp) with an import javascript, which has a onDocumemntReady. In that documentReady I bound an click event for a class element of my A.jsp. Now The issue is that I have another page with a loop where I iterate and include n A.jsp. So now what´s happening is that I add this n pages on the DOM and after finish the onDocumentReady is call it for everyone. So what I want to do is just create the "click" events once. Looking on google I cannot find a way to check if the event already exist for JQuery 1.11.1. Any idea. Regards.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44702575
has comment: http://stackoverflow.com/comment/44703038

http://stackoverflow.com/comment/44821920
has text: No. This I use jquery only.
type: QuestionComment
comment on: http://stackoverflow.com/q/28229512
score: 0
type: Comment

http://stackoverflow.com/comment/44706514
comment on: http://stackoverflow.com/a/28166689
has text: @RangerChris I added a code snippet to my answer which hopefully will help clarify my suggested solution.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28273095
upvote count: 2
type: AcceptedAnswer
has body: Just set style="display: none;" on &lt;dd&gt; for initial value. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. http://api.jquery.com/slidetoggle/
answers question: http://stackoverflow.com/q/28272997
type: Answer
accepted answer of: http://stackoverflow.com/q/28272997
score: 2
downvote count: 0

http://stackoverflow.com/comment/44897380
type: QuestionComment
comment on: http://stackoverflow.com/q/28270854
has text: Not really , I mean if lots of things (features and code) is well built and tested in jQuery , why reinvent the wheel ?
score: 0
type: Comment

http://stackoverflow.com/a/28151122
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44673729
has comment: http://stackoverflow.com/comment/44707929
has body: To make your divs fade at the same time you will need to add a bit of styling (to make the quotes sit on top of each other) and run the fades simultaneously. Then you will need to clear the timeout on hover to pause the animation: jQuery(function () { var $els = $('div.quote'), i = 0, len = $els.length; $els.slice(1).hide(); var fadeInterval = setFadeInterval(); // starts the fader $els.hover(function () { clearInterval(fadeInterval); // stops the fader on mouseover }, function () { fadeInterval = setFadeInterval(); // restarts the fader on mouseout }); function setFadeInterval() { return setInterval(function () { $els.eq(i).fadeOut(); // run the faders at the same time i = (i + 1) % len $els.eq(i).fadeIn(); }, 2500); } }); /* make the faders sit on top of each other */ #quote-holder { position:relative; } #quote-holder > .quote { position:absolute; top:0; left:0; } I am a quote Author Name I am another quote I am yet another quote
has comment: http://stackoverflow.com/comment/44676709
has comment: http://stackoverflow.com/comment/44676184
has comment: http://stackoverflow.com/comment/44690314
type: Answer
has comment: http://stackoverflow.com/comment/44676825
has comment: http://stackoverflow.com/comment/44675956
has comment: http://stackoverflow.com/comment/44706466
accepted answer of: http://stackoverflow.com/q/28150771
answers question: http://stackoverflow.com/q/28150771
has comment: http://stackoverflow.com/comment/44706985
has comment: http://stackoverflow.com/comment/44673788
has comment: http://stackoverflow.com/comment/44707460
has comment: http://stackoverflow.com/comment/44675133
has comment: http://stackoverflow.com/comment/44675344
has comment: http://stackoverflow.com/comment/44707394
score: 0

http://stackoverflow.com/comment/44640793
comment on: http://stackoverflow.com/q/28134244
score: 0
type: Comment
type: QuestionComment
has text: @SearchAndResQ i dont know how to remove it. im retrieving it from PHP server side. ill add that code as well

http://stackoverflow.com/a/28220892
answers question: http://stackoverflow.com/q/28217794
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28217794
has body: I know this doesn't strictly answer your question about document.write but it should solve your problem. ga.js is designed to be used asynchronously. You should be able to do something like this: var _gaq = _gaq || []; _gaq.push(function(){ // Use _gat here freely }); The function pushed into _gaq will be processed once ga.js is loaded. Also it seems like you are using a fairly old version of this code. The newer version doesn't use document.write. (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); If you decide to update your analytics tracking code, I'd recommend you jumping straight to Universal Analytics, that uses a different file called analytics.js instead.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44782404
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28208769
type: Comment

http://stackoverflow.com/q/28165156
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44700793
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: How to define for the textBox, that there are no spaces allowed (only letters, numbers, or signs other than space/tab/enter) using javascript
has comment: http://stackoverflow.com/comment/44700774
has body: I mean the user has to enter his name into textBox, but he only has to enter his name (for example). Just one word together. No spaces at all. If user enters for example : "John", thats ok, if user enters: "John A" it should be incorrect input. How to define that?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28165296
downvote count: 1
type: Question
score: -1

http://stackoverflow.com/comment/67602176
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28241940
has text: Still an issue in Safari 9.1.2. Getting the feeling they aren't going to fix this.
score: 1

http://stackoverflow.com/q/28242608
has comment: http://stackoverflow.com/comment/44845986
has comment: http://stackoverflow.com/comment/44846202
has comment: http://stackoverflow.com/comment/44845918
has comment: http://stackoverflow.com/comment/44846768
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44845987
favorite count: 0
has title: How to "Leave a trace when moving over a map in a website"?
answer count: 0
tagged with: frontend
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44846106
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/44846117
score: 0
has comment: http://stackoverflow.com/comment/44847136
downvote count: 1
type: Question
has body: look at this gif first. before reading http://cl.ly/image/0v0F3n0d1w0k my website has a map background and is divided in sections. when you scroll you go to the next section and the map behind changes depending on the type of section ( for example america section will show america. I already achieved that by using background-position and changing the X and Y coordinates of background ) now i want to achieve this effect : i added a pin and it stays at the center of the screen. so when you change section it is always in the center ( it doesn't move ) but i want to draw a line from the starting center X Y to the destination X Y ( that will be the next center ) like in the video in the link above any idea about which technology i could use ? ( i would search for some tutorial and learn it ) maybe using SVG? idea 1 ) SVG http://tutorials.jenkov.com/svg/path-element.html Path commands L x,y lineto Draws a line from current pen location to specified point x,y
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44885619
score: 0
type: AnswerComment
type: Comment
has text: i wish you the best luck in the world. the code above worked perfectly. thank you so much .
comment on: http://stackoverflow.com/a/28264346

http://stackoverflow.com/comment/64037764
has text: @Rhayene: Yes, [Bluebird](http://bluebirdjs.com/docs/api/spread.html), but also [Q](https://github.com/kriskowal/q/wiki/API-Reference#promisespreadonfulfilled-onrejected), [when](https://github.com/cujojs/when/blob/master/docs/api.md#promisespread) and other major promise libs implement it. It's becoming less important with destructuring in ES6.
comment on: http://stackoverflow.com/a/28250704
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44819331
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28226997
has text: hm, changed the videos from mp4 to webm and it got rid of the error (?!)
score: 0

http://stackoverflow.com/q/28150182
tagged with: ajax
score: 0
has title: replace hyperlink default action to load ajax request
has answer: http://stackoverflow.com/a/28150460
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28165445
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44671750
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28165445
has body: I've been playing around with bootstrap on my local machine trying to make a site, so far so good. Although I'm running into a strange issue and I'm not sure if it is related to bootstrap or something else. On my site I have a navbar and multiple btn links here is an example of a menu link Home her is an exampe of a btn-link Read More besides the header and what not my body has one empty div the goal of this is to have one page that loads the content based on the get variable, which passes it to a get function to load the page it looks like this <?php $page_to_load = 'home'; if(isset($_GET['Page'])){ if(strlen($_GET['Page'])>0){ $page_to_load = $_GET['Page']; } } ?> then my javascript looks like this $.get('/pages/<?php echo $page_to_load; ?>.php', function(response){ $('.my-body').html(response); }); so far all the above code is working as intended but then I thought to myself wouldn't it be nice if when you click a link the entire page didn't reload and it just got the new content... this is where the headache has been for me, I'm basically using the following javascript the thing that is bugging me is that sometimes it seems to work for the navbar links and not the button links. I'm sure I'm missing something or maybe the way I have it just won't work. var _baseLink = 'http://localhost/' $(document).ready(function(){ $('a').click(function(){ try{ var _href = $(this).attr('href'); if(_href.indexOf('#')==-1){ var _url = document.URL; _url = _url.split('?')[0]; if(_url.indexOf('default.php')<0){ _url = _baseLink + 'default.php'; } var _title = document.title; var Url = _url + _href; //it only sometimes logs this message console.log('\r\ntitle:' + _title + '\r\nhref:' + _href + '\r\n_url:' + _url + '\r\nUrl:' + Url); //change url window.history.pushState({"urlPath": Url}, _title, Url); //change page content //this could be a bad ajax request but never get it this far. $.get(_baseLink + 'pages/' + _href.replace("?Page=", "") + '.php', function(data){ $('.my-body').htm…
accepted answer: http://stackoverflow.com/a/28150460
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44692133
type: QuestionComment
score: 1
has text: Works fine http://jsfiddle.net/bfvzbcmL/
type: Comment
comment on: http://stackoverflow.com/q/28160393

http://stackoverflow.com/comment/44731760
comment on: http://stackoverflow.com/a/28181231
type: AnswerComment
score: 0
type: Comment
has text: When changing - data: $(".confirm_appointment").serialize(), to data: $(this).closest(".confirm_appointment").serialize(), - The data is empty

http://stackoverflow.com/comment/44702501
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28166097
has text: Why not just remove the documentReady from A.jsp and include it outside of the loop?

http://stackoverflow.com/comment/44877890
comment on: http://stackoverflow.com/q/28260104
type: Comment
score: 0
has text: try this --> http://jsfiddle.net/incrediblex/n0yfd22v/1/
type: QuestionComment

http://stackoverflow.com/q/28269869
has title: In Javascript, global variable is not changing value inside a function
linked to: http://stackoverflow.com/q/5178068
possible better answer: http://stackoverflow.com/a/28269893
linked to: http://stackoverflow.com/q/15057649
score: 0
accepted answer: http://stackoverflow.com/a/28269911
has body: var a = 1; function b() { function a() {}; // local scope a = 10; // global scope } b(); alert(a); It alerts 1 and not 10. I am wondering why is it so?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28270049
type: Question
has comment: http://stackoverflow.com/comment/44895752
tagged with: javascript
has answer: http://stackoverflow.com/a/28269911
has answer: http://stackoverflow.com/a/28269893
answer count: 3

http://stackoverflow.com/comment/44815007
has text: It never *required*, but it used to recommend.
comment on: http://stackoverflow.com/a/28225809
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28205036
has answer: http://stackoverflow.com/a/28205917
favorite count: 0
has answer: http://stackoverflow.com/a/28534382
type: Question
possible better answer: http://stackoverflow.com/a/28205917
has title: Shoutcast URL does not stream on JPlayer, but does on another flash player?
tagged with: shoutcast
answer count: 2
tagged with: jplayer
upvote count: 1
accepted answer: http://stackoverflow.com/a/28534382
has body: I'm trying to stream http://gwradio.serverroom.us:4142/;stream.mp3 using JPlayer, but nothing happens when I try to play the stream. Here's a test of the JPlayer code that has been confirmed to play other streams var stream = { title: "WRGW TEST", mp3: "http://gwradio.serverroom.us:4142/;stream.mp3" }, ready = false; $("#jquery_jplayer_1").jPlayer({ ready: function (event) { ready = true; $(this).jPlayer("setMedia", stream); }, pause: function() { $(this).jPlayer("clearMedia"); }, error: function(event) { if(ready &amp;&amp; event.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET) { // Setup the media stream again and play it. $(this).jPlayer("setMedia", stream).jPlayer("play"); } }, swfPath: "../dist/jplayer", supplied: "mp3", preload: "none", wmode: "window", useStateClassSkin: true, autoBlur: false, keyEnabled: true }); $("#jplayer_inspector").jPlayerInspector({jPlayer:$("#jquery_jplayer_1")}); Here is the same URL working with another flash player: http://www.ep.gwradio.com/ Where's the beef? Can anyone help me out with this?
tagged with: audio-streaming
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: internet-radio

http://stackoverflow.com/q/28153532
upvote count: 6
favorite count: 0
has body: i have Leaflet map with coordinates finder, the coordinates commend contains Heading point. im trying to rotate my icon marker to the Heading point. the code: (live at: http://84.95.7.35/~hzcoil/index2.html) i found this: https://github.com/bbecquet/Leaflet.PolylineDecorator/blob/master/src/L.RotatedMarker.js i was working on it about 5 hours but i could not match it to my code. this it the coordinates commend: x=2196.170 y=39.880 z=1895.350, Heading: 0.624 The "Heading" should be the rotate. How can i match it to my code?
has answer: http://stackoverflow.com/a/28154119
has comment: http://stackoverflow.com/comment/44679450
type: AnsweredQuestion
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/28154119
type: Question
tagged with: rotation
tagged with: google-maps
downvote count: 0
tagged with: javascript
score: 6
has title: Rotate Marker with leaflet
answer count: 1
tagged with: css

http://stackoverflow.com/q/28200940
score: 0
tagged with: kendo-grid
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
accepted answer: http://stackoverflow.com/a/28213050
type: AnsweredQuestion
has body: I was just researching Kendo UI. I can see that you can embed charts in the grid, but I am unsure that there is any representation for a 2-way linear gauge in Kendo UI. Something along the lines of: Is there a way to do this?
has title: How to embed a linear gauge in a Kendo grid row
type: Question
has answer: http://stackoverflow.com/a/28213050
has comment: http://stackoverflow.com/comment/44791644

http://stackoverflow.com/q/28201126
type: Question
has comment: http://stackoverflow.com/comment/44773047
tagged with: javascript
score: 0
tagged with: 3d
has title: Move object in circular motion
has comment: http://stackoverflow.com/comment/44771202
has comment: http://stackoverflow.com/comment/44768974
type: UnansweredQuestion
tagged with: three.js
has comment: http://stackoverflow.com/comment/44772180
has comment: http://stackoverflow.com/comment/44771118
answer count: 0
has body: I often use the following code to move an object in a circular motion. vector.x = vector.x * Math.cos(.25) - vector.z * Math.sin(.25); vector.z = vector.z * Math.cos(.25) + vector.x * Math.sin(.25); This moves the object perpendicular to the bottom of my scene. How can I get my object to move in a circular motion through the y plane. I'm not sure how to correctly phrase that.

http://stackoverflow.com/q/28209469
has answer: http://stackoverflow.com/a/28209527
has answer: http://stackoverflow.com/a/28210217
type: Question
has comment: http://stackoverflow.com/comment/44783612
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28209999
type: UnansweredQuestion
has body: I have an excel sheet, a JS application and a db. excel sheet has data. I need to open the file and read data from the JS application and insert it into the db(say oracle db). How to? I think we cannot open and close file in JS, pls correct me if i am wrong since it poses a security issue. If that is the case, say if we have updated the data in the grid, or table in the JS application. and we want to insert all the data in to the db, how do we do it?
has comment: http://stackoverflow.com/comment/44783622
has title: Javascript - how to directly interact with db?

http://stackoverflow.com/q/28279346
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28279387
tagged with: jquery
score: 0
tagged with: plugins
has answer: http://stackoverflow.com/a/28279387
has comment: http://stackoverflow.com/comment/44912795
has comment: http://stackoverflow.com/comment/44912691
type: AnsweredQuestion
tagged with: timeout
has body: I have some behavior attached to a keyup event in my jQuery plugin. Everything works fine except the function supposed to trigger AFTER the timeout is executed immediately. //attach keyup event for the searchbox self.data('gallery_searchTimeout',null); //to enable a delay on the keypress search event $(self).find('.gallery-search').keyup(function(){ var needle = 'look for me'; var delay = 2000; //if a timer is already set, clear it in favor of our new timer if (self.data('gallery_searchTimeout') != undefined) clearTimeout(self.data('gallery_searchTimeout')); self.data('gallery_searchTimeout', setTimeout((self.data('search')(self,needle)), delay) ); }); var search = function(self,needle) { console.log('search called with needle: '+needle); }; self.data('search',search);
type: Question
has title: setTimeout not working inside jQuery plugin
has comment: http://stackoverflow.com/comment/44912917

json-rpc
tag name: json-rpc
type: Tag
tags question: http://stackoverflow.com/q/28258201

http://stackoverflow.com/q/28224472
downvote count: 0
has title: Closures gone awry - why does anonymous function return last
accepted answer: http://stackoverflow.com/a/28224835
favorite count: 0
answer count: 5
possible better answer: http://stackoverflow.com/a/28224734
has comment: http://stackoverflow.com/comment/44812430
has answer: http://stackoverflow.com/a/28224734
type: AnsweredQuestion
has body: I was reading this article (#3) on JS Closures, and was trying to understand this point about closures going awry when the outer function's variable changes with a for loop... function celebIDCreator (theCelebs) { var i; var uniqueID = 100; for (i = 0; i &lt; theCelebs.length; i++) { console.log("outer: " + i); //this anon function returns after the loop has finished theCelebs[i]["id"] = function () { console.log("inner: " + i); return uniqueID + i; //this is accessing the i declared in outer function, not in For loop... } } console.log("outside for loop: " + i); return theCelebs; } var celebs = [{name : "Stallone", id: 0}, {name : "Cruise", id : 0}, {name : "Willis", id : 0}]; var create = celebIDCreator (celebs); var stalloneID = create[0]; Gives output: outer: 0 outer: 1 outer: 2 outside for loop: 3 inner: 3 I am confused as to why the inner anonymous function's output is console.logged last in line, and what this portion of the article is referring to? Where exactly is the outer variable being changed causing the issue?
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28224750
has answer: http://stackoverflow.com/a/28224835
type: Question
tagged with: closures
tagged with: javascript
has answer: http://stackoverflow.com/a/39829877
has answer: http://stackoverflow.com/a/45754612

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

rgraph
type: Tag
tag name: rgraph
tags question: http://stackoverflow.com/q/28197557

ajax
tags question: http://stackoverflow.com/q/28261771
tags question: http://stackoverflow.com/q/28268449
tags question: http://stackoverflow.com/q/28155771
tags question: http://stackoverflow.com/q/28245928
tags question: http://stackoverflow.com/q/28190980
tags question: http://stackoverflow.com/q/28123916
tags question: http://stackoverflow.com/q/28265620
tags question: http://stackoverflow.com/q/28256195
tags question: http://stackoverflow.com/q/28195689
tags question: http://stackoverflow.com/q/28135408
tags question: http://stackoverflow.com/q/28160039
tags question: http://stackoverflow.com/q/28271986
tags question: http://stackoverflow.com/q/28243732
tags question: http://stackoverflow.com/q/28208853
tags question: http://stackoverflow.com/q/28258525
tags question: http://stackoverflow.com/q/28133798
tags question: http://stackoverflow.com/q/28262563
tags question: http://stackoverflow.com/q/28207103
tags question: http://stackoverflow.com/q/28135375
tags question: http://stackoverflow.com/q/28207106
tags question: http://stackoverflow.com/q/28200699
tags question: http://stackoverflow.com/q/28270008
tags question: http://stackoverflow.com/q/28157717
tags question: http://stackoverflow.com/q/28149109
tags question: http://stackoverflow.com/q/28170247
tags question: http://stackoverflow.com/q/28244594
tags question: http://stackoverflow.com/q/28275195
tags question: http://stackoverflow.com/q/28252347
tags question: http://stackoverflow.com/q/28232794
tags question: http://stackoverflow.com/q/28263946
tags question: http://stackoverflow.com/q/28130929
tags question: http://stackoverflow.com/q/28154796
tags question: http://stackoverflow.com/q/28156382
tags question: http://stackoverflow.com/q/28195474
tags question: http://stackoverflow.com/q/28255685
tags question: http://stackoverflow.com/q/28260546
tags question: http://stackoverflow.com/q/28210730
tags question: http://stackoverflow.com/q/28279488
tags question: http://stackoverflow.com/q/28158692
tags question: http://stackoverflow.com/q/28125768
tags question: http://stackoverflow.com/q/28208388
tags question: http://stackoverflow.com/q/28173444
tags question: http://stackoverflow.com/q/28262008
tags question: http://stackoverflow.com/q/28229504
tags question: http://stackoverflow.com/q/28124651
tags question: http://stackoverflow.com/q/28234626
tags question: http://stackoverflow.com/q/28148818
tags question: http://stackoverflow.com/q/28195447
tags question: http://stackoverflow.com/q/28217194
tags question: http://stackoverflow.com/q/28151207
tags question: http://stackoverflow.com/q/28228886
tags question: http://stackoverflow.com/q/28193902
tags question: http://stackoverflow.com/q/28206264
tags question: http://stackoverflow.com/q/28125432
tags question: http://stackoverflow.com/q/28162139
tags question: http://stackoverflow.com/q/28225990
type: Tag
tags question: http://stackoverflow.com/q/28187198
tags question: http://stackoverflow.com/q/28217928
tags question: http://stackoverflow.com/q/28158925
tags question: http://stackoverflow.com/q/28258483
tags question: http://stackoverflow.com/q/28160192
tags question: http://stackoverflow.com/q/28259586
tags question: http://stackoverflow.com/q/28225252
tags question: http://stackoverflow.com/q/28241863
tags question: http://stackoverflow.com/q/28155805
tags question: http://stackoverflow.com/q/28270364
tags question: http://stackoverflow.com/q/28185892
tags question: http://stackoverflow.com/q/28186664
tags question: http://stackoverflow.com/q/28173267
tags question: http://stackoverflow.com/q/28166048
tags question: http://stackoverflow.com/q/28170284
tags question: http://stackoverflow.com/q/28125929
tags question: http://stackoverflow.com/q/28135292
tags question: http://stackoverflow.com/q/28138796
tags question: http://stackoverflow.com/q/28263248
tags question: http://stackoverflow.com/q/28131894
tags question: http://stackoverflow.com/q/28166961
tags question: http://stackoverflow.com/q/28272892
tags question: http://stackoverflow.com/q/28173238

http://stackoverflow.com/comment/44658598
comment on: http://stackoverflow.com/q/28143353
score: 0
type: Comment
has text: Consider using a router instead of hardcoding history jumps. http://backbonetutorials.com/what-is-a-router/ or https://github.com/tildeio/router.js/
type: QuestionComment

object
tags question: http://stackoverflow.com/q/28254748
tags question: http://stackoverflow.com/q/28214297
tags question: http://stackoverflow.com/q/28148588
tags question: http://stackoverflow.com/q/28127908
tags question: http://stackoverflow.com/q/28224794
tags question: http://stackoverflow.com/q/28170707
tag name: object
tags question: http://stackoverflow.com/q/28264386
tags question: http://stackoverflow.com/q/28126603
tags question: http://stackoverflow.com/q/28229475
tags question: http://stackoverflow.com/q/28179509
tags question: http://stackoverflow.com/q/28278486
tags question: http://stackoverflow.com/q/28187213
tags question: http://stackoverflow.com/q/28181384
tags question: http://stackoverflow.com/q/28226570
tags question: http://stackoverflow.com/q/28225642
tags question: http://stackoverflow.com/q/28154990
tags question: http://stackoverflow.com/q/28166166
tags question: http://stackoverflow.com/q/28239157
tags question: http://stackoverflow.com/q/28226879
tags question: http://stackoverflow.com/q/28133110
tags question: http://stackoverflow.com/q/28182724
tags question: http://stackoverflow.com/q/28201751
tags question: http://stackoverflow.com/q/28196979
tags question: http://stackoverflow.com/q/28242628
tags question: http://stackoverflow.com/q/28224624
tags question: http://stackoverflow.com/q/28255372
tags question: http://stackoverflow.com/q/28138095
tags question: http://stackoverflow.com/q/28136931
tags question: http://stackoverflow.com/q/28278269
tags question: http://stackoverflow.com/q/28182367
tags question: http://stackoverflow.com/q/28218425
tags question: http://stackoverflow.com/q/28267254
tags question: http://stackoverflow.com/q/28228446
tags question: http://stackoverflow.com/q/28234901
tags question: http://stackoverflow.com/q/28245441
tags question: http://stackoverflow.com/q/28222396
tags question: http://stackoverflow.com/q/28240715
tags question: http://stackoverflow.com/q/28197039
tags question: http://stackoverflow.com/q/28179871
tags question: http://stackoverflow.com/q/28210667
type: Tag
tags question: http://stackoverflow.com/q/28257543
tags question: http://stackoverflow.com/q/28212681
tags question: http://stackoverflow.com/q/28268203
tags question: http://stackoverflow.com/q/28254023

http://stackoverflow.com/q/28185480
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44742352
downvote count: 1
type: Question
has body: I am doing a web application with canvas where users draw images and upload files into canvas. I am able to upload only images into canvas but I need the .docx or .txt files also to be uploaded. Here is the code for uploading images Code in .aspx page &lt;div style="text-align:center;"&gt; &lt;p&gt; &lt;input id="fileUploadImg" type="file" /&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="button" id="btnOKOpen" value="OK" onclick="UpdateCanvas(); return false;" /&gt; &lt;input type="button" id="btnCancelOpen" value="Cancel" /&gt; &lt;/p&gt; &lt;/div&gt; On clicking button the below function updatecanvas() is called. Code in .js file function UpdateCanvas() { var file_UploadImg = document.getElementById("fileUploadImg"); var fileExtension = ""; Have limited the type of files the user can upload.Though I have specified .docx or .txt in "else if" the condition isn't validated.I am able to upload .png , .jpg alone but not any other extensions if (fileExtension == "jpg") { return true; } else if(fileExtension == "txt") { return true; } else if (fileExtension == "doc") { return true; } else if (fileExtension == "docx") { return true; } else if (fileExtension == "ppt") { return true; } else if (fileExtension == "pptx") { return true; } else if (fileExtension == "xml") { return true; } else if (fileExtension == "png") { return true; } else { alert("You must select a GIF file for upload"); return false; } LoadImageIntoCanvas(URL.createObjectURL(file_UploadImg.files[0])); } function LoadImageIntoCanvas(bgImageUrl) { var image_View = document.getElementById("imageView"); var ctx = image_View.getContext("2d"); var img = new Image(); img.onload = function () { image_View.width = img.width; image_View.height = img.height; WIDTH = img.width; HEIGHT = img.height; ctx.clearRect(0, 0, image_View.width, image_View.height); ctx.drawImage(img, 1, 1, img.width, img.height); } img.src = bgImageUrl; } Is there any other way to upload files of such type?I am new to canvas.If there is any,Please he…
has comment: http://stackoverflow.com/comment/44741943
score: -1
has comment: http://stackoverflow.com/comment/44746621
has comment: http://stackoverflow.com/comment/44742505
tagged with: canvas
has comment: http://stackoverflow.com/comment/44778606
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44742433
favorite count: 0
has title: How to upload a .txt or .docx file in canvas using javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44783642
tagged with: file-upload

http://stackoverflow.com/a/28151164
has comment: http://stackoverflow.com/comment/44673911
accepted answer of: http://stackoverflow.com/q/28150936
upvote count: 1
has comment: http://stackoverflow.com/comment/44673822
type: AcceptedAnswer
type: Answer
has body: You're adding the new node twice, once correctly between 7 and 5, and then another time at the end (l.add()) So your linked list looks somewhat like 2, 7, 4, 5, 8, 6, 4[, 5, 8, 6, 4[, 5, 8, 6, 4[, .... ] ] ] ^-----------^------------^------------^ Same object, creating a circular loop Inserting a loop at position n should be straightforward: Find current node at n Set newNode.next = Node[n].next (which becomes the node at n+1) Set Node[n].next = newNode
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44673805
answers question: http://stackoverflow.com/q/28150936

http://stackoverflow.com/q/28240921
favorite count: 0
has answer: http://stackoverflow.com/a/28241885
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/28241885
downvote count: 1
has answer: http://stackoverflow.com/a/28241882
type: Question
has title: jQuery slider navigation issue
has body: I've made a jQuery slider that would automatically change slides every 1s, but when i added sliding bullets (stylized divs) It started malfunctioning. I tried everything to fix it, but i couldn't figure out what's wrong, i hope you could do what i failed to do If you didn't understand the description, here is a fiddle http://jsfiddle.net/fxk1fxy9/ PS: The slider itself works fine, and if i don't hover the "bullets" there is no issue Here is my code JS $(document).ready(function(){ $('.pic').hide(); i=1; function slider(){ $('#pic-'+i).fadeIn('0').delay(1000).fadeOut('0',function(){ i=i+1;if(i==6){i=1;}slider(); }); } slider(); }); function show1(){ $('.pic').hide(); $('#pic-1').fadeIn('1').delay(1000); } function show2(){ $('.pic').hide(); $('#pic-2').fadeIn('1').delay(1000); } function show3(){ $('.pic').hide(); $('#pic-3').fadeIn('1').delay(1000); } function show4(){ $('.pic').hide(); $('#pic-4').fadeIn('1').delay(1000); } function show5(){ $('.pic').hide(); $('#pic-5').fadeIn('1').delay(1000); } HTML 1 Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. > 2 Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. > 3 Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. > 4 Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. > 5 Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. > CSS *{margin:0; padding:0; border:0; box-sizing:border-box;font: inherit;} .slider{ width:100%; height:500px; overflow:hidden; background:#111; } .slide{ width:100%; height:100%; float:left; position:relative; } .options{ width:10%; height:100%; position:absolute; z-index:99; } .option{ width:700px; height:18%; margin-bottom:9%; background:rgba(0, 0, 0, .7); cursor:pointer; transition:all .5s ease; } .option:hover{ background:#…
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28241882
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44843212
tagged with: jquery

http://stackoverflow.com/comment/44742583
comment on: http://stackoverflow.com/a/28186220
type: AnswerComment
type: Comment
score: 1
has text: Best answer so far it has been working with no broken image tags. Thanks for the fast answer would defiantly vote you up if I could hope others do.

http://stackoverflow.com/q/28268203
answer count: 0
has comment: http://stackoverflow.com/comment/44892657
type: UnansweredQuestion
has body: I'm trying to add a new Object to an array each time I call a function with Javascript, but it appears that the object is created correctly but when I check for the size of the array it is always 0. What can it be? var comments = new Array(); function validateComment() { var x = document.forms["commentForm"]["commentSection"].value; if (x == null || x == "") { alert("There's nothing to comment, write something to proceed."); return false; } else { var comment = { firstName:"Name", lastName:"Surname", text:x }; comments.push(comment); } } Thanks for your help.
has comment: http://stackoverflow.com/comment/44892777
tagged with: object
has comment: http://stackoverflow.com/comment/44892475
has title: How to properly add a new object to an array in javascript?
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/44892719
tagged with: javascript
has comment: http://stackoverflow.com/comment/44892785
has comment: http://stackoverflow.com/comment/44892539
score: 0
has comment: http://stackoverflow.com/comment/44892576
has comment: http://stackoverflow.com/comment/44892681
has comment: http://stackoverflow.com/comment/44892726
has comment: http://stackoverflow.com/comment/44892763

http://stackoverflow.com/a/28176914
downvote count: 0
answers question: http://stackoverflow.com/q/28176766
has body: You may try redirecting to a URL containing the username and password: http://user:password@host/path?query Note that due to various security restrictions, this may not always work, or generate security alerts.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28176766
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/44722473
has text: It's easy to set and change the domain using `alpha.domain(d3.extent(...))` using a data array and optional accessor (see https://github.com/mbostock/d3/wiki/Arrays#d3_extent). But I've not thought of an easy way to define this per column (as opposed to per table row, or over the whole data set, both of which would be easier!). Might be worth asking as a separate question
comment on: http://stackoverflow.com/a/28173845
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/44748609
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28188660
has text: Doesn't the page say file names should have the version in their names?

http://stackoverflow.com/comment/44861908
type: QuestionComment
comment on: http://stackoverflow.com/q/28248855
score: 1
has text: This is the best I can do. http://jsfiddle.net/6cn6dtyj/ Can you share your progress?
type: Comment

http://stackoverflow.com/a/28276348
answers question: http://stackoverflow.com/q/28276108
has body: You can replace content in function parameter with this.id like below <?php echo $this->__('Occasion') ?>* <select id="type_id" name="type_id" title="<?php echo $this->__('Occasion') ?>" class="validate-select form-control" onChange="criaDados(), showId('this.id') { echo "style='display: none;'"; } ?> > <?php echo $this->__('Please select occasion') ?> <?php foreach($_e->getTypes() as $k=>$v):?> <option value="<?php echo $k ?>" <?php if($_e->getTypeId() == $k) echo 'selected'?>><?php echo $this->htmlEscape($v) ?> <?php endforeach; ?> <input type="text" value="<?php echo $_e->getTypes()[$_e->getTypeId()] ?>" class="form-control" disabled <?php if (is_null ($_e->getId())) { echo "style='display: none;'"; } ?> /> Then you can use it function showId(id) { var id_val = $("#" + id).val(); alert(id_val); }
has comment: http://stackoverflow.com/comment/44908883
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44909698
score: 1

http://stackoverflow.com/comment/44852776
has text: @Oriol, my bad. I should of thought out my question more, what an absolute joke this was. I'm using this inside a function, so ofcourse it will be need to be passed, because it is dynamic. I marked yours as the best answer, and apologizes for putting you through this cesspool of a question. Thanks everyone for your help. (Since this has to be called, shorthanding this is a dumb idea, and not really saving any code now that I think about it :D) Sometimes it's best for me to explain my question out in a post, to help me better understand my own code.. Weird, I know ha.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28245560
type: Comment

http://stackoverflow.com/comment/44698923
has text: I can't say that it's a solution, as it's been about 2 years since I've had to think SiteCatalyst, but for debugging purposes, try two things: 1) make sure you're only calling the `s = s_gi()` call once on the page for that account; once it's created, you shouldn't have to create it again 2) try passing in a custom object, rather than working with global state: `s.tl(this, "o", "MyEventType", { linkTrackVars : "events", linkTrackEvents : "event6,event7", events: "event6,event7" }); See if that does you any favours or leads you in the right direction; it's hard to guess, without the code.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28163384
score: 0

http://stackoverflow.com/a/28140021
downvote count: 0
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28139972
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28139972
has body: It is fine to access $scope in that function. .controller("myCtryl", function($scope, $http) { $scope.functionA = function(){ $scope.data = "some data"; } $scope.functionB = function(){ $scope.data //this id valid } }
type: Answer

http://stackoverflow.com/comment/44628231
score: 0
has text: i directly copied this portion from his code .thanks for pointing it out
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28127415

http://stackoverflow.com/a/28173525
answers question: http://stackoverflow.com/q/28171018
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: add 'checkChanged' event handler to editor object, not document editor.on('checkChange', function (event) {

http://stackoverflow.com/comment/44821207
has text: Don't push into the `pages` array. You already know how many pages are going to come in. Just assign the correct page to the correct index. `pages[i] = {image:...` instead of `pages.push()` EDIT: See @Patrick Evans's answer.
score: 0
comment on: http://stackoverflow.com/q/28228886
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44739408
score: 0
type: Comment
has text: <?php App::uses('AppController', 'Controller'); class VenuesController extends AppController { public $uses = array('State','Country','Venue','Facility','User','Image'); public $components = array('Custom'); public function state() { if($this->RequestHandler->isAjax()) { $this->layout = 'ajax'; $countryid=$this->request->data('country_id'); $selectstate = $this->State->find('list', array('fields' => array('state_name'), 'conditions' => array('State.country_id' => $countryid))); $this->set('selectbox',$selectstate); //pr($selectstate); } } }
type: QuestionComment
comment on: http://stackoverflow.com/q/28185146

http://stackoverflow.com/comment/44697828
type: Comment
has text: Nice! Working 100%.. Can i please ask you something? If i use req.param('lang') = req.param('lang') || 'pt'; doesn't work.. Why??? haha
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28163438

http://stackoverflow.com/comment/44815987
type: Comment
score: 0
type: AnswerComment
has text: @zerkms it's not wrong, it's just hard to see the difference between `undefined` the variable name, `undefined` the value and `Undefined` the type.
comment on: http://stackoverflow.com/a/28225622

http://stackoverflow.com/comment/44784329
score: 0
type: Comment
type: QuestionComment
has text: I have updated my question with the researches I have made.
comment on: http://stackoverflow.com/q/28209509

http://stackoverflow.com/comment/44788878
type: QuestionComment
comment on: http://stackoverflow.com/q/28212368
has text: It would be best to not to re-invent the wheel here and use a a library such as http://momentjs.com/ which will probably do a better job.
score: 1
type: Comment

http://stackoverflow.com/a/28158687
score: 2
has body: Well your colleague gave you bad code. First var selected_project = $('#project').data('person_ids'); will return undefined since it is not on the select, it is on the option. It does not magically get the selected option's data attribute var selected_project = $('#project option:selected').data('person_ids'); Next there is a random + in the code filterOptions($allPersonOptions.clone(), +selected_project).appendTo($person.empty()); ^^^ That is going to do a conversion, bad. Next the filter code is looking for a data attribute return $.inArray(id, $(this).data('project_ids')) > -1 There is no data attribute on that select's options. And the arguments are switched. $(function() { var $person = $('#person'); $allPersonOptions = $person.children(); $('#project').on('change', function() { var selected_project = $('#project option:selected').data('person_ids'); filterOptions($allPersonOptions.clone(), selected_project).appendTo($person.empty()); }); }); function filterOptions($options, id) { return $options.filter(function() { return $.inArray(parseInt(this.value,10), id) > -1 }); } None Project A Project B Project C Person A Person B Person C
has comment: http://stackoverflow.com/comment/44688874
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28158463
has comment: http://stackoverflow.com/comment/44688828
answers question: http://stackoverflow.com/q/28158463
has comment: http://stackoverflow.com/comment/44688838
type: Answer

http://stackoverflow.com/q/28158162
tagged with: canvas
tagged with: javascript
has title: Draw sharper text on a clear canvas
answer count: 1
downvote count: 0
favorite count: 0
has body: The problem is that the ctx.fillText() produces text that are much blurrier than the text displayed in a normal webpage. In this example, the text on right is produced on canvas and on left is on using html only. It is taken from this question Can canvas context.fillText be made crisp (because context.translate 0.5/0.5 doesn&#39;t) but there was no answer to that question and the post may now be outdated. I only need to output text to a clear canvas and I wish to increase the quality of the text. I am willing to do things pixel by pixel if that can make the text sharper. The problem is I don't know where to start.
has answer: http://stackoverflow.com/a/28158507
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6838461
score: 3
has comment: http://stackoverflow.com/comment/44687732
upvote count: 3
type: Question

http://stackoverflow.com/a/28164471
has comment: http://stackoverflow.com/comment/44700095
accepted answer of: http://stackoverflow.com/q/28164405
type: Answer
has body: You were almost there. Everything except: you have to change the number into a string you have to not reassign newNumber every time you have to use a strict less-than comparison in the loop So var datArray = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]; var toEnglish = function (number) { number = number.toString(); var newNumber = ""; for ( var i = 0; i &lt; number.length; i++ ) { newNumber += datArray[number[i]]; } return newNumber; } toEnglish(1234); Edit A far more functional and terse version would be var toEnglish = function (number) { return number.toString().split('').map(function(i) { return datArray[i] }).join(' '); }; This assumes a version of Javascript that has map built in, but almost every library (jQuery, underscore, &amp;c.) will have some equivalent. In fact, if you are sure of a really advanced version of Javascript (e.g. in Firefox), you can write it as var toEnglish = function (number) { return number.toString().split('').map(i =&gt; datArray[i]).join(' '); } Shweet.
score: 3
has comment: http://stackoverflow.com/comment/44721009
upvote count: 3
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28164405

http://stackoverflow.com/a/28135996
answers question: http://stackoverflow.com/q/28135969
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28135969
type: Answer
has comment: http://stackoverflow.com/comment/44643888
has body: First, declare variable interval var interval = setInterval(function(s){scrollBy(0,s||10000)},1000); and then clean it in function function stopScroll() { clearInterval(interval); }
upvote count: 3
score: 3

http://stackoverflow.com/a/28179130
has comment: http://stackoverflow.com/comment/44798708
answers question: http://stackoverflow.com/q/28172507
has comment: http://stackoverflow.com/comment/108049394
type: Answer
has comment: http://stackoverflow.com/comment/108058550
score: 1
has body: All of those model methods (querying/updating data) are asynchronous. There are no synchronous versions. Instead, you'll need to use the callback function that you pass as the second argument: for (var i = 0; i&lt;n; ++i) { User.find( {where: { name: 'john'} }, function(err, users) { // check for errors first... if (err) { // handle the error somehow... return; } // this is where you do any further processing... // for example: if (users[0].lastName === 'smith') { ... } } ); }
upvote count: 2
downvote count: 1

http://stackoverflow.com/comment/44806579
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28221469
has text: Promises are more elegant than waterfalls? That's not a discussion, that's a fact! :-)
type: Comment

http://stackoverflow.com/q/28209558
answer count: 1
tagged with: javascript
has title: getElementsByClassname from selection box
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/44784957
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
has body: If I select option 1 i want to get categClass1. If I select option 2 i want to get categClass2. etc ... I want to get those in function addCategory : function addCategorySelectBox(i) { var = document.getElementById("newCateg").value; var y = document.getElementById('selectCategory'); var option = document.createElement("option"); //create class name dynamically; option.setAttribute('class', "categClass" + i); option.value = categoryValue; option.text = categoryValue; y.add(option); var newCategClass = "categClass" + i; return "categClass" + i; } function addCategory() { // ?? var x =document.getElementsByClassName(newCategClass); } &lt;p&gt;Ονομα Kατηγορίας: &lt;label&gt; &lt;input type="text" name="new-cat" id="newCateg" /&gt; &lt;/label&gt; &lt;input type="button" name="add-c" id="addCateg" value="Προσθήκη" onclick="return addCategorySelectBox(1);addCategory()" /&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Κατηγορία: &lt;select id="selectCategory"&gt; &lt;option&gt;Επιλογή ...&lt;/option&gt; &lt;option class="categClass1"&gt;Εξοδα Κατοικίας&lt;/option&gt; &lt;option class="categClass2"&gt;Εξοδα Εκπαίδευσης&lt;/option&gt; &lt;option class="categClass3"&gt;Εξοδα Ψηχαγωγίας&lt;/option&gt; &lt;/select&gt;
has answer: http://stackoverflow.com/a/28210432
accepted answer: http://stackoverflow.com/a/28210432
type: AnsweredQuestion
type: Question
score: -2
has comment: http://stackoverflow.com/comment/44784860

http://stackoverflow.com/q/28224985
type: Question
has comment: http://stackoverflow.com/comment/44813527
has comment: http://stackoverflow.com/comment/44813299
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/57002
has comment: http://stackoverflow.com/comment/44813277
has body: When I insert empty entries into a table created using DataTables they aren't displayed right. How to fix this? JSFiddle HTML User Age Country JavaScript //Add activity as row function addRow(user,age,country) { var table = $('#userTable').DataTable(); table.row.add([ user, age, country ]).draw(); table.columns.adjust().draw(); } //Default $(document).ready(function () { //initializing table var table = $('#userTable').dataTable({ "lengthMenu": [ [5, 10, 15, 25, -1], [5, 10, 15, 25, "All"] ], "pageLength": 5, "order": 0, "desc" , "aoColumnDefs": [{ "bSortable": false, "aTargets": [ 2 ] }] }); //Adding sample rows addRow("a","12",""); addRow("b","13","USA"); addRow("c","14",""); addRow("d","15",""); addRow("e","18",""); addRow("f","17","UK"); addRow("g","16","USA"); addRow("h","11",""); addRow("i","10",""); });
has comment: http://stackoverflow.com/comment/44813303
score: 0
has title: How to display empty entries in DataTables properly
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
has comment: http://stackoverflow.com/comment/44813229
tagged with: twitter-bootstrap-3
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28230198
type: Answer
answers question: http://stackoverflow.com/q/28229348
has body: use custom-templates ==> custom-templates $(input_example).typeahead(null, { name: 'example', displayKey: 'name', source: example.ttAdapter(), //custom your output (in example use Handlebars.js) templates: { suggestion: Handlebars.compile( '&lt;div class="text-left" style="color:#222;" data-scode="{{ name }}"&gt;&lt;p class="text-left"&gt;&lt;strong&gt;{{ id }}&lt;/strong&gt;&lt;/p&gt;&lt;div&gt;') } })
score: 0

ios
tags question: http://stackoverflow.com/q/28155841
tags question: http://stackoverflow.com/q/28219611
tags question: http://stackoverflow.com/q/28135785
tags question: http://stackoverflow.com/q/28138510
tags question: http://stackoverflow.com/q/28175733
tags question: http://stackoverflow.com/q/28179904
type: Tag
tags question: http://stackoverflow.com/q/28168698
tags question: http://stackoverflow.com/q/28267050
tags question: http://stackoverflow.com/q/28240971
tags question: http://stackoverflow.com/q/28195567
tags question: http://stackoverflow.com/q/28247102
tags question: http://stackoverflow.com/q/28171174
tags question: http://stackoverflow.com/q/28180467
tags question: http://stackoverflow.com/q/28205621
tags question: http://stackoverflow.com/q/28122187
tag name: ios
tags question: http://stackoverflow.com/q/28168779
tags question: http://stackoverflow.com/q/28221009
tags question: http://stackoverflow.com/q/28213390
tags question: http://stackoverflow.com/q/28239571
tags question: http://stackoverflow.com/q/28245483
tags question: http://stackoverflow.com/q/28253281
tags question: http://stackoverflow.com/q/28193499
tags question: http://stackoverflow.com/q/28183374
tags question: http://stackoverflow.com/q/28267214
tags question: http://stackoverflow.com/q/28260360
tags question: http://stackoverflow.com/q/28232227
tags question: http://stackoverflow.com/q/28208512
tags question: http://stackoverflow.com/q/28256440
tags question: http://stackoverflow.com/q/28156048

http://stackoverflow.com/q/28132125
has title: express router not resolving path correctly
tagged with: node.js
answer count: 0
type: UnansweredQuestion
type: Question
has body: I am working on an application. In that application I defined all my routes in config file and I created a middleware to load all routes. Below is middleware code var loadRoutes = function(router, config, controllers) { var route, routeValues, routeKeys, verb, path, controllerName, actionName, actionMethod; //load and initialize secured routes for (route in config.routes.secured) { if (config.routes.secured.hasOwnProperty(route)) { routeValues = config.routes.secured[route].split('#'); if (routeValues.length !== 2) { throw new Error('ERROR Route value "' + config.routes.secured[route] + '" Route value must be "&lt;controller-name&gt;#&lt;action-method-name&gt;",' + ' like "foo#index"'); } routeKeys = route.split(' '); if (routeKeys.length !== 2) { throw new Error('ERROR Route key "' + route + '" Route key must be "&lt;HTTP-verb&gt; &lt;path-pattern&gt;", like "GET /foo/:id"'); } verb = routeKeys[0]; path = routeKeys[1]; controllerName = routeValues[0]; actionName = routeValues[1]; if (!routingMethods[verb]) { throw new Error('HTTP verb "' + verb + '" for route "' + route + '" is not supported!'); } if (!controllers[controllerName]) { throw new Error('Controller "' + controllerName + '" is not available for route "' + route + '"!'); } actionMethod = controllers[controllerName][actionName]; if (!actionMethod) { throw new Error('Action method "' + controllerName + '#' + actionName + '" is not available for route "' + route + '"!'); } console.log(routingMethods[verb]); console.log(path); router[routingMethods[verb]](path, auth(), controllers[controllerName][actionName]); } } }; The router is an instance of express.Router(); I defined the routes configuration as { "routes": { "secured": { "GET /users/me": "UserController#getMyUserProfile", "PUT /users/me": "UserController#updateCurrentUserProfile", "POST /forgotPassword": "UserController#recoverPassword", "POST /resetPassword": "UserController#resetPassword", "GET /users/:id": "UserController#getUserProfile", } } } Now w…
has comment: http://stackoverflow.com/comment/44637479
has comment: http://stackoverflow.com/comment/44638554
has comment: http://stackoverflow.com/comment/44637762
has comment: http://stackoverflow.com/comment/44637490
has comment: http://stackoverflow.com/comment/44637386
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/44638505

http://stackoverflow.com/q/28236711
has answer: http://stackoverflow.com/a/29646958
has title: Doing PJAX calls in Instantclick style (loading only required content on hover of the links)
type: Question
upvote count: 2
tagged with: pjax
has answer: http://stackoverflow.com/a/28253920
tagged with: javascript
has answer: http://stackoverflow.com/a/29605685
tagged with: jquery
tagged with: instant
favorite count: 0
tagged with: ajax
answer count: 3
has body: PJAX does the job very simple by loading the only required content of a requested page, instead of loading all common pattern again and places the received content in the layout- just like single page app with angular JS with all back buttona and history capabilities. Instantclick (instantclick.io) is another interesting one that requests the page on hover of a link and load the content into cache and replaces the content when user releases the click-excellent but this loads the entire page. What I want is Instantclick pulling only the required content like PJAX, some thing like triggering PJAX request on hover of links(with or without support of Instantclick) - There is a delay from going on to the link and clicking to click releasing, and in this time PJAX can finish the job and brings the content up 100% instantly. Is there a way to do that? Thank you
score: 2
has comment: http://stackoverflow.com/comment/47323978
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47492125

http://stackoverflow.com/comment/44875304
type: QuestionComment
has text: What do you mean by "boxes"? Are these boxes inline as columns, or stacked on top of each other? Please provide some sample code so I gain gain context to your problem.
comment on: http://stackoverflow.com/q/28258654
score: 0
type: Comment

http://stackoverflow.com/comment/44905409
type: AnswerComment
comment on: http://stackoverflow.com/a/28268249
type: Comment
has text: lol. it worked after I moved the script to the bottom of the page.
score: 0

http://stackoverflow.com/q/28225536
has body: I have a div class "asset-container" with a data-id attribute. I also have a div class "popover-content" with an associated data-id. When I hover over "asset-container", I want the "popover-content" show. There are a lot of these, which is why I have data-id attached to each of the two divs so I can call the associated div to show. I have tried several iterations of script and am not getting anywhere js: $(document).ready(function() { custom_popover(); }); function custom_popover() { $(".asset-container").mouseover(function() { $('.popover-content [data-id=' + this.value + ']').show(); }); } html:
has comment: http://stackoverflow.com/comment/44814420
has comment: http://stackoverflow.com/comment/44814391
has title: on mouse over show associated div
has comment: http://stackoverflow.com/comment/44814607
type: AnsweredQuestion
downvote count: 2
type: Question
score: -2
tagged with: javascript
tagged with: jquery
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28225760
has comment: http://stackoverflow.com/comment/44814533
favorite count: 0
has comment: http://stackoverflow.com/comment/44814485
has comment: http://stackoverflow.com/comment/44814308
accepted answer: http://stackoverflow.com/a/28225760

http://stackoverflow.com/comment/45067736
score: 0
type: Comment
has text: function add() { $data=array( 'rec_date'=>$this->input->post('rec_date'), ); $this->db->insert('tablename',$data); } This the sql code
comment on: http://stackoverflow.com/a/28209368
type: AnswerComment

random
tags question: http://stackoverflow.com/q/28198582
tags question: http://stackoverflow.com/q/28195267
tags question: http://stackoverflow.com/q/28243064
tags question: http://stackoverflow.com/q/28243874
tags question: http://stackoverflow.com/q/28208031
tags question: http://stackoverflow.com/q/28146476
tags question: http://stackoverflow.com/q/28254883
tags question: http://stackoverflow.com/q/28143193
tags question: http://stackoverflow.com/q/28240550
tags question: http://stackoverflow.com/q/28143832
tag name: random
tags question: http://stackoverflow.com/q/28261684
tags question: http://stackoverflow.com/q/28126419
type: Tag
tags question: http://stackoverflow.com/q/28199100
tags question: http://stackoverflow.com/q/28199629
tags question: http://stackoverflow.com/q/28256506

http://stackoverflow.com/comment/44829272
score: 0
type: QuestionComment
type: Comment
has text: @cellik, no, I changed the link for editing purposes. URL is the same for the jquery & native js code.
comment on: http://stackoverflow.com/q/28233487

http://stackoverflow.com/a/28253770
has comment: http://stackoverflow.com/comment/44871637
type: Answer
has comment: http://stackoverflow.com/comment/44866192
has comment: http://stackoverflow.com/comment/44866354
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/44866199
has comment: http://stackoverflow.com/comment/44866255
has body: isPrototypeOf and getPrototypeOf look at the prototype chain directly, while instanceof looks at the .prototype property of the given constructor function. You need to use: function isError(x) { return Error.prototype.isPrototypeOf(x) } Your function tests whether x inherits from the Error constructor function object.
answers question: http://stackoverflow.com/q/28253739
has comment: http://stackoverflow.com/comment/44866961
downvote count: 0
has comment: http://stackoverflow.com/comment/44866283

http://stackoverflow.com/a/28253944
answers question: http://stackoverflow.com/q/28253739
has comment: http://stackoverflow.com/comment/44872650
has comment: http://stackoverflow.com/comment/44872113
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44871735
accepted answer of: http://stackoverflow.com/q/28253739
has body: instanceof looks at the .prototype property (i.e. not Prototype/__proto__) of the specified constructor function for you (i.e. it does some additional work). isPrototypeOf doesn't work as hard and requires you to specify the exact object instance you want to check for on the prototype chain. Error.isPrototypeOf(r = new RangeError); // false. false because the function Error does not sit on the prototype chain of r. The prototype chain of r is: r => RangeError.prototype (an instance of Error) => Error.prototype (an instance of Object)) Nowhere on this chain is the Error constructor function, hence false. If we modify your example like so: Error.prototype.isPrototypeOf(r = new RangeError); // true. This returns true because the .prototype property of the Error function is on the prototype chain of r.
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44872382
has comment: http://stackoverflow.com/comment/44871926

http://stackoverflow.com/q/28154643
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has title: Crop a triangle from image and place it below the original image CSS
duplicate of: http://stackoverflow.com/q/23758922
has answer: http://stackoverflow.com/a/28154718
type: Question
has body: I am trying to achieve this effect using HTML/CSS: What I have until now is this http://jsfiddle.net/zxq91ok0/ .wrap { position: relative; overflow: hidden; width: 100%; height:250px; margin: 0 auto; background-color:#B2C2CC; } .wrap img { width: 100%; height: auto; display: block; } .wrap:before, .wrap:after { content:''; position: absolute; bottom: 0; width: 50%; background-color: inherit; padding-bottom:3%; } .wrap:before { right: 50%; -ms-transform-origin: 100% 100%; -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; -ms-transform: skewX(45deg); -webkit-transform: skewX(45deg); transform: skewX(45deg); } .wrap:after { left: 50%; -ms-transform-origin: 0 100%; -webkit-transform-origin: 0 100%; transform-origin: 0 100%; -ms-transform: skewX(-45deg); -webkit-transform: skewX(-45deg); transform: skewX(-45deg); } The problem I face is that instead of plain background color I have another image as a background so I can't figure out how to get rid of the light blue background. Can you help me accomplish the effect shown on the first image? Thanks!
linked to: http://stackoverflow.com/q/23758922
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44828581
type: QuestionComment
has text: @AndrewCounts no its php file somelike header.php
comment on: http://stackoverflow.com/q/28231367
score: 0
type: Comment

http://stackoverflow.com/comment/44634787
has text: You should be using Angular form validations and ng-messages instead
score: 0
comment on: http://stackoverflow.com/q/28131003
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28277184
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28269472
has body: Ultimately, it depends on how your application works. The following assumes that the element you are looking for is always in immediate child of your a element, and that it always has the .btn_text class. You can just manipulate selectors like any string: String parent_sel = "#main &gt; div &gt; div.footer &gt; div &gt; a"; String child_sel = parent_sel + " &gt; div.btn_text"; Both strings can be passed to By.cssSelector. If my assumptions are incorrect, adapt as needed. For instance if the div can be a descendant of a without necessarily be a child of it, you could concatenate " div.btn_text" to get the child_sel. I want to fetch its text In case you were looking for a selector that will give you text, I'll note that there is no selector you can pass to findElement to get text. This function always returns elements (or list of elements when used in its plural form). You'll have to use getText() on the element you get. (And in case you wonder: XPath in general can select text, but not when you use it through Selenium.)
score: 0
answers question: http://stackoverflow.com/q/28269472

http://stackoverflow.com/comment/44899753
comment on: http://stackoverflow.com/q/28272218
has text: possible duplicate of [Closing Excel ActiveX object from JavaScript leaves excel.exe in memory](http://stackoverflow.com/questions/17309231/closing-excel-activex-object-from-javascript-leaves-excel-exe-in-memory)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28250231
has comment: http://stackoverflow.com/comment/44863888
has body: Try this. First, return the kog.json file with dataType: text(text/plain) This returned data in the json file as string. var data = '{gold:"or not",\r\nmine:"o...",\r\nParis:"i hate one"}'; Now the unwanted \r\n was removed (line-break) var formattedData = data.replace(/\r\n/g, ''); Lastly an unholy eval was performed like this. eval("var objLiteral = " + formattedData); so that I could get Paris like this console.log(objLiteral["Paris"]); JavaScript Snippet var url = "/WebFormsDemo/Samples/kog.json"; window.onload = function () { var filePath = url; xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", filePath, false); xmlhttp.send(null); var data = xmlhttp.responseText; //removing the line breaks in your text var formattedData = data.replace(/\r\n/g, ''); eval("var objLiteral = " + formattedData); console.log(objLiteral["Paris"]); }; jQuery Snippet $(function () { $.ajax({ url: url, //force to handle it as text dataType: "text", success: function (data) { //removing the line breaks in your text var formattedData = data.replace(/\r\n/g, ''); eval("var objLiteral = " + formattedData); console.log(objLiteral["Paris"]); } }); }); P.S: You should really be changing the format of "kog.json". Its invalid JSON.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28249694
type: Answer
answers question: http://stackoverflow.com/q/28249694

http://stackoverflow.com/q/28198035
has title: How to get bootstrap modal size
has comment: http://stackoverflow.com/comment/44762499
has body: I have a bootstrap modal whose size is set by: &lt;div class="modal-dialog modal-lg"&gt; I want to be able to determine the modal's size (width actually) before I make a post request to a PHP program to display some dynamic content before displaying the modal. Does anyone know how to get this information?
downvote count: 0
has answer: http://stackoverflow.com/a/28198219
favorite count: 0
tagged with: php
possible better answer: http://stackoverflow.com/a/28726848
has comment: http://stackoverflow.com/comment/44762777
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28726848
tagged with: twitter-bootstrap-3
accepted answer: http://stackoverflow.com/a/28198219
type: Question
upvote count: 4
answer count: 2
linked to: http://stackoverflow.com/q/28716986
tagged with: javascript
score: 4

http://stackoverflow.com/q/28165195
tagged with: asp.net-mvc
has title: How To dynamically Add row To Google Chart with for loop
has body: I Have Problem in Google chart. I am using asp.net Mvc. After I fetch data from controller, I pass it into Google chart . When i use manual data, for example: ['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'], ['2004/05', 165, 938, 522, 998, 450, 614.6], It Show me correctly . But how can i add my data dynamically into Google chart ? This is my code: for (var i = 0; i &lt; chartsdata.length; i++) { var data = google.visualization.arrayToDataTable([ ['Element', 'Density', {role: 'style'}], [chartsdata[i].MonthValue, chartsdata[i].CountValue, '#b87333'] ]); var options = { title: '' }; var chart = new google.visualization.ComboChart(document.getElementById('chartdiv')); chart.draw(data, options); }
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/49907463
has answer: http://stackoverflow.com/a/50643922
tagged with: bar-chart
possible better answer: http://stackoverflow.com/a/42129750
score: 8
favorite count: 0
accepted answer: http://stackoverflow.com/a/28169206
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28169206
downvote count: 0
has answer: http://stackoverflow.com/a/42129750
upvote count: 8
type: Question

http://stackoverflow.com/a/28213011
upvote count: 7
has body: \s match any white space character [\r\n\t\f ] You should use \s{2,} for this.It is made for this task.
score: 7
downvote count: 0
answers question: http://stackoverflow.com/q/28212542
type: Answer

http://stackoverflow.com/q/28152130
has answer: http://stackoverflow.com/a/28153226
tagged with: javascript
has comment: http://stackoverflow.com/comment/44677082
has title: Highcharts don't show data after remove
score: 2
answer count: 1
tagged with: highcharts
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28153226
type: AnsweredQuestion
upvote count: 3
has body: I'm new to highcharts and get stuck here, please see if you can help me. I want to be able to dynamically add and remove data in highcharts. My code works at the start, but when i finish adding data and want to remove all of it and start again, something strange happens. My data don't show anymore, just the bottom headings. Fiddle chart.series[0].remove(false); Please try to add, remove and then add code again via the buttons on top. If i change the remove method of highcharts to false (it is true by default) it is working, but the chart is not auto resizing anymore so this is not a solution for me. Any suggestions are welcomed.
has comment: http://stackoverflow.com/comment/44677139
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44677474

http://stackoverflow.com/comment/44897743
comment on: http://stackoverflow.com/a/28270630
score: 0
type: AnswerComment
type: Comment
has text: @c-smile, it isn't wrong. With the way provided above value is updated in the page, but the `val` is an object instead of the value `10`.

http://stackoverflow.com/q/28133800
downvote count: 1
tagged with: jquery
has title: TypeError: e.getPosition is not a function
favorite count: 0
has body: I'm trying to update my lat and lng after a marker is dragged. and update input's with id's lat and lng. but i'm getting some errors Here is my code function createMyLocationMarker(point) { var marker = new google.maps.Marker({ map: EGMap0, position: point, draggable:true, title:"Hello World!" }); google.maps.event.addListener(marker, 'dragend', function(e) { jQuery("#lat").val(e.getPosition().lat()); jQuery("#lng").val(e.getPosition().lng()); }); } I get this error TypeError: getPosition is not a function on jQuery("#lat").val(e.getPosition().lat()); also tried this google.maps.event.addListener(marker, 'dragend', function(event) { document.getElementById("#lat").value = event.getPosition().lat(); document.getElementById("#lng").value = event.getPosition().lng(); }); but get this error TypeError: event.getPosition is not a function document.getElementById("#lat").value = event.getPosition().lat(); any idea what i'm missing here? Thanks
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28133830
accepted answer: http://stackoverflow.com/a/28133830
tagged with: javascript
score: 0
tagged with: google-maps
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/44805741
comment on: http://stackoverflow.com/q/28220673
has text: I think I am mistaken, what is actually happening is that a collection is being looped, and then models are being displayed in a view, the collection belongs to a parent model. I just dont get how the data from the API can not get parsed into the collection/model. I have updated my code.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/34637859
downvote count: 0
type: Answer
has body: I encountered the same problem. Using this article as reference (FYI, it was hard to read), I was able to develop the following code: //NOTE: I let jQuery UI populate these class names, so this may be different for you // the class attributed to the autocomplete unordered list .ui-autocomplete { margin:0; padding:0; list-style-type:none; // gets rid of the bullet points border: solid 1px #ccc; background-color: #fff; // provides a background for the autocomplete returned items width: 500px; // it was necessary for me to set the width } .ui-autocomplete li { font-family: Arial, Verdana, Sans-Serif; margin: 1px; cursor: pointer; display: block; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.428571429; } // to distinctly see which returned item is selected/hovered over .ui-autocomplete .ui-state-focus { background-color: #66afe9; } // to hide the lower left text .ui-helper-hidden-accessible { display:none; } And the result:
upvote count: 3
answers question: http://stackoverflow.com/q/28227698
score: 3

http://stackoverflow.com/q/28243049
type: Question
tagged with: google-analytics
tagged with: javascript
has title: Using javascript event as google tag manager trigger
score: 0
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28255755
tagged with: google-tag-manager
tagged with: forms
has body: I'm trying to use a tag to track form submits on my website using Universal Analytics &amp; Google Tag Manager. I've done this successfully on another website using the standard Form trigger, but it's not firing on this site. I believe the reason is that this form isn't set up the same way. Can anyone help me diagnose the problem &amp; find a solution. Changing the form setup isn't an option because it's an old site &amp; not templatized. So I need to figure out a tag-manager-based solution. Here is the opening form tag: &lt;form name="QuotesForm" onsubmit="return false;"&gt; And here is the input element that fires the form submission: &lt;input class="button" name="submit" onclick="goToUrl( document.QuotesForm )" type="submit" value=""&gt; So, any advice on how to track form submissions in Google Tag Manager? (I should also note that I'm using the updated UI)

http://stackoverflow.com/comment/44692635
comment on: http://stackoverflow.com/a/28160650
has text: @ajp15243 Thanks, my jQuery isn't as comprehensive as plain JavaScript.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44882835
type: QuestionComment
score: 0
has text: Just guessing a bit, but replace 'bloginfo('stylesheet_directory');' with get_stylesheet_directory_uri() in the js..
comment on: http://stackoverflow.com/q/28258989
type: Comment

http://stackoverflow.com/q/28234381
linked to: http://stackoverflow.com/q/500504
answer count: 1
has comment: http://stackoverflow.com/comment/44831760
tagged with: javascript
tagged with: for-in-loop
has comment: http://stackoverflow.com/comment/44830643
score: 0
has comment: http://stackoverflow.com/comment/44830796
has comment: http://stackoverflow.com/comment/44830769
accepted answer: http://stackoverflow.com/a/28234725
has comment: http://stackoverflow.com/comment/44830881
tagged with: google-chrome
type: AnsweredQuestion
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/28234725
has body: Ok peep's here's the problem... This is a simplified version of a file I'm writing... _ enX enY Demo str = 'abcdefghijklmnopqrstuvwxyz' function pop() { sx = 'for(ia in str)' + '\n'; for (ia in str) { sx += '\n' + ia + ' => ' + str[ia]; } enX.innerText = sx; sy = 'for(ib=0;ib<str.length;ib++)' + '\n'; for (ib = 0; ib < str.length; ib++) { sy += '\n' + ib + ' => ' + str[ib]; } enY.innerText = sy; } $(document).ready(function() { pop() }) enX enY When I load it in chrome it works fine... I get two equal columns of 0-25|a-z. Yet, when I Load it in IE, Column X, only has the header for(ia in str) and contains no instances of the loop ie: 0 => a etc... And Column Y, contains both the header for(ib=0;ib<str.length;ib++) and 26 instances of # => undefined, where # is the loop number. I'm sorry to ask such a simplistic question peep's but I've recently been teaching myself how to code a web page specifically for chrome, leaving IE behind, and it seems that in the time it's taken to learn how to code in chrome I've forgotten the fundamentals of coding in IE... All pointers welcome... just explain where I'm going wrong plz
has comment: http://stackoverflow.com/comment/44830798
has title: for...in looping working in Chrome, but not in IE?
type: Question
tagged with: for-loop

http://stackoverflow.com/q/28269430
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44895012
answer count: 0
has comment: http://stackoverflow.com/comment/44895035
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44969910
has title: Random colors in html via node.js
has comment: http://stackoverflow.com/comment/44895240
type: Question
has comment: http://stackoverflow.com/comment/44894942
tagged with: javascript
has body: function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } return color; } I am trying to use the code above to output random colors in the html code below As in that it should alter the color in the html code below, and I am having trouble linking the two files so the js file can alter the html file Ten Random Colors ae3d04 ce8cfc 510f40 a256c6 d85fd1 ... 100 list items in total this is what i am being asked to do: Each time you run the program it should generate a different set of color values. The color values should be generated as 6 equally likely hexadecimal digits, which means they should appear with the same probability. For the purpose of this assignment, you can assume that the floating point numbers produced by Math.random() are equally likely numbers between 0.0 and 1.0. Send the output to the console by calling console.log. You can view the HTML document that you generate by redirecting standard output to a file as follows. use this command in node.js cmd node colors.js > colors.html Thanks!
has comment: http://stackoverflow.com/comment/44894984
has comment: http://stackoverflow.com/comment/44894945
has comment: http://stackoverflow.com/comment/44894969
has comment: http://stackoverflow.com/comment/44895209
score: 0
has comment: http://stackoverflow.com/comment/44894810

http://stackoverflow.com/a/28207058
type: AcceptedAnswer
has body: You can try jQuery $.getScript(): Load a JavaScript file from the server using a GET HTTP request, then execute it. Example: $.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) { console.log( data ); // Data returned console.log( textStatus ); // Success console.log( jqxhr.status ); // 200 console.log( "Load was performed." ); }); For more detail: http://api.jquery.com/jquery.getscript/
score: 0
answers question: http://stackoverflow.com/q/28206945
accepted answer of: http://stackoverflow.com/q/28206945
type: Answer

http://stackoverflow.com/q/28240655
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28240761
downvote count: 0
has answer: http://stackoverflow.com/a/28240761
has body: I want to embed another page inside a table on my page. There are (at least) three ways to do this: However, I do not want these embedded pages to respond to mouse click events. I know security prevents me from capturing events: document.addEventListener("click", function() { console.log("Click captured and discarded"); }, true); // this is forbidden But I would expect to be able to do something like document.getElementById("A").disabled = true; // this should work but doesn't Is there another way to make the embedded html ignore click events? Thanks. P.S. Sorry I can't give you an example, but jsfiddle appears to prevent embedded html.
type: AnsweredQuestion
tagged with: capture
score: 1
has title: Disable embedded html
type: Question
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28262799
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28256218
answers question: http://stackoverflow.com/q/28256218
has body: I suspect here your issue is a misunderstanding of the function '.openById()'. This function is designed so that you identify and open the spreadsheet using a spreadsheet ID (The alphanumeric part of the URL when opening a sheet, such as "abc1234567"). From context and your use of the variable 'username', I think that instead you're somehow trying to open it based on an email ID (Such as user@domain.com). Incidentally, you won't be able to open the sheet in an assigned tab using Scripts. That's not what it does, and it's unable to manipulate a users browser. Perhaps an extension for Chrome would be closer to what you're looking for.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44898166
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28271048
type: Comment
has text: Its not as simple as some sample code, you need to set up the server to listen for information but heres a link to a php class https://github.com/ghedipunk/PHP-WebSockets there is prob some information there somewhere to set up your server. If not google it.

http://stackoverflow.com/comment/44809853
score: 1
has text: You can use more simple one: `m = d.getMonth() - 2; for (i = 0; i < 12; i++) $('#test').append(monthNames[(12 + m - i)%12] + " ");`
type: Comment
comment on: http://stackoverflow.com/q/28223183
type: QuestionComment

http://stackoverflow.com/q/28261877
has comment: http://stackoverflow.com/comment/44881603
tagged with: javascript
has title: Select2 dropdown search
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44890315
answer count: 0
has body: Is it possible that when a user is on a dropdown, and start typing, that the dropdown can open and start searhing. As it is now, the user first has to click ENTER or SPACE. I am using select2.4 beta 2
tagged with: select
type: Question

http://stackoverflow.com/q/28186319
has answer: http://stackoverflow.com/a/28186669
has comment: http://stackoverflow.com/comment/44741313
has body: I have a button within a repeater that needs to call a function. When someVariable is an int, runs just fine. However, when someVariable is a string, the call breaks. In the page source, I can see that the string is evaluated without single quotes in the someMethod call, so I tried added the escape \' to insert single quotes. No go. I've tried String.Format() as well, to no avail. What am I missing? OnClientClick= '&lt;%# "return someMethod(" + Eval("someVariable") + ");" %&gt;' *breaks when someVariable is a string
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/17525539
type: Question
has title: onClientClick with JavaScript function and eval
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28186669
has comment: http://stackoverflow.com/comment/44741260
score: 0
answer count: 1
tagged with: jquery
duplicate of: http://stackoverflow.com/q/17525539
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44741459

http://stackoverflow.com/q/28142176
has comment: http://stackoverflow.com/comment/44656847
has body: Complete nubie here and perhaps I do not know enough about how a CSS website works but I am looking to do something I think should be fairly simple. …and I hate to think I am the only one who is trying to do this. I am working with an automatically generated css / java script website. On the “individual” page it lists a person’s name in one of the header tags (h2 if you need to know) I would like to capture the name and add it to a variable in a script that I found that will basically append it to a url and present the url as a hyperlink called “View All Media”. I am using the url to search a database page. Here’s the script I am using: View All Media On the “individual page” the tag I am trying to get the text from is which is the person’s name. The database is based on the person’s name so in a nutshell all I want to do is take the name off the page and append it to the hyperlink as a search parameter. Here is where the name gets put on the page and I would imagine it gets the data from one of the scripts that are listed at the top of the page: ` ` ` Individual Details ` ` ` If I put the person’s name in the script manually in the “var scrt_var = ;” line (like var scrt_var = “John Doe” ;) it works. All I am trying to do is get the nane from the page (or source wherever it is) and put it in the "var=" line automatically. I think it should be a fairly simple task but I have been all over the net and all I can find are scripts that will change the tags or add hyperlinks to them...not get he data. I want to do it the other way around…sort of. I have some familiarity with scripts but really at a complete loss on how to do this. Any thoughts would be very much appreciated?....oh and please be gentle - Thanks! 
tagged with: jquery
has comment: http://stackoverflow.com/comment/44656039
favorite count: 0
accepted answer: http://stackoverflow.com/a/28142342
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Looking for a way to append data from a div to a hyperlink
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28142342
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28225991
has comment: http://stackoverflow.com/comment/80389368
type: AcceptedAnswer
has body: OK! Got it! To solve this problem I used the attribute display of X-Editable. So, from X-Editable display attribute documentation: Callback to perform custom displaying of value in element's text. If null, default input's display used. If false, no displaying methods will be called, element's text will never change. Runs under element's scope. I updated my code and after the response from AJAX request, I update the text this way: //ommited x-editable other code... display: function (value, sourceData, response) { $(this).html(response.value); } Here an working example but using text box. I used a select box. The link: http://jsfiddle.net/xBB5x/278/
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28190106
answers question: http://stackoverflow.com/q/28190106
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/136747502

http://stackoverflow.com/q/28152379
answer count: 3
has answer: http://stackoverflow.com/a/28152671
tagged with: javascript
has comment: http://stackoverflow.com/comment/44676214
has answer: http://stackoverflow.com/a/28152548
accepted answer: http://stackoverflow.com/a/28152548
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44676053
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44676232
type: AnsweredQuestion
has body: I have following 2 html pages 1. home.html &lt;div data-ng-controller="userComments"&gt; &lt;Will display all the comments&gt; &lt;/div&gt; 2. comments.html &lt;div data-ng-controller="userComments"&gt; &lt;Have a comment box and submit button. Submit button calls submit() function on ng-click&gt; &lt;/div&gt; where comments.html is pop-up which is initiated from the home page. And controller .controller('userComment',['$scope', function($scope){ $scope.title = 'User Comment'; $scope.comments = &lt;db call&gt; $scope.cmt = ''; $scope.submit = function(){ console.log("comment just entered", $scope.cmt); $scope.comments = $scope.comments.concat($scope.cmt); console.log("Updated Comments", $scope.comments); }; }]) New comments need to be updated automatically in the home.html as well. What should i do to accomplish that? Thanks Update: when the comments are added in the comment.html page, ng-click triggers submit function, $scope.comments gets updated with the new comment, but what should i do to get the updated comments in the home.html too?
has comment: http://stackoverflow.com/comment/44676414
has answer: http://stackoverflow.com/a/28254731
type: Question
has title: Angular.js: How to update data from one HTML to other HTML which uses same controller
has comment: http://stackoverflow.com/comment/44676284
linked to: http://stackoverflow.com/q/26895567
possible better answer: http://stackoverflow.com/a/28152671

http://stackoverflow.com/a/28268364
has comment: http://stackoverflow.com/comment/45050466
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45050645
has body: You can use underscore for the more functional style. You can iterate over your object if missing you can change or if it sub-object reiterate and change every missing sub-object properties. function remap(object, missingValue, suppliedValue){ var keys= _.keys(object); return _.reduce(keys, function(memo, key){ memo[key] = object[key]; if(memo[key] === missingValue){ memo[key] = suppliedValue; } if(_.isObject(memo[key])){ memo[key] = remap(memo[key],missingValue,suppliedValue); } return memo; }, {}); } var h = {val : 3, b : undefined, d : undefined , k : { a: false, b: undefined }, c: function(){ console.log(a);}}; console.log(remap(h,undefined,false)); If you need more complex check for comparing values then use the below function. function remap(object, complexCheck){ var keys= _.keys(object); return _.reduce(keys, function(memo, key){ memo[key] = object[key]; memo[key] = complexCheck(memo[key]); if(_.isObject(memo[key])){ memo[key] = remap(memo[key],complexCheck); } return memo; }, {}); }
answers question: http://stackoverflow.com/q/28267501
upvote count: 1
has comment: http://stackoverflow.com/comment/45050956
has comment: http://stackoverflow.com/comment/44966066

http://stackoverflow.com/comment/44694398
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28161548
has text: Wow! I had `$( document ).ajaxStart(function() ` Scrabbled away in my code. I just did a ctr+f and found it. Removed it, and all is good. Thank you Alexis and sorry for such a embarrassing mistake!

http://stackoverflow.com/comment/93054690
has text: Current accepted answer seems to fulfill the OP's need. What does your answer brings more? Also, you shall always explain the code you post as answer.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/53078302

http://stackoverflow.com/q/28153923
tagged with: firefox
favorite count: 0
has comment: http://stackoverflow.com/comment/44679320
has comment: http://stackoverflow.com/comment/44679583
accepted answer: http://stackoverflow.com/a/28155232
has body: alert(window.parent.frames.toolbar.location) the alert is undefined in Firefox, IE it work fine.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44679878
downvote count: 2
has comment: http://stackoverflow.com/comment/44679539
possible better answer: http://stackoverflow.com/a/28154107
upvote count: 1
has answer: http://stackoverflow.com/a/28154107
type: Question
has title: window.parent.frames don't work in Firefox
tagged with: internet-explorer
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28155232
answer count: 2
has comment: http://stackoverflow.com/comment/44679397

http://stackoverflow.com/comment/44904292
type: QuestionComment
has text: @Van: `preventDefault` works just fine on current browsers at the least (didn't test older ones).
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28273182

http://stackoverflow.com/comment/44848705
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28232780
type: Comment
has text: Ah, I gotcha. And because my browser supports the first with native functionality, all I see when look in the console is the `[native code]`. I had expected to see the actual function. Thanks.

http://stackoverflow.com/comment/44762677
comment on: http://stackoverflow.com/a/28196628
score: 0
has text: Thankfully my application requirement that at any one time, the most cards is 10 and the max sets per day is 6. I spent a long time searching through jquery and other libraries in the hope of finding a way to break down the problem a little. I'm not particular good at algorithms hence my need for your help.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/51238718
comment on: http://stackoverflow.com/a/28278534
type: Comment
has text: This causes an `e.code = 'MODULE_NOT_FOUND'; throw e; }()));` error. Does not work like this.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44813426
type: Comment
has text: @aarosil he is using $q so he'd have to use `Function#bind` instead.
type: QuestionComment
comment on: http://stackoverflow.com/q/28224896
score: 0

http://stackoverflow.com/comment/44760845
has text: `idx` is just the name for the variable `i`. Its being passed to the self executing function in your `for` loop
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28196978
score: 0

http://stackoverflow.com/a/28158580
has body: This one was tough but I think we managed. Fiddle Okay so to start off we switch from just an array for the characters to an object so we can use key:value pairs. This will come into play. Also instead of creating a selections array we ditch that completely. Each dropdown will provide us with everything we need. Then we create a simple loop to go through each character in the characters array and look at their key and their key's value and see if it matches the sender's value ( obj.value ). getCharacters(this, 'anime') - this being the object and will be how we get obj.value later. anime is our type variable used in the function which is also the key in our key:value pair. Also at the beginning of the function we're doing some resets so when you select something new it will clear the cards and redisplay the proper characters. var ika = { anime: 'anime1', gender: 'female', hair: 'blue', eyes: 'blue', personality: 'genki', age: '&lt;12', data: '&lt;a href="character.html"&gt;&lt;div id="onecard"&gt;&lt;img src="http://cdn.myanimelist.net/images/characters/13/107764.jpg" height="280" width="180"&gt;&lt;div id="description"&gt;Ika Musume&lt;br&gt;Shinryaku! Ika Musume&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;', shown: false }; var hotaru = { anime: "anime2", gender: "female", hair: "brown", eyes: "brown", personality: "other", age: "12-24", data: '&lt;a href="character.html"&gt;&lt;div id="onecard"&gt;&lt;img src="http://cdn.myanimelist.net/images/characters/15/222839.jpg" height="280" width="180"&gt;&lt;div id="description"&gt;Hotaru Ichijou&lt;br&gt;Non Non Biyori&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;', shown: false }; var suguru = { anime: "anime2", gender: "male", hair: "brown", eyes: "black", personaility: "other", age: "12-24", data: '&lt;a href="character.html"&gt;&lt;div id="onecard"&gt;&lt;img src="http://cdn.myanimelist.net/images/characters/3/223393.jpg" height="280" width="180"&gt;&lt;div id="description"&gt;Suguru Koshigaya&lt;br&gt;Non Non Biyori&lt;/div&gt;&lt;/div&g…
answers question: http://stackoverflow.com/q/28157385
has comment: http://stackoverflow.com/comment/44688767
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44688682
type: Answer
accepted answer of: http://stackoverflow.com/q/28157385

http://stackoverflow.com/q/28216298
accepted answer: http://stackoverflow.com/a/28225986
type: Question
has title: Accordion Table Django Template
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28225986
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: django
tagged with: python
has body: I'm trying to have a table populated by objects in a database from a Django model (I have this), then when a row is clicked, to use JS (or JQuery) to accordion a table of objects that are foreign keys to the first object. Thanks in advance; Django Template for the table {% if objects %} Id Name Time Field 1 v Field 2 {% for object in objects %} {{object.object_id}} {{object.name}} {{object.time}} {{object.field1}} v {{object.field2}} {% endfor %} {% else %} No objects! {% endif %} Model class Object(models.Model): object_id = models.IntegerField() name = models.CharField(max_length=50) object_type = models.CharField(max_length=25) time = models.DateTimeField() field1 = models.CharField(max_length=50) field2 = models.CharField(max_length=50) featured = models.BooleanField(default=False) class Child(models.Model): child_id = models.IntegerField() name = models.CharField(max_length=50) description = models.CharField(max_length=200) field11 = models.FloatField() field12 = models.ForeignKey('Object')
type: AnsweredQuestion

http://stackoverflow.com/comment/44920793
score: 0
type: AnswerComment
has text: Excellent it works perfectly fine. Accepting your answer. but one more little question. is there any way to check/uncheck this header checkbox from server side as well? for example if rows in listview are deleted after checking this checkbox, the state of the checkbox should be reset
type: Comment
comment on: http://stackoverflow.com/a/28252827

http://stackoverflow.com/q/28182119
score: 0
answer count: 1
tagged with: javascript
has title: Pickadate seeding one filed from another
has answer: http://stackoverflow.com/a/28269969
type: UnansweredQuestion
has body: I am trying to seed one field from another onChange, almost there but throwing an error when I try and access 'endDate' from within onSet, obviously I don't have access to it from within the function?: var endDate = $('.end-date .datepicker').pickadate({ formatSubmit: 'yyyy-mm-dd' }) // Would like date from here copied over to endDate on change var startDate = $('.start-date .datepicker').pickadate({ formatSubmit: 'yyyy-mm-dd', onSet: function(endDate) { console.log('Want to set endDate to - ' + this.get('select', 'yyyy/mm/dd')); endDate.set('select', this.get('select')); // This line is wrong .. } })
tagged with: pickadate
type: Question

masking
tag name: masking
type: Tag
tags question: http://stackoverflow.com/q/28133726

http://stackoverflow.com/a/28191466
has body: Can you use an object? This is essentially the same as using window as in your found answer, but doesn't unnecessarily pollute the global space with loads of new variables. var obj = {}; var key = 'showItemA'; obj[key] = true; var switchToggle = function (toggleTarget) { obj[toggleTarget] = !obj[toggleTarget]; console.log(obj[toggleTarget]); // false }; switchToggle(key); console.log(obj[key]); // false DEMO
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28191371
answers question: http://stackoverflow.com/q/28191371
has comment: http://stackoverflow.com/comment/44750260
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44750218
type: Answer

http://stackoverflow.com/a/28247431
accepted answer of: http://stackoverflow.com/q/28235246
has body: If the image is from remote server, you can fetch the base64 content in your controller like this: $http.get($scope.user.photo).then(function(response) { $scope.user.data = response.data; }); then display it on view &lt;img data-ng-src="data:image/png;base64,{{user.data}}" data-err-src="images/png/avatar.png"/&gt; While if the image is on local disk/phone, first you can get the image data from FileReader var fileInput = document.getElementById("myfileinput"); // files is a FileList object (similar to NodeList) var files = fileInput.files; $scope.imageSrc = files[0].getAsDataURL(); then bind the $scope.imageSrc to view as &lt;img ng-src="imageSrc" &gt;
has comment: http://stackoverflow.com/comment/44855527
type: Answer
has comment: http://stackoverflow.com/comment/44856446
has comment: http://stackoverflow.com/comment/44856341
answers question: http://stackoverflow.com/q/28235246
has comment: http://stackoverflow.com/comment/44855511
has comment: http://stackoverflow.com/comment/64091875
type: AcceptedAnswer
score: 60
downvote count: 0
upvote count: 60
has comment: http://stackoverflow.com/comment/44855542
has comment: http://stackoverflow.com/comment/44855673

http://stackoverflow.com/q/28258386
has answer: http://stackoverflow.com/a/28281505
accepted answer: http://stackoverflow.com/a/28281505
has title: How to distribute a library which uses Closure-library without including any of the actual Closure-library source?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44875069
type: Question
has comment: http://stackoverflow.com/comment/44875284
tagged with: google-closure-compiler
has body: I've recently created a JavaScript library using Google's Closure Compiler: https://github.com/bvaughn/task-runner I intend for this library to be used by applications that also require the full Closure Library, and so I want the built version of my library (Task Runner) not to include a subset of Closure Library. If Task Runner includes a subset of Closure Library, and another application includes the full Closure Library, a race condition will exist between which loads Closure last (last in wins). It also bloats the size of the Task Runner file. However I'm having trouble. If I don't require any of the Closure library classes, Task Runner builds fine (obviously). However if I require something (goog.dom for instance) then my "compiled" JavaScript file also includes a portion of the Closure library. Is there a way to tell the Closure Compiler to leave certain JavaScript files/modules/whatever out of the built result? FWIW, the Plovr experimental-exclude-closure-library option seems to somewhat describe the functionality I'm looking for.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44876426
has comment: http://stackoverflow.com/comment/44896203
answer count: 1
tagged with: google-closure-library
has comment: http://stackoverflow.com/comment/44875357

http://stackoverflow.com/q/28205649
favorite count: 0
score: 8
has answer: http://stackoverflow.com/a/55174804
has answer: http://stackoverflow.com/a/28205842
possible better answer: http://stackoverflow.com/a/43241752
tagged with: asp.net-mvc-5.2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/43241752
has answer: http://stackoverflow.com/a/40124340
accepted answer: http://stackoverflow.com/a/28205842
has title: ReactJS.NET MVC tutorial doesn't work?
type: Question
has body: I'm trying to setup a new project in Visual Studio that is going to be MVC 5 with a single page app written in ReactJS. So I followed the guide on the ReactJS website. I got to the very first part where you run the project, and I got a syntax error because of the JSX (the browser seemed to want to interpret it as vanilla JavaScript which makes perfect sense). So I added type="text/jsx" to the script tag. In total, my HTML/JSX looks like this: HTML output by Razor view Hello React Tutorial.jsx var CommentBox = React.createClass({ render: function() { return ( Hello, world! I am a CommentBox. ); } }); React.render( <CommentBox />, document.getElementById('content') ); I don't understand - what have I done wrong? I've followed the tutorial to the letter aside from adding type="text/jsx" to the script tag. I'm assuming something needs to be included to handle transforming the JSX into vanilla JS, but the tutorial doesn't seem to mention this. I'm not getting any errors at all in the Chrome Developer Tools console.
tagged with: reactjs.net
tagged with: reactjs
downvote count: 0
tagged with: javascript
upvote count: 8
answer count: 4

http://stackoverflow.com/q/28229691
favorite count: 0
has title: How can I control what is rendered by json?
accepted answer: http://stackoverflow.com/a/28231441
has body: I'm using Typeahead to display a drop-down list of suggestions: Controller: def typeahead render json: User.where(name: params[:query]) end View: &lt;input type="text" id="typeahead"&gt; &lt;script type="text/javascript"&gt; var bloodhound = new Bloodhound({ datumTokenizer: function (d) { return Bloodhound.tokenizers.whitespace(d.value); }, queryTokenizer: Bloodhound.tokenizers.whitespace, remote: '/typeahead/%QUERY', limit: 50 }); bloodhound.initialize(); $('#typeahead').typeahead(null, { displayKey: 'name', source: bloodhound.ttAdapter() }); $('#typeahead').bind('typeahead:selected', function(event, datum, name) { doSomething(datum.id); }); &lt;/script&gt; And it displays a list of User.names. How could I render, say, a User.email for every User?
possible better answer: http://stackoverflow.com/a/28231196
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28231196
tagged with: rendering
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
tagged with: ruby-on-rails
type: Question
has answer: http://stackoverflow.com/a/28231441
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/44873670
type: AnswerComment
type: Comment
has text: Well, i have put sucsessfully wedged these operations into my code, and this method indeed seems to work! :) however, just a slight problem, for some reason i am having a hard time injecting my own subsitutions in replace of the `toUpperCase` logic you provided; is it possible you could give an example of how a logic like "sl" or "ls" = "s" would fit in this method?
comment on: http://stackoverflow.com/a/28248339
score: 0

http://stackoverflow.com/q/28180055
has comment: http://stackoverflow.com/comment/44729230
tagged with: javascript
score: 0
tagged with: jquery-events
has body: Is there a way where I can do something like this? Disable all onclick events for this type of button on default: $('.btn').off('onclick'); Cache the elements function: var clickEvent = $('.btn').prop('onclick'); Reuse the function: if(form == valid()) { //run cached function in var from onclick } Submit button that has Google Event Tracking code within the onclick attribute. Submit
answer count: 1
has title: Disable Contents of onClick function and reuse later?
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28180105
type: Question

http://stackoverflow.com/q/28216270
score: 13
has comment: http://stackoverflow.com/comment/44801088
has comment: http://stackoverflow.com/comment/44831449
has comment: http://stackoverflow.com/comment/44800929
has title: How to bind array elements by id with dom class elements in directive?
favorite count: 0
linked to: http://stackoverflow.com/q/18149214
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29089964
upvote count: 16
has comment: http://stackoverflow.com/comment/44911341
downvote count: 3
linked to: http://stackoverflow.com/q/11408668
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/44800575
tagged with: javascript
has body: I'm trying to bind a page_elements array with appropriate .grid-cell index in string html, so that it would be displayed on the page instead within my directive. I store indexes of given cell elements and then filter them to retrieve matching page_elements objects. However, I can't rid of the redundancy of ng-repeat in grid where is more then one element. A removed element is replaced with an empty object {}, but it should be spliced in order to keep grid elements in right places. Moved elements should be able to drop into other grid cells. If indexes would be properly assigned then directive should work with angular-drag-and-drop-lists, how to fix it? How can I display ng-repeat with matched page_elements only once in given grid? e.g. now page_elements where grid_id: 2 is displayed three times in ng-repeat in third grid. How to remove permanently page element object and keep cell elements in right places? Also Drag&Drop mechanism is broken in current solution. Current code snippet and jsfidde: var app = angular.module('app', ['dndLists']); app.controller('homeCtrl', function ($scope) { $scope.html_string = " "; $scope.page_elements = [{ "grid_id": 0, "position": 0, "snippet": " First Grid 0 ", "template": "snippet" }, { "grid_id": 0, "position": 1, "snippet": " Second Grid 0 ", "template": "snippet" }, { "grid_id": 1, "position": 0, "snippet": " First Grid 1 ", "template": "snippet" }, { "grid_id": 1, "position": 1, "snippet": " Second Grid 1 ", "template": "snippet" }, { "grid_id": 2, "position": 0, "snippet": " First Grid 2 ", "template": "snippet" }, { "grid_id": 2, "position": 1, "snippet": " Second Grid 0 ", "template": "snippet" }, { "grid_id": 2, "position": 2, "snippet": " Third Grid 0 ", "template": "snippet" }, { "grid_id": 5, "position": 0, "snippet": " Before Last ", "template": "snippet" }, { "grid_id": 5, "position": 1, "snippet": " Last ", "template": "snippet" }]; $scope.page_elements_pretty = angular.toJson($scope.page_elements, true); $scope.rmEle…

http://stackoverflow.com/a/28187095
has body: You never call the callback. You should have ScrapePage accept a second parameter: function ScrapePage(webpage, callback) {} And then call that callback once it has finished doing whatever work it needs to, passing in the error and result: function ScrapePage(webpage, callback) { doSomethingAsync(function (err, result) { if (err) { return callback(err, null); } callback(null, result); }); }
answers question: http://stackoverflow.com/q/28187011
score: 0
type: Answer

http://stackoverflow.com/comment/44759653
has text: Yes, you'd need to delay the select until the `ng-model` value is compiled and linked. Updated the answer
comment on: http://stackoverflow.com/a/28195723
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28240085
has answer: http://stackoverflow.com/a/28240122
type: Question
answer count: 1
has body: Is it bad practice, in javascript, to assign a function as a property of a function that can also ne used as a class. A simple example will talk for itself: function MyClass() { this.myVar = 1; } MyClass.prototype.printMyVar = function() { MyClass.printerUtil(this.myVar); }; MyClass.printerUtil = function(text) { console.log(text); }; In this example, should MyClass.printerUtil be declared in its own container (MyUtils.printerUtil) or is it OK to do it like that ? Do you know any relevand documentation/article I could read ?
downvote count: 0
has title: Assigning functions as properties of a prototyped function
favorite count: 0
score: 2
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44852665
tagged with: javascript

http://stackoverflow.com/q/28121870
score: 0
accepted answer: http://stackoverflow.com/a/28123106
answer count: 1
has body: I have data coming in from a form, posting to /submit. My route looks like this: var submission = require('../models/submission'); router.post('/submit', function(req,res){ var ObjectId = require('mongoose').Types.ObjectId; var formObjId = new ObjectId(req.body.formId); var data = new submission({ formId: formObjId, fields: req.body.fields, }); data.save(function (err) { if (!err) { //NO ERROR } else { return console.log(err); } }); res.end("Successful submission!"); }); and my submissions model: var mongoose = require('mongoose'); module.exports = mongoose.model('Submission',{ createdAt: {type: Date, default: Date.now}, formId: [], sourceId: [], fields: [], }); The first part is where I'm trying to cast the string into an object id. At the save, nothing shows up as an error, although the two fields that I'm trying to save don't save with the object. The object is saved in the database with a createdAt and object id attribute. The others are blank. Am I doing something wrong to keep the attributes from saving with the rest of the object?
tagged with: node.js
type: AnsweredQuestion
has title: Mongoose data wont save new instance of model
has answer: http://stackoverflow.com/a/28123106
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44617958
tagged with: mongoose
tagged with: javascript

http://stackoverflow.com/comment/44780266
type: QuestionComment
has text: Are any of the elements hidden? Here is a fiddle that works fine: http://jsfiddle.net/rcv0j7uL/1/
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28207469

http://stackoverflow.com/comment/44787290
has text: You put this into a ul - li tag... when you get it out of it, simply copy/paste, it works...
score: 0
comment on: http://stackoverflow.com/q/28211478
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44864086
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28252347
has text: how exactly are u triggering the `validate()` ? are you clicking on `submit` button ?
score: 0

http://stackoverflow.com/a/28180550
upvote count: 1
has body: You need to return the promise generated by AuthSvc.isLoggedIn().then(...). The $stateProvider will wait for it to resolve and inject the result as the user parameter. resolve: { user : function(AuthSvc){ // return the promise return AuthSvc.isLoggedIn() .then( function(res){ return res; }, function(res){ return res; }); } } /... }
accepted answer of: http://stackoverflow.com/q/28180470
answers question: http://stackoverflow.com/q/28180470
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44734419
type: Answer
score: 1

http://stackoverflow.com/comment/67366032
has text: @nikhil moment("30/02/2016", "DD/MM/YYYY", true) return false. Read carefully the answer: you need to pass also the date format.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30240547
type: AnswerComment

http://stackoverflow.com/comment/44787320
type: AnswerComment
comment on: http://stackoverflow.com/a/28211463
type: Comment
has text: Yep, that did the tricks. Thank you, been struggling with this forever, haha. So if I understand correctly, you cannot use Javascript methods on JQuery selected objects?
score: 0

label
tags question: http://stackoverflow.com/q/28167223
tags question: http://stackoverflow.com/q/28180544
tags question: http://stackoverflow.com/q/28169982
tags question: http://stackoverflow.com/q/28125165
tag name: label
tags question: http://stackoverflow.com/q/28199173
type: Tag

http://stackoverflow.com/q/28265899
type: Question
has answer: http://stackoverflow.com/a/28265931
tagged with: javascript
has answer: http://stackoverflow.com/a/28265952
accepted answer: http://stackoverflow.com/a/28265952
has body: I am using following code to redirect header('Location: '.$fileID.'php'); } else if (!isset($_SESSION['login'])) echo ' you need to register first. ' ; ?> $fileID has a value bacuse I am using this value in other part of code and that works fine. I also tried echo ' '; but got a notfound error. I would like to get it working by any of these methods but would prefer the header method. Any help is appreciated.
score: 0
answer count: 2
has title: PHP redirect header is not redirecting?
tagged with: header
tagged with: http-redirect
possible better answer: http://stackoverflow.com/a/28265931
tagged with: php
has comment: http://stackoverflow.com/comment/44888242
has comment: http://stackoverflow.com/comment/44888245
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44888222
tagged with: authentication

audiocontext
type: Tag
tags question: http://stackoverflow.com/q/28181346
tag name: audiocontext

http://stackoverflow.com/q/28164666
has answer: http://stackoverflow.com/a/28165029
possible better answer: http://stackoverflow.com/a/28165275
has body: Fiddle Example I have an array generated by nest method in d3.js Can anyone suggest a javascript/jQuery way of grouping the objects in the values property by category? var data = [ { "key": "0", "values": [ { "category": "phone", "brand": "Sony", "brand_id": "0", "name": "item A", "id": "551", "point": "600" }, { "category": "software", "brand": "Sony", "brand_id": "0", "name": "item D", "id": "51", "point": "800" }, { "category": "phone", "brand": "Sony", "brand_id": "0", "name": "item E", "id": "52", "point": "1800" } ] }, { "key": "0", "values": [ { "category": "software", "brand": "Microsoft", "brand_id": "1", "name": "item B", "id": "54", "point": "800" }, { "category": "phone", "brand": "Microsoft", "brand_id": "1", "name": "item B", "id": "60", "point": "200" }, { "category": "phone", "brand": "Microsoft", "brand_id": "1", "name": "item T", "id": "30", "point": "600" }, { "category": "software", "brand": "Microsoft", "brand_id": "1", "name": "item N", "id": "90", "point": "500" } ] } ]; Here's a desired result: [ { "key": "0", "values": [ { "phone": [ { "category": "phone", "brand": "Sony", "brand_id": "0", "name": "item A", "id": "551", "point": "600" }, { "category": "phone", "brand": "Sony", "brand_id": "0", "name": "item E", "id": "52", "point": "1800" } ], "software": [ { "category": "software", "brand": "Sony", "brand_id": "0", "name": "item D", "id": "51", "point": "800" } ] } ] }, { "key": "0", "values": [ { "phone": [ { "category": "phone", "brand": "Microsoft", "brand_id": "0", "name": "item B", "id": "80", "point": "54" }, { "category": "phone", "brand": "Microsoft", "brand_id": "0", "name": "item D", "id": "52", "point": "1800" } ], "software": [ { "category": "software", "brand": "Microsoft", "brand_id": "0", "name": "item G", "id": "41", "point": "800" }, { "category": "software", "brand": "Microsoft", "brand_id": "0", "name": "item L", "id": "42", "point": "900" } ] } ] } ] The following code doesn't work. I guess it's because grouped[t.categor…
has answer: http://stackoverflow.com/a/28165275
answer count: 4
has title: Grouping a nested array
tagged with: javascript
has answer: http://stackoverflow.com/a/28164833
tagged with: jquery
has answer: http://stackoverflow.com/a/28165675
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/28164833

http://stackoverflow.com/q/28127965
tagged with: steroids
has title: How to set background color in AppGyver Supersonic?
has body: I am unable to find any documentation about how to change the "real" background color in an AppGyver Supersonic app. I can set the color of body element with CSS but user can still see the default white in the bounce effect when dragging the screen up or down (in iOS). Same is for the list component background color, is there some way to change it? Setting background-color for the list div element does nothing.
accepted answer: http://stackoverflow.com/a/28147538
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28147538
tagged with: css
type: AnsweredQuestion
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44675761
comment on: http://stackoverflow.com/a/28152240
score: 0
type: AnswerComment
has text: This would be true if there were a variable name after `var`, as it is, you get a syntax error
type: Comment

http://stackoverflow.com/a/28161184
type: Answer
upvote count: 2
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28161020
has body: I've found a work-around for this problem. In the scripts block, I use the test script to call the npm command for lint with the --silent flag: "scripts": { "start": "node ./src/server/index.js", "test": "npm run-script --silent lint", "lint": "eslint index.js"} Then on the command-line I can type: npm run test Now it's working without showing the error log.

http://stackoverflow.com/a/28249085
score: 0
answers question: http://stackoverflow.com/q/28248981
has body: using header("Location:..."); can only do redirects. As far as I know, you'll have to do some amount of javascript or html to achieve your goal. Another problem is that browsers like to block automatically opened popups because 99% of the time automatic popups are used only by spammers. However, I'll show you a way to attempt to do this anyways: <?php $usingTwitter=0; ob_start(); session_start(); if (isset($_SESSION['id'])) { header("location: u_tasks.php"); } if (array_key_exists("login", $_GET)) { $oauth_provider = $_GET['oauth_provider']; if ($oauth_provider == 'twitter') { $usingTwitter=1; } } ?> <?php if($usingTwitter){ echo "window.open('login-twitter.php');"; } ?> <? echo " "; echo " Go To Twitter "; echo " "; ?> Make sure you turn off popup blocking in your browser for this to work though!
type: Answer

http://stackoverflow.com/q/28140105
type: Question
has comment: http://stackoverflow.com/comment/44651885
score: 1
tagged with: mysql
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: The database-dependent portion of my login function isn't working. Can anyone show me what I'm doing wrong? Is it an installation error, am I not connecting to the server properly, or is it a syntax problem? I haven't written the php form yet; I wanted to have code for each of the possible login errors first. The node.js (without database-specific information) $ export MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config $ npm install db-mysql var mysql = require('db-mysql'); new mysql.Database({ hostname: 'localhost', user: 'user', password: 'password', database: 'test' }).connect(function(error) { if (error) { document.getElementById('fail').innerHTML='CONNECTION error: ' + error } this.query('SELECT `password` FROM `login` WHERE `email` LIKE \'' + document.getElementById('email').value + '\''). execute(function(error, rows, cols) { if (error) { document.getElementById('fail').innerHTML='ERROR: ' + error return; } else if (rows.length !== 0) { document.getElementById('fail').innerHTML="This email is already registered to an account" } else if (rows == document.getElementById('password').value) { document.getElementById('fail').innerHTML="The password you have entered is incorrect" } else { window.location = "profile.html"; } }); }); The simple version of the HTML
tagged with: node.js
answer count: 0
type: UnansweredQuestion
has title: How is a password check structured in node.js?
upvote count: 1

http://stackoverflow.com/comment/44822210
score: 0
comment on: http://stackoverflow.com/q/28210789
type: QuestionComment
type: Comment
has text: I can't really review the entire svgjs library with you, but the stop() function calls `this.animate(0)` which sets the variable `d` to zero which eventually sets `start` equal to `finish` which terminates the animation. BTW, it's not unusual to let an rAF loop run forever. As long as the loop does no work it's relatively harmless.

http://stackoverflow.com/a/75862209
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28140705
has body: try this code Open this image for the code in your javascript $('.select2-search__field').addClass('w-100') or $('.select2-search__field').css('width', '100%')

http://stackoverflow.com/q/28129202
downvote count: 0
answer count: 1
tagged with: vendor-prefix
favorite count: 0
has comment: http://stackoverflow.com/comment/44636847
has answer: http://stackoverflow.com/a/32250911
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
upvote count: 1
has body: I'm dynamically loading an iframe with some code to execute within - it's a code playground with codemirror instance under it. One of the pieces of code that executes inside of iframe is the prefixfree.min.js from Lea Verou. On load / unload of the iframe I get the following error: TypeError: i is null ...;u(s)&amp;&amp;t.indexOf(s)===-1&amp;&amp;t.push(s)}}},u=function(e){return StyleFix.camelCase(e... prefixfree.min.js (line 5, col 3756) TypeError: e.fixers is undefined ...,0,t)},fix:function(t,n,r){for(var i=0;i&lt;e.fixers.length;i++)t=e.fixers[i](t,n,r... What does this error mean?
type: Question
tagged with: javascript
has title: TypeError: e.fixers is undefined error for prefixfree on dynamically loaded iframes
has comment: http://stackoverflow.com/comment/44632714
tagged with: prefixfree

http://stackoverflow.com/comment/44830643
comment on: http://stackoverflow.com/q/28234381
has text: Hi, what version of IE are you using?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44619560
score: 0
comment on: http://stackoverflow.com/q/28122869
type: Comment
type: QuestionComment
has text: sorry if the html appear like that, i hope you can directly check the jsfiddle, thanks

http://stackoverflow.com/a/28235487
has comment: http://stackoverflow.com/comment/44838013
has comment: http://stackoverflow.com/comment/44835432
accepted answer of: http://stackoverflow.com/q/28235300
score: 2
has comment: http://stackoverflow.com/comment/44834297
upvote count: 2
has comment: http://stackoverflow.com/comment/44838053
has body: That is a multi-dimensional array and you have not initialized the first dimension array correctly. In the while loop you have to initialize the first dimension to be able to access a second dimension element with an index: while (topTileX &gt; -1) { if (tileArray[col] == null) tileArray[col] = []; tileArray[col][row] = new DiamondTile(topTileX, topTileY, tileWidth, true, col, row); tileArray[col][row].draw(); // omitted other code for brevity } Javascript arrays are dynamic and it's enough to initialize the first dimension array elements in this case. You don't have to initialize the individual items in the second dimension. Update: here is a fiddle with working code http://jsfiddle.net/0qbq0fts/2/ In addition your semantics is wrong. By the book, the first dimension of a 2-dimensional array should be rows, and the second dimension should be columns.
has comment: http://stackoverflow.com/comment/44837747
has comment: http://stackoverflow.com/comment/44837871
has comment: http://stackoverflow.com/comment/44835312
has comment: http://stackoverflow.com/comment/44837947
has comment: http://stackoverflow.com/comment/44836548
answers question: http://stackoverflow.com/q/28235300
has comment: http://stackoverflow.com/comment/44833480
has comment: http://stackoverflow.com/comment/44838318
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44834168
type: Answer

http://stackoverflow.com/a/28268882
score: -1
type: Answer
has comment: http://stackoverflow.com/comment/44893925
downvote count: 2
upvote count: 1
has body: try this with Jquery: //use for loop to loop over your images for(var i=20;i&gt;10;i--){ $('.image').append( '&lt;img src="images/'+i+'.jpg" alt='+i+'!" width="90" height="125" border="0"&gt;' );//get the item with class "image" and appended your images }
has comment: http://stackoverflow.com/comment/44893976
has comment: http://stackoverflow.com/comment/44893955
answers question: http://stackoverflow.com/q/28268826
has comment: http://stackoverflow.com/comment/44893989
has comment: http://stackoverflow.com/comment/44893959
has comment: http://stackoverflow.com/comment/44893931

http://stackoverflow.com/comment/44846819
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28243023
type: AnswerComment
has text: The number of times `$('#testdiv')` is queried w/ $ is pretty redundant here; would be better to alias it once and ref it from there. Or, better yet, not have to use jquery :)

http://stackoverflow.com/comment/44830370
score: 0
type: Comment
type: QuestionComment
has text: Add a new element... some ` ` .
comment on: http://stackoverflow.com/q/28232582

http://stackoverflow.com/q/28149950
has answer: http://stackoverflow.com/a/28153570
has comment: http://stackoverflow.com/comment/44671511
has body: I have a script that animates my menu ul element on hover. It also creates a background element for the ul. I have made this script: jQuery(document).ready(function($) { $(".main-navigation ul:first &gt; li").hoverIntent({ sensitivity: 1, interval: 100, timeout: 400, over: function() { if ($(this).children().length &gt; 1) { $(this).parent().prepend('&lt;div class="sub-nav" style="position: absolute; top: 0px; left: 250px; display: block; opacity: 1;"&gt;&lt;/div&gt;'); $(this).children("ul").css({ "display" : "block", "left" : "250px", }).stop().animate({ top: '-50px', opacity: 1, }, 500) }}, out: function() { $(".sub-nav").remove(); $(this).children("ul").stop().animate({ "top" : "-500px", "opacity": 0, }, 500).css({ "display" : "none", }) } }) }); It works fine, but the problem occurs once I select another menu that is below that one. So, I have two menus with sub-menus. If I select separetly each one of them everything works fine, but if I select first one and then move to the other one the background elements (.sub-nav) doesn't appear. What am I missing? JS FIDDLE: http://jsfiddle.net/r8vx07ae/10/ (try moving your mouse from menu item#2 to menu-item#3)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44671556
has comment: http://stackoverflow.com/comment/44673438
type: Question
has comment: http://stackoverflow.com/comment/44672344
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28153570
has title: jQuery hoverintent creating and removing element
has comment: http://stackoverflow.com/comment/44672748
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44673305
tagged with: css

http://stackoverflow.com/q/28199109
type: Question
tagged with: asp-classic
has comment: http://stackoverflow.com/comment/44764606
has comment: http://stackoverflow.com/comment/44832669
tagged with: javascript
has comment: http://stackoverflow.com/comment/44800223
score: 0
has body: I need help to understand if this is possible and how can I do it. I Have two asp files, one with the page layout the visible part (default.asp) and the other with the queries (process.asp). In the default.asp I have a table that is populated with information form a query on process.asp. For that to work as soon as you open the page I have the: at the beginning. I want to order the table with a click on the column name, so I'm using: Number on the default.asp. How can I pass the information to process.asp to use in the ORDER BY '" & Request.QueryString("ord")ASC"' Is this possible. I'm no developer so sorry if its a dumb question.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28218621
accepted answer: http://stackoverflow.com/a/28218621
has comment: http://stackoverflow.com/comment/44764684
has comment: http://stackoverflow.com/comment/44788101
type: AnsweredQuestion
has title: ASP Order By Multifile query

crossrider
tags question: http://stackoverflow.com/q/28123968
type: Tag
tag name: crossrider

http://stackoverflow.com/comment/83167135
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28267784
has text: This code doesn't work now. You have to add `return config` from the request interceptor to make it work.
score: 0

http://stackoverflow.com/comment/44690912
comment on: http://stackoverflow.com/q/28159711
score: 0
has text: Yes, but does it go through the loading and interactive states?
type: Comment
type: QuestionComment

gridview
tags question: http://stackoverflow.com/q/28155906
tag name: gridview
tags question: http://stackoverflow.com/q/28268155
tags question: http://stackoverflow.com/q/28265349
type: Tag
tags question: http://stackoverflow.com/q/28168268
tags question: http://stackoverflow.com/q/28275139

http://stackoverflow.com/q/28260707
upvote count: 3
type: Question
has body: Trying to teach myself JavaScript with a Tarot card program I plan on building on as I learn. Right now I am trying to figure out how to change the image of a card from back to face when a user clicks on it, and I'm trying to do it all in JavaScript. So far I've figured out how to change the img src with the card idea, but it only changes the first one. Is there a way to do this without having to write a separate function for each card? Or without using unique ids? I've been researching for hours. I'm stuck. &lt;p align="center"&gt; &lt;img id="card" onclick="someFunc()" src="img-tarot-card-back-001.jpg"&gt; &lt;img id="card" onclick="someFunc()" src="img-tarot-card-back-001.jpg"&gt; &lt;img id="card" onclick="someFunc()" src="img-tarot-card-back-001.jpg"&gt; &lt;img id="card" onclick="someFunc()" src="img-tarot-card-back-001.jpg"&gt; &lt;img id="card" onclick="someFunc()" src="img-tarot-card-back-001.jpg"&gt; &lt;/p&gt; &lt;script&gt; function someFunc() { document.getElementById('card').src="img-tarot-card-front-001.jpg"; } &lt;/script&gt;
answer count: 2
downvote count: 0
has title: Learning JavaScript: Is there a way to change the image file of a group of images without using individual ids?
tagged with: javascript
has answer: http://stackoverflow.com/a/28260757
favorite count: 0
has comment: http://stackoverflow.com/comment/44878748
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44878676
score: 3
has answer: http://stackoverflow.com/a/69966878

http://stackoverflow.com/comment/44647239
has text: @damluar: `this` is the function **within the call to `lazy`**. But your `lazy` function is returning a different function; `this` during the call to the other function will be whatever jQuery calls it with.
type: Comment
comment on: http://stackoverflow.com/a/28136618
score: 0
type: AnswerComment

http://stackoverflow.com/q/28144433
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a progress bar and a button click. Now the progress bar is not linked with the button. so how can I ensure: when the button clicks,then the progress bar starts; when the result is retrieved from the server, then the progress bar stops? Could some body help? I want to try to have some hidden field as flag to notify progress bar, but have not got time to try it yet. HTML button is here: Send Progress bar is using Progress bar is here: // Bind normal buttons Ladda.bind( 'section:not(.progress-demo) button', { timeout: 2500 } ); //Ladda.bind( 'input[type=submit]' ); // Bind progress buttons and simulate loading progress Ladda.bind( 'section.progress-demo button', { callback: function( instance ) { var progress = 0; var interval = setInterval( function() { progress = Math.min( progress + Math.random() * 0.1, 1 ); instance.setProgress( progress ); if( progress === 1 ) { instance.stop(); clearInterval( interval ); } }, 200 ); } } ); Button click funtion is here. function SendRequest(i){ alert("button clicked!"); //call post to get server response ... say 1s to get response //how to bind it to progress bar when server response is back?? }
type: Question
tagged with: javascript
tagged with: progress-bar
score: 0
has title: How to bind progress bar (use Ladda) with a button after button clicks in HTML?
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28146490
type: UnansweredQuestion

http://stackoverflow.com/q/28160861
accepted answer: http://stackoverflow.com/a/28227476
tagged with: javascript
has answer: http://stackoverflow.com/a/28227476
score: 0
has comment: http://stackoverflow.com/comment/44695242
answer count: 1
has title: Ionic Directive elements not invoking functions (binding) on changes
tagged with: angularjs
has body: I started my project using the Ionic Side Menu Starter. I'm trying to get a Rating directive/control to work, from here: https://github.com/fraserxu/ionic-rating The module is loaded, and the template objects (the stars) render OK. Binding -from- my model/scope works one-time. But, clicking on the stars does nothing. Some of the js does get invoked: ng-mouseleave="reset()" is hooked up to the parent element and does get invoked. But ng-click="rate($index + 1)" is attached to the that contains the star, and does not (I set breakpoints). I suspect it may have something to do with the child scopes that are created based on the starter, but don't know. &lt;rating ng-model="review.rating" max="5"&gt;&lt;/rating&gt; And my controller: angular.module('myapp.controllers').controller('NewReviewCtrl', function($scope, $stateParams) { $scope.review = {}; $scope.review.rating = 3; }); The module is loaded in a separate file: angular.module('myapp.controllers', ['ionic.rating']).controller('AppCtrl', function($scope, $ionicModal, $timeout) { ...
type: AnsweredQuestion
tagged with: ionic-framework
type: Question

http://stackoverflow.com/a/28184641
has comment: http://stackoverflow.com/comment/44738768
has body: It looks like you are copying the breeze location entity's property values into an pojo object variable named "basicLocationSettings". Any changes to basicLocationSettings will not be tracked by the breeze entity manager or reflected in the source breeze entity. You'll need to bind the actual breeze entity to your UI so that user data entry modifies the entity property values directly.
has comment: http://stackoverflow.com/comment/44739295
upvote count: 1
answers question: http://stackoverflow.com/q/28149229
has comment: http://stackoverflow.com/comment/44739052
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44759898
has text: @bhspencer - The id (newid) isn't incrementing.
type: QuestionComment
comment on: http://stackoverflow.com/q/28196602
score: 0
type: Comment

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/28219274
tags question: http://stackoverflow.com/q/28268896
tags question: http://stackoverflow.com/q/28132732
tags question: http://stackoverflow.com/q/28240806
tags question: http://stackoverflow.com/q/28176762
tags question: http://stackoverflow.com/q/28167379
tags question: http://stackoverflow.com/q/28191305
tags question: http://stackoverflow.com/q/28133245
tags question: http://stackoverflow.com/q/28244895
tags question: http://stackoverflow.com/q/28189519
tags question: http://stackoverflow.com/q/28244473
tags question: http://stackoverflow.com/q/28263735
tags question: http://stackoverflow.com/q/28216995
tags question: http://stackoverflow.com/q/28204600
tags question: http://stackoverflow.com/q/28273823
tags question: http://stackoverflow.com/q/28232495
tags question: http://stackoverflow.com/q/28142646
tags question: http://stackoverflow.com/q/28125047
tags question: http://stackoverflow.com/q/28174609
tags question: http://stackoverflow.com/q/28209509
tags question: http://stackoverflow.com/q/28267275
tags question: http://stackoverflow.com/q/28178263
tags question: http://stackoverflow.com/q/28138675
tags question: http://stackoverflow.com/q/28128024
tags question: http://stackoverflow.com/q/28237370
tags question: http://stackoverflow.com/q/28269366
tags question: http://stackoverflow.com/q/28270302
tags question: http://stackoverflow.com/q/28275762
tags question: http://stackoverflow.com/q/28201147
tags question: http://stackoverflow.com/q/28261727
tags question: http://stackoverflow.com/q/28213845
tags question: http://stackoverflow.com/q/28143151
tags question: http://stackoverflow.com/q/28242420
tags question: http://stackoverflow.com/q/28236128
tags question: http://stackoverflow.com/q/28159243
tags question: http://stackoverflow.com/q/28192072
tags question: http://stackoverflow.com/q/28270123
tags question: http://stackoverflow.com/q/28201623
tags question: http://stackoverflow.com/q/28197946
tags question: http://stackoverflow.com/q/28263868
tags question: http://stackoverflow.com/q/28150789
tags question: http://stackoverflow.com/q/28232747
tags question: http://stackoverflow.com/q/28260982
tags question: http://stackoverflow.com/q/28271324
tags question: http://stackoverflow.com/q/28213795
tags question: http://stackoverflow.com/q/28272587
tags question: http://stackoverflow.com/q/28192721
tags question: http://stackoverflow.com/q/28264389
tags question: http://stackoverflow.com/q/28253288
tags question: http://stackoverflow.com/q/28205915
tags question: http://stackoverflow.com/q/28139206
tags question: http://stackoverflow.com/q/28273029
tags question: http://stackoverflow.com/q/28167869
tags question: http://stackoverflow.com/q/28146312
tags question: http://stackoverflow.com/q/28142709
tags question: http://stackoverflow.com/q/28214685
tags question: http://stackoverflow.com/q/28186871
tags question: http://stackoverflow.com/q/28277061
tags question: http://stackoverflow.com/q/28122118
tags question: http://stackoverflow.com/q/28178532
tags question: http://stackoverflow.com/q/28155346
tags question: http://stackoverflow.com/q/28277347
tags question: http://stackoverflow.com/q/28139282
tags question: http://stackoverflow.com/q/28220655
tags question: http://stackoverflow.com/q/28218250
tags question: http://stackoverflow.com/q/28258826
tags question: http://stackoverflow.com/q/28132044
tags question: http://stackoverflow.com/q/28245586
tags question: http://stackoverflow.com/q/28279198
tags question: http://stackoverflow.com/q/28145699
tags question: http://stackoverflow.com/q/28177549
tags question: http://stackoverflow.com/q/28214253
tags question: http://stackoverflow.com/q/28259182
tags question: http://stackoverflow.com/q/28180886
tags question: http://stackoverflow.com/q/28160031
tags question: http://stackoverflow.com/q/28154220
tags question: http://stackoverflow.com/q/28263221
tags question: http://stackoverflow.com/q/28177748
tags question: http://stackoverflow.com/q/28234599
tags question: http://stackoverflow.com/q/28211926

http://stackoverflow.com/q/28233562
favorite count: 0
has body: In SharePoint 2013 JavaScript, I want to load all items from a list, that have been modified by the current user. I tried this: var ctx = SP.ClientContext.get_current(); var settings = ctx.get_web().get_lists().getByTitle('My Setting List'); var settingQuery = new SP.CamlQuery(); settingQuery.set_viewXml('&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name="Editor" LookupId="TRUE" /&gt;&lt;Value Type="Integer"&gt;&lt;UserID /&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;'); var settingItems = settings.getItems(settingQuery); ctx.load(settingItems, 'Include(Id, Title)'); ctx.executeQueryAsync( /* ... */ ); But it gives me all the items from all users. What did I do wrong?
accepted answer: http://stackoverflow.com/a/28235663
tagged with: sharepoint-2013
tagged with: csom
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28235663
type: Question
answer count: 1
downvote count: 0
has title: Get items, changed by current user, via JSOM
tagged with: javascript
upvote count: 1

http://stackoverflow.com/q/28212681
possible better answer: http://stackoverflow.com/a/28212779
has comment: http://stackoverflow.com/comment/44789296
has title: How to handle JSON data?
tagged with: http://stackoverflow.com/tag/json
answer count: 3
upvote count: 1
tagged with: object
tagged with: arrays
has answer: http://stackoverflow.com/a/28212868
downvote count: 5
tagged with: javascript
score: -4
has comment: http://stackoverflow.com/comment/44789158
has comment: http://stackoverflow.com/comment/44790488
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28212782
has answer: http://stackoverflow.com/a/28212779
favorite count: 0
has body: Ok, so I have a data from JSON. The structure of this data looks like this: As you can see this data contains an array with name, type and value. What I need to do is to convert is somehow to use this function: https://developers.google.com/chart/interactive/docs/reference#google.visualization.arraytodatatable This function need the data to be given in this format: ['Country', 'Population', 'Area'], ['CN', 1324, 9640821], ['IN', 1133, 3287263], ['US', 304, 9629091], ['ID', 232, 1904569], ['BR', 187, 8514877] So in my case would be: [name, type, value] data iself Any help?
type: Question
accepted answer: http://stackoverflow.com/a/28212782

http://stackoverflow.com/comment/44737017
has text: As this question is related to you previous one you should mention that [Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined](https://stackoverflow.com/questions/28177917). And you should really correct the indenting of your code using some tidy tool.
type: QuestionComment
comment on: http://stackoverflow.com/q/28183935
score: 0
type: Comment

http://stackoverflow.com/comment/44814499
has text: Please look at the changes to my answer
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28224122

http://stackoverflow.com/comment/44769573
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28201147
score: 0
has text: That'd be unfortunate.. I'll see what replies pour in. Thank you

http://stackoverflow.com/comment/44627041
score: 0
type: AnswerComment
type: Comment
has text: @LVarayut Interesting. What is the behavior of the $id() function mentioned in NgRepeat API (v. higher than 1.2.x)? For example: `item in items` is equivalent to `item in items track by $id(item)`. ?https://docs.angularjs.org/api/ng/directive/ngRepeat
comment on: http://stackoverflow.com/a/28126525

http://stackoverflow.com/comment/44866998
score: 0
has text: Ty! Calling controllaAmicizie() after callign setInterval() solved the problem just in part, since there is still a little delay between the page layout loading and the div showing! It's better than before for sure, but i would like to remove that delay at all!
type: QuestionComment
comment on: http://stackoverflow.com/q/28253620
type: Comment

http://stackoverflow.com/comment/44738095
comment on: http://stackoverflow.com/q/28184081
has text: @charlietfl I thought so too, but I don't see that the OP uses `$` in the function.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44986994
score: 0
type: Comment
has text: @ChrisConnolly I would move all the functions outside the fullPage.js initialization and leave them just inside document.ready.
comment on: http://stackoverflow.com/a/28276005
type: AnswerComment

http://stackoverflow.com/comment/44763154
score: 1
comment on: http://stackoverflow.com/q/28197923
type: QuestionComment
has text: Maybe it was downvoted because you haven't been very clear - "I am trying to make something move" what something? "drawing my square" - so you want a square drawn? Honestly, it could be a little clearer. I don't think it warrants downvoting though, the downvoter should have commented and suggested improvements.
type: Comment

http://stackoverflow.com/q/28238755
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28238975
type: Question
tagged with: angularjs-directive
has body: It seems like the directive is replacing the template, then running the trust resource function, which updates the source, then it is updating the template again and getting stuck in a loop. But this is the recommended method?? The html: &lt;player videos='[{"type":"mp4","src":"http://vjs.zencdn.net/v/oceans.mp4","poster":"http://www.videojs.com/img/poster.jpg","captions":"http://www.videojs.com/vtt/captions.vtt"},{"type":"webm","src":"http://vjs.zencdn.net/v/oceans.webm"}]' /&gt; And this is the javascript: module.directive('player', ['$sce', function ($sce) { 'use strict'; return { restrict: 'E', scope: { videos: '=' }, link: function (scope, element, attrs) { scope.trustSrc = function(src) { return $sce.trustAsResourceUrl(src); } }, template: '&lt;video preload="none" poster="{{ trustSrc(videos[0].poster) }}"&gt;' + '&lt;source ng-repeat="item in videos" ng-src="{{ trustSrc(item.src) }}" type="video/{{ item.type }}" /&gt;' + '&lt;track kind="captions" ng-src="{{ trustSrc(videos[0].captions) }}" srclang="en" label="English" /&gt;' + '&lt;/video&gt;' }; }]); And here is a working fiddle: http://jsfiddle.net/kmturley/mgosw7kx/4/
tagged with: javascript
has title: AngularJS digest cycle limit with directive template and trusted resource
score: 0
has answer: http://stackoverflow.com/a/28238975
has comment: http://stackoverflow.com/comment/44847920
answer count: 1
tagged with: angularjs
tagged with: digest

http://stackoverflow.com/comment/44650956
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28139723
has text: @RokoC.Buljan its actually spelled "indecipherable", but whatever floats your boat mate.

http://stackoverflow.com/comment/44696536
type: AnswerComment
has text: Sure, that sounds like a great option. At that point you might even consider creating a Date service to house all that similar logic.
comment on: http://stackoverflow.com/a/28133876
score: 0
type: Comment

http://stackoverflow.com/a/28122141
has body: I need to have a dynamic # of select boxes which means a dynamic # of ids No. You don't need to use element ids at all to get this functionality working. You can instead give the select elements the same class: And then use that class to bind the same change handler to all of them: $(".choose").change(function() { ... }); And then within the handler rather than using an id to find the related div, use DOM navigation methods like .next() to find the div based on its relative position in the markup: $(this).next().text(...) Also, if the display:none; ul element is there solely to hold the descriptions, why don't you get rid of it and add the descriptions directly to each option like this: Title 1 Putting that together your function might look like this: $('.choose').change(function(){ $(this).next().text( $(this).find(':selected').attr('data-desc') ); }) Here's an updated version of your fiddle that shows that one little bit of JS handling multiple select elements: http://jsfiddle.net/5Eebm/75/
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44642215
downvote count: 0
answers question: http://stackoverflow.com/q/28122053

http://stackoverflow.com/comment/44708951
type: QuestionComment
comment on: http://stackoverflow.com/q/28135404
has text: No, it just be blocked sometimes . When this happen, it would work fine if user chooses "Allow Always" option . But it is difficult for user to fine the settings. So I want to know can I let my plugin be a "Allow Always" plugin in Safari without user's operation? Or can JS know plugin is blocked by Safari?
score: 0
type: Comment

http://stackoverflow.com/comment/44908860
type: QuestionComment
comment on: http://stackoverflow.com/q/28273389
score: 0
has text: @Ian Got it.. Can you post your comment as answer.. So that I can accept it..
type: Comment

http://stackoverflow.com/comment/44921079
type: Comment
has text: Here is one example if it helps: http://plnkr.co/edit/WLV17rz3GXlUjxG0rgD8?p=preview Placing you code online can help others to find the issue easier.
score: 1
comment on: http://stackoverflow.com/q/28275214
type: QuestionComment

http://stackoverflow.com/q/28139894
downvote count: 0
tagged with: passport.js
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27168229
tagged with: node.js
linked to: http://stackoverflow.com/q/23278098
score: 1
tagged with: authentication
upvote count: 1
has body: I am trying to implement passport local strategy in my project following this blog. I have created the passportjs file in config . var passport = require('passport'), LocalStrategy = require('passport-local').Strategy; passport.serializeUser(function(user, done) { done(null, user.id); }); passport.deserializeUser(function(id, done) { User.findById(id, function(err, user) { done(err, user); }); }); passport.use(new LocalStrategy({ usernameField: 'username', passwordField: 'password' }, function(username, password, done) { console.log("User Authenticating...." + username + 'and' + password); User.findOne({ username: username }).exec(function(err, user) { if (err) { return done(err); } if (!user) { return done(null, false, { message: 'Unknown user ' + username }); } if (user.password != password) { return done(null, false, { message: 'Invalid password' }); } return done(null, user); }); } )); i have updated the httpjs as per suggestion middleware: { passportInit : require('passport').initialize(), passportSession : require('passport').session(), order: [ 'startRequestTimer', 'cookieParser', 'session', 'passportInit', 'passportSession', 'myRequestLogger', 'bodyParser', 'handleBodyParserError', 'compress', 'methodOverride', 'poweredBy', 'router', 'www', 'favicon', '404', '500' ] } /*************************************************************************** * * * The number of seconds to cache flat files on disk being served by * * Express static middleware (by default, these files are in `.tmp/public`) * * * * The HTTP static cache is only active in a 'production' environment, * * since that's the only time Express will cache flat-files. * * * ***************************************************************************/ // cache: 31557600000 }; Now when I am trying to call local strategy from my Auth controller as login: function (req, res) { var user = req.body.user; // check user if (!user) { //send bad request return res.status(500).json({payload : {}, message : "Undef…
type: Question
tagged with: sails.js
tagged with: javascript
has answer: http://stackoverflow.com/a/28162739
has title: Using sailsjs passport Authentication Local strategy is neither giving any error nor authenticating the user
answer count: 1

http://stackoverflow.com/comment/44710039
comment on: http://stackoverflow.com/q/28170284
type: QuestionComment
has text: Well then only start the AJAX request for an item after the request for the previous one has finished … (Or something like that – hard to be more specific, if the question itself is that vague. We don’t know what yu are _actually_ trying to implement here, so we can hardly make suggestions as to what might be the best in regard to user experience etc.)
score: 0
type: Comment

http://stackoverflow.com/comment/44782115
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28208656
type: Comment
has text: Thanks for catching the typo - I'm still getting a response of "undefined" though.

http://stackoverflow.com/comment/44687927
comment on: http://stackoverflow.com/q/28155624
type: Comment
has text: If you replace your calls on $localStorage with window.localStorage do your results change? I think ngStorage basically maps them 1:1 but I'm not sure.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28239355
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I create a menu : About schedule speakers Map Register And I want to show/hide the corresponding sections : Thanks !
tagged with: css
downvote count: 4
type: AnsweredQuestion
upvote count: 0
score: -4
possible better answer: http://stackoverflow.com/a/28241848
has title: How to hide Show section with menu click?
type: Question
has comment: http://stackoverflow.com/comment/44839638
has comment: http://stackoverflow.com/comment/44839712
has answer: http://stackoverflow.com/a/28239934
accepted answer: http://stackoverflow.com/a/28239934
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28241848

refluxjs
tags question: http://stackoverflow.com/q/28179086
tag name: refluxjs
type: Tag

http://stackoverflow.com/a/28125340
type: Answer
downvote count: 0
has body: Php/Ajax example: In this example you have index.html and record_count.php files Here is the Code: index.html contains the html code and javascript call to load record_count.php and record_count.php has the php code <?php echo "some code or variable here"; ?> you can change the javascript interval to suit your needs I'll leave you the blog link as a reference: 9lessons
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28125226

http://stackoverflow.com/a/28188587
has comment: http://stackoverflow.com/comment/44745575
type: Answer
has body: Bind an event to it first, i meant a click event $(".clickMe").click(function(){ $(this).text($(this).text() == "show" ? "hide" : "show"); }); DEMO
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/28188555
downvote count: 0
has comment: http://stackoverflow.com/comment/44745528

http://stackoverflow.com/q/28151564
type: Question
has comment: http://stackoverflow.com/comment/44674586
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28151666
has title: How to get requested url from ajax response?
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28151664
has answer: http://stackoverflow.com/a/28151664
has body: In my project I have several ajax global events. In $(document).ajaxSend(function(event, jqxhr, settings) { // }); I can get requested url from settings.url But how can I get url from response from this request in $(document).ajaxComplete(function (e, jqxhr) { // }); The only object that contains requested url here is arguments[2].url Is there other way to obtain requested url from response, because I'm not sure in such object as arguments[2].url?
accepted answer: http://stackoverflow.com/a/28151666
type: AnsweredQuestion
score: 1
upvote count: 1

nosql
tags question: http://stackoverflow.com/q/28199924
tags question: http://stackoverflow.com/q/28157617
tag name: nosql
type: Tag
tags question: http://stackoverflow.com/q/28273588
tags question: http://stackoverflow.com/q/28193782

http://stackoverflow.com/comment/44792861
score: 0
type: QuestionComment
has text: @SebastianBochan: Thanks a lot but i can see we can achieve this, please refer the fiddle below, this is what i need, do i need to turn on or off certain properties of bubble chart? http://jsfiddle.net/bhupendrasinghnegi/kqdrx1uo/
type: Comment
comment on: http://stackoverflow.com/q/28209259

http://stackoverflow.com/q/28176444
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
accepted answer: http://stackoverflow.com/a/28415635
has title: TypeError: $ is not a function in AJAX and Wordpress
upvote count: 3
tagged with: wordpress
has comment: http://stackoverflow.com/comment/44722012
answer count: 1
has body: I try to add content on a div through AJAX on Wordpress. I use the JSON API to get posts from a specific category. Here is the code: This is my test If I run it local without Wordpress, it runs without a problem. However, now I have this error on the $(document).ready line: TypeError: $ is not a function
has comment: http://stackoverflow.com/comment/44722323
has comment: http://stackoverflow.com/comment/45163734
tagged with: javascript
has answer: http://stackoverflow.com/a/28415635
has comment: http://stackoverflow.com/comment/44722074
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44722022
score: 3

http://stackoverflow.com/a/28307067
type: Answer
accepted answer of: http://stackoverflow.com/q/28259555
answers question: http://stackoverflow.com/q/28259555
score: 0
type: AcceptedAnswer
has body: Edit just tried using setLinearVelocity() it works with the updated code above.

http://stackoverflow.com/q/28178540
has title: Call Grunt task from subdirectory
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44726833
has comment: http://stackoverflow.com/comment/44726667
tagged with: node.js
type: Question
has body: I'm struggling with how to make this work. I have a casper test in which I need to run a Grunttask at the end of. The problem is the directory structure which I've added below. package.json Gruntfile.js casperjs/ --- web/ ------ tests/ --------- test.js And in test.js I'm calling grunt.task.run(['mytestname']); When I run the casper test I get "uncaughtError: ReferenceError: Can't find variable: grunt". Any ideas? Thanks! UPDATE In the testfile I've added var grunt = require('../../../../Gruntfile.js'); but then I get an error saying grunt.task.run is undefined. Think I'm heading in the right direction.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44754977
tagged with: gruntjs
score: 0

http://stackoverflow.com/comment/69202297
type: AnswerComment
has text: @Shahid That's because the Y-axis minimum value was `2`—such is Chart.js's default behavior to take the smallest value—not `0` as you expected. I've updated the example to make it more clear, but it was rendering correctly.
type: Comment
comment on: http://stackoverflow.com/a/28181877
score: 0

http://stackoverflow.com/q/28232151
type: Question
has comment: http://stackoverflow.com/comment/44826557
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44829940
tagged with: javascript
tagged with: jquery
has title: Change ''Login to post Topic'' Button into Login link Button
has body: I would like to know how do i change the ''Login to post Topic'' GreyOut Button (That normally dont act as a button link), into ''Login to post Topic'' Button link. I mean, i want that when Guest enters a forum he will see ''Login to post Topic'' Button link ,and he will be able to actually login by forward him to the "login page": http://example.com/index.php?app=core&module=global&section=login Now, i had some research and i found under: Look & Feel -> Search and Replace -> Search: test="isGuestPostTopicTop:|: ! $this->memberData['member_id']" Found this (Twice in the same file): memberData['member_id']"> {$this->lang->words['forum_no_start_topic_guest']}<else />{$this->lang->words['forum_no_start_topic']} Now, i tryied some methods to convert that grey out "Button" into Login link, but all i got is this: memberData['member_id']"> {$this->lang->words['forum_no_start_topic_guest']}<else />{$this->lang->words['forum_no_start_topic']} But when i click on that button as a guest it reffers me to none exisiting page: http://example.com/index.php?app=forums&core&module=global&section=login How do i actually make that Button Link to forward to the correct login page?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
downvote count: 0
tagged with: authentication
tagged with: php
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28235606
accepted answer: http://stackoverflow.com/a/28235606

http://stackoverflow.com/a/28265510
score: 0
answers question: http://stackoverflow.com/q/28264580
type: Answer
has body: Other answers have addressed issues that JavaScript has with using floating point numbers to represent money. There's a separate issue with using JavaScript for calculations involving financial transactions that comes to mind. Because the code is executed in a browser on the client machine, You can only trust the result to the extent that you can trust the client. Therefore you should really only rely on JavaScript to calculate something that you could take for granted if the client told you. For instance, if you were writing an e-commerce site, you could trust code that told you what the client wanted to buy, and what the clients shipping address was, but you would need to calculate the price of the goods yourself to prevent the client from telling you a lower price. It's entirely possible that the invoicing system you're working on will only be used internally to your organisation. If this is the case, you can disregard this entire answer. But, if your applications is going to be used by customers to access and manipulate their invoices and orders, then this is something you'd have to consider.

http://stackoverflow.com/q/28241863
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28242730
has answer: http://stackoverflow.com/a/28242901
answer count: 2
downvote count: 0
score: 1
tagged with: jquery
has title: jQuery - Clearing textarea on change of select
favorite count: 0
has comment: http://stackoverflow.com/comment/44845966
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28242901
has comment: http://stackoverflow.com/comment/44846510
type: AnsweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28242730
has comment: http://stackoverflow.com/comment/44845547
has body: I'm building a little text editor that allows editing of files and also allows a new file to be created. This is how my select menu is configured. --Choose a Report-- --Create a New Report-- Volumes Options There's a below this that display the contents of the selected report file. id="reporttxt". When the select is changed, I want the contents of the textarea cleared and then the new file contents put in. This works when switching between files, but if a user inputs text, it breaks the clearing. I've tried just this: $("#reportname").change(function(){ $("reporttxt").html('') //this works when switching between functions //function to import new text <-- this works fine } I've also tried this: $("#reportname").change(function(){ if($(this).val() == "newReport"){ $("#reporttxt").val(''); //this clears user input but now nothing will display } else { $("#reporttxt").html(''); } //function to import text <-- does not display text after .val('') is fired }); The function import text inserts it like this: $.ajax({ type: "GET", url: "report-data.php", data: "file="+$(this).val(), datatype: "json", success: function( result ) { $("#reporttxt").append(result.body); } }); Any ideas why these weird things happen? EDIT the problem was actually the .append(). I'm not sure why but changing $("#reporttxt").append(result.body); to $("#reporttxt").val(result.body); fixed the problem. I am just using $("#reporttxt").val(''); to clear now.
has comment: http://stackoverflow.com/comment/44844636

http://stackoverflow.com/comment/44650757
type: Comment
comment on: http://stackoverflow.com/q/28139505
type: QuestionComment
has text: check this. http://stackoverflow.com/questions/19205370/slide-div-right-to-left-with-jquery?rq=1
score: 0

http://stackoverflow.com/comment/44805428
type: Comment
type: QuestionComment
has text: just checked `Uncaught Reference Error: Highcharts is not defined`
comment on: http://stackoverflow.com/q/28220721
score: 0

http://stackoverflow.com/a/28237422
has comment: http://stackoverflow.com/comment/44836250
answers question: http://stackoverflow.com/q/28237163
has comment: http://stackoverflow.com/comment/44836968
accepted answer of: http://stackoverflow.com/q/28237163
type: Answer
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/44836560
upvote count: 6
has comment: http://stackoverflow.com/comment/44836405
type: AcceptedAnswer
has body: Given this HTML: Label {{label}} Save And assuming you have a variable named myApp that has your main application, you'd make a controller like this: var myApp = angular.module('app', []); myApp.controller('MyController', function($scope, $log) { $scope.labels = ['one', 'two', 'three']; $scope.values = new Array($scope.labels.length); $scope.saveEverything = function() { $scope.contents = []; for (i = 0; i < $scope.labels.length; i++) { $scope.contents.push({ label: $scope.labels[i], value: $scope.values[i] }); } $log.info('Saved to array[0]: ' + $scope.contents[0].value); $log.info('Saved to array[1]: ' + $scope.contents[1].value); $log.info('Saved to array[2]: ' + $scope.contents[2].value); } }); Demo: http://plnkr.co/edit/JCCa1f?p=preview (Use your browser's Javascript console to see the values placed in the array) That will wipe the $scope.contents array each time you press Save and then place three objects in it, one for each of your inputs. I'm not sure why you'd want to do this, though, so if this isn't what you are looking for, perhaps you could expand on your question a bit to make your problem and needs a bit more clear.

http://stackoverflow.com/q/28123985
accepted answer: http://stackoverflow.com/a/28183918
has answer: http://stackoverflow.com/a/35895878
possible better answer: http://stackoverflow.com/a/31842566
favorite count: 0
has title: Move buttons below each other in popup using ionicPopup.show
tagged with: angularjs
has answer: http://stackoverflow.com/a/31842566
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44736344
type: Question
has answer: http://stackoverflow.com/a/28183918
has body: I've created this popup using $ionicPopup.show({ title: 'Choose Location...', buttons:[ { text: "Current Location", type: 'button-positive', onTap: function(){ $scope.myLocation(); } }, { text: "Previous Locations", type: 'button-positive', onTap: function(){ $state.go('menu.listSelect'); //go to choose location page } }, { text: "Address Book", type: 'button-positive', onTap: function(){ //go to address book } }, { text: "Cancel", type: 'button-positive', onTap: function(){ console.log('cleek'); $scope.fillOptionPopup.close(); } }, ] }); }; This places the buttons created next to each other like so Is there a way to make the buttons so they stretch across the width of the popup and each button is on a new line using that format of creating buttons for the popups? I've used this code in place of the buttons array and it gives me this, which is what I want. But the ng-click isn't calling the functions that I made out of the ontap's from the array. template: ' Current Location '+ ' Previous Locations '+ ' Address Book '+ ' Close ' Is there a way to get the buttons to be one per row and a full width of the popup?
score: 4
tagged with: ionic-framework
upvote count: 4
answer count: 3
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44735545

http://stackoverflow.com/comment/44685030
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28155984
score: 0
has text: @Josh I forked your Plunker to make it more similar to my actual code.

http://stackoverflow.com/a/28219923
answers question: http://stackoverflow.com/q/28219786
has body: This seems to prepend the current scope (when you call the returned function) to any arguments passed into _function, then finally calls it with a specified scope (_this). // Take a new scope and a callback var shiftBind = function(_this, _function) { // Wrap them, creating closure return function() { // Save the current scope, when you call this function var args = [this]; // Prepend it to any arguments for (var i = 0; i &lt; arguments.length; i++) { args.push(arguments[i]); } // Then call the original function with the original scope argument return _function.apply(_this, args); }; }; // Test it function Ctor(foo) { this.foo = foo; } // Make a pair of Ctors and give x a method var x = new Ctor(1); var y = new Ctor(3); x.getFoo = function(prev) { return prev ? prev.foo + this.foo : this.foo; } // Check outputs console.log(x.getFoo()); // 1 console.log(x.getFoo.call(y)); // 3 // Bind so we have access to both "scopes" x.boundFoo = shiftBind(y, x.getFoo); console.log(x.boundFoo()); // calls getFoo, which only exists on x, but prints 4 This doesn't seem to have a ton of practical uses, and isn't a pattern I've seen before, but allows you to access to objects with this-like semantics.
score: 2
type: AcceptedAnswer
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28219786
type: Answer

http://stackoverflow.com/comment/44723470
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28165935
has text: Any other constraints not mentioned in the question?
type: Comment

http://stackoverflow.com/comment/48010827
type: AnswerComment
comment on: http://stackoverflow.com/a/29944784
score: 0
type: Comment
has text: @Phpdevpad I wish I could fix the library haha. Let's say we have a container of 500px in which isotope wants to make 8 columns. Each column should be 62,5px, right? But if isotope tries to put an item in the first column it doesn't put it at 62,5px, it puts it at 62px. And that's how the small spaces start appearing between the images.

http://stackoverflow.com/q/28263396
score: 2
has body: I use dropdown menu for bootstrap and when click on one of the elements it suppose to show angular-strap modal but it doesn't show up here's my code Time-series dashboard Non time-series dashboard I tried to do some debug and get the following when I remove dropdown-menu css class it works fine so what's the reason for that? there's an issue on github talking about that but the propsoed solution didn't work for me
tagged with: angular-strap
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Cannot use modal in a dropdown menu element in angular strap
tagged with: angularjs
answer count: 0
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/44841361
score: 0
type: Comment
type: QuestionComment
has text: have you tried using a parser to transform those keys from k.k to k_k and then use them in js? and then before send the data back transform it again into k.k ?
comment on: http://stackoverflow.com/q/28239754

http://stackoverflow.com/a/28266155
has comment: http://stackoverflow.com/comment/44893980
has body: The request is handled asynchronously, and thus you need to provide a callback, as you're already doing in the 'success', and 'error' blocks. Probably the easiest way is just to provide yet another callback to be called with the result, like so: $.jsonRPC.setup({ endPoint: '/jsonserver.php' }); getMyStuff(function (result) { console.log("here's the result", result); }); function getMyStuff(callback) { $.jsonRPC.request('getResultsById', { params: [1], success: callback, error: function(result) { console.error("error:", result); } }); }
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28258201
answers question: http://stackoverflow.com/q/28258201

http://stackoverflow.com/comment/44896324
type: Comment
type: QuestionComment
has text: could you create a plnkr for it?
comment on: http://stackoverflow.com/q/28270234
score: 0

console.log
tags question: http://stackoverflow.com/q/28165456
tags question: http://stackoverflow.com/q/28208031
tag name: console.log
tags question: http://stackoverflow.com/q/28219858
tags question: http://stackoverflow.com/q/28261064
type: Tag
tags question: http://stackoverflow.com/q/28154990

http://stackoverflow.com/a/28251237
has comment: http://stackoverflow.com/comment/44862037
upvote count: 1
has body: Since the purpose of the question has become more clear now, an edit: var a = ["1", 'car', 2]; a = a.map(function(element) { //check if element is a number and not NaN or empty string if (!isNaN(element) &amp;&amp; element != "") { return parseInt(element, 10); } else { return element; } }); document.body.textContent = a; This will traverse your array. Testing if the array element is a number, if so transform the number if possible. I'm using Array.prototype.map for this. Please note that this only filters integers. If you want to filter floats use parseFloat. That will parse integers and floats.
downvote count: 1
has comment: http://stackoverflow.com/comment/44863786
answers question: http://stackoverflow.com/q/28251170
accepted answer of: http://stackoverflow.com/q/28251170
has comment: http://stackoverflow.com/comment/44862072
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44862147
score: 0
has comment: http://stackoverflow.com/comment/44861912
type: Answer
has comment: http://stackoverflow.com/comment/91390776
has comment: http://stackoverflow.com/comment/91330484

http://stackoverflow.com/q/28196065
has comment: http://stackoverflow.com/comment/70202987
tagged with: http://stackoverflow.com/tag/pdf
favorite count: 0
type: UnansweredQuestion
has title: Downloading PDF as Blob with JS in IE9
has body: I have a blob and want to download it. It works for Chrome, Firefox, IE10 and higher. The problem is IE9. var isIE = /*@cc_on!@*/false || !!document.documentMode; var blob = new Blob([data], {type: "application/pdf"}); if (isIE) { window.navigator.msSaveOrOpenBlob(blob, "Download.pdf"); } else { var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = "Download.pdf"; link.id = "TEST"; $('body').append(link); document.getElementById("TEST").click(); } Where is the problem? The IE has 2.083 as maximal limit for chars in URL. Maybe this is critical. What alternatives do I have? I have to support IE9... Thanks.
has comment: http://stackoverflow.com/comment/76612984
tagged with: internet-explorer-9
has answer: http://stackoverflow.com/a/28197001
type: Question
upvote count: 4
tagged with: blob
downvote count: 0
answer count: 1
tagged with: javascript
score: 4

http://stackoverflow.com/comment/44868241
type: Comment
comment on: http://stackoverflow.com/a/28254091
has text: @Cherry15 np. Thanks once again :)
type: AnswerComment
score: 0

http://stackoverflow.com/q/28210648
score: 0
has title: Unable to generate refresh Access token
type: UnansweredQuestion
tagged with: oauth-2.0
has answer: http://stackoverflow.com/a/45542732
linked to: http://stackoverflow.com/q/19015451
has body: I am able to generate an access token but the response object return null for refresh token following is my code. JavaScript: function connect_dfa(oauthurl,scop,redirect,clientId) { var width = 1024; var height = 512; var left = (screen.width / 2) - (width / 2); var top = (screen.height / 2) - (height / 2); var specs = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,width='+width+',height='+height+',top='+top+',left='+left; var url = oauthurl+"&amp;scope="+scop+"&amp;redirect_uri="+redirect+"&amp;response_type=code&amp;client_id="+clientId; alert (url); var win = window.open(url, 'scgid platform', specs, false); return false; } once it redirect to redirect URL following code generate access token using the authentication code: flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, CLIENT_ID, CLIENT_SECRET, SCOPES).build(); final TokenResponse response = flow.newTokenRequest(dfaToken).setRedirectUri(CALLBACK_URI) .execute(); System.out.println(response.getAccessToken()); System.out.println(response.getRefreshToken()); It return me an access token such as : ya29.CgH2ZBKtHUBr6uJtOs8q0q2vf_tllv_UYMF-Vcd-bODGOgoxqz05mzfDkymEGjVdmYuw2Os4FFpQPQ" but reuturn NULL for Refresh Token. What m doing wrong since I am able to generate access token.
type: Question
tagged with: google-oauth
answer count: 2
has comment: http://stackoverflow.com/comment/44787527
has comment: http://stackoverflow.com/comment/44791905
tagged with: javascript
has answer: http://stackoverflow.com/a/28308780
has comment: http://stackoverflow.com/comment/44844204

http://stackoverflow.com/comment/44642553
has text: Java is not JavaScript, which it seems you know, but you're still mixing them in strange ways in the question, and telling us what you can't do in Java etc ?
comment on: http://stackoverflow.com/q/28135244
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44859936
has text: Then appreciate it with by accepting this as an answered and vote +1 :)
type: Comment
comment on: http://stackoverflow.com/a/28233064
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44771623
score: 0
has text: Are you sure that the view is in the correct scope?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28202448

http://stackoverflow.com/a/28402039
has body: In angularjs data binding, if the data type is list or object, it will pass by reference value in view. When you do like $scope.l = selectedItem, the reference is changed, but the watched reference is previous one. So it will be always better to bind by an attribute on an object, but not the object itself. like: &lt;div id="title" class="center"&gt;{{obj.l.attributes.City}}, {{obj.l.attributes.State}}&lt;/div&gt; And update in controller with: $scope.obj.l = selectedItem;
answers question: http://stackoverflow.com/q/28179677
score: 0
type: Answer

http://stackoverflow.com/q/28229475
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28229528
has comment: http://stackoverflow.com/comment/44821857
has body: I have an object like these var itemlist= {"50271":2,"50025":1,"90012":3}1 It indicates the reagent to include in a mixture. The property name is the ID of the reagent and the property value the quantity. I would like to generate HTML to display the reagents of a mixture as follows &lt;img src='50271.jpg'&gt; x 2 &lt;img src='50025.jpg'&gt; x 1 &lt;img src='90012.jpg'&gt; x 3 How can I loop the object to get my expected output?
has comment: http://stackoverflow.com/comment/44821845
linked to: http://stackoverflow.com/q/684672
has comment: http://stackoverflow.com/comment/44821853
linked to: http://stackoverflow.com/q/85992
has answer: http://stackoverflow.com/a/28229531
has comment: http://stackoverflow.com/comment/44822019
accepted answer: http://stackoverflow.com/a/28229531
type: AnsweredQuestion
has title: How to loop data in javascript
has comment: http://stackoverflow.com/comment/44821849
has comment: http://stackoverflow.com/comment/44821802
has answer: http://stackoverflow.com/a/28229528
type: Question
tagged with: object

http://stackoverflow.com/q/28219314
score: -2
has comment: http://stackoverflow.com/comment/44802016
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44801991
downvote count: 2
has title: How do I sum the values from an array, one by one, until the total is larger than x?
linked to: http://stackoverflow.com/q/9329446
type: Question
has comment: http://stackoverflow.com/comment/44802001
has comment: http://stackoverflow.com/comment/44802007
upvote count: 0
has answer: http://stackoverflow.com/a/28219437
answer count: 1
tagged with: javascript
favorite count: 0
has body: I have this JS to get the widths of a bunch of sibling elements and add those widths to an array. var nav = document.querySelector('.js-primary-nav'); var childrenWidths = []; for(var i=0; i&lt;nav.childElementCount; i++){ childrenWidths.push(nav.children[i].offsetWidth); } Now I want to cycle through these widths, adding them up until the total is greater than X (which will be the container width). I then want to get the positions of the values up until the one which tipped the total over into larger than X so I can add those values to one pile and the others to another. How do I cycle through the values, adding and then comparing the total to a number? Thanks

http://stackoverflow.com/comment/44892852
type: Comment
type: QuestionComment
has text: It's not clear at all to me what you're trying to achieve. Why/how to you want to cover the entire range? Don't you want to plot just the data you have?
comment on: http://stackoverflow.com/q/28266047
score: 0

http://stackoverflow.com/a/28194701
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: Your indentation must be off. I pasted your exact coffeescript from the question into js2coffee update_checkboxes = -&gt; part_array = [] $("input#edit:checked").parents("td").next().each -&gt; part_id = $(this).text() part_array.push part_id $("input#participant_ids").val JSON.stringify(part_array) and received... var update_checkboxes; update_checkboxes = function() { var part_array; part_array = []; $("input#edit:checked").parents("td").next().each(function() { var part_id; part_id = $(this).text(); return part_array.push(part_id); }); return $("input#participant_ids").val(JSON.stringify(part_array)); }; Which is correct. StackOverflow must have normalized your indentation when you pasted it. Take a look at the original and fix the mismatched indentation.
answers question: http://stackoverflow.com/q/28194604

http://stackoverflow.com/a/28230444
has body: If you want a specific class for styling purposes: .... .... Then you can apply your CSS over tr.isY:first-child to style this first one diferently. Now if you want a totally different HTML for that element, you should rather sort it out before. So in your controller: for (var i = 0; i < $scope.player_history.length; i++) { if ($scope.player_history[i].award === 'Y') { $scope.firstYAward = $scope.player_history[i]; break; } } and then in your HTML: .. specific html for the first Y .. .. regular html for the others ..
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28230232

http://stackoverflow.com/comment/44695868
has text: To clarify, OP, what I'm saying is, don't use this code literally, it's just an example. Only you know what kinds of arguments your function accepts, and thus only you can make a good hashing function (fast, giving a unique result for a unique input, and returning as memory-efficient result as possible, ideally a number).
comment on: http://stackoverflow.com/a/28162116
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44705683
has text: Thanks a lot for your answer :) ! I have been trying this solution, but the problem is that the user still needs to select the day to select the date. Which is meaning less in my use case, the user shouldn't even see the days ^^ !
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28167843

http://stackoverflow.com/a/28140449
answers question: http://stackoverflow.com/q/28139980
upvote count: 2
score: 2
has body: Your first layer request is for an image (.png) and images are not subject to CORS restrictions. The reason for the CORS error, however, remains the fact that you're loading client code with file:// and then trying to load a (non-image) resource with http://
has comment: http://stackoverflow.com/comment/44652992
accepted answer of: http://stackoverflow.com/q/28139980
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44653682
type: Answer
has comment: http://stackoverflow.com/comment/44653293

http://stackoverflow.com/comment/61256024
score: 0
type: AnswerComment
has text: Thanks for the update, I still have to require it as well like this `var $ = jQuery;`
type: Comment
comment on: http://stackoverflow.com/a/28205609

http://stackoverflow.com/comment/44753486
comment on: http://stackoverflow.com/a/28150091
has text: Thanks, I've adapted the message, only using html though, but can't get the loop to work correctly so that it colours all instances of the letter/ word found not just one:
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28161765
accepted answer: http://stackoverflow.com/a/28161817
has answer: http://stackoverflow.com/a/28161848
answer count: 4
has body: Target: From a select dropdown menu, if someone selects an option, disable/remove/hide the rest of the options on that dropdown menu. Here is the dropdown menu. If someone selects "1", the rest of options (2,3,4) will be removed/disabled/hide: 1 2 3 4 Here is the JavaScript I tried to use: $('.selectDropdown').on('change', function(e) { $(this).closest('.abc').children('.xyz').children('option:not(:selected)').prop('disabled', true); }); I know, the JavaScript is faulty here. Where did I make the mistake?
type: AnsweredQuestion
score: 1
tagged with: select
possible better answer: http://stackoverflow.com/a/28161848
has title: jQuery on change only shows the selected option, remove/disable rest of them
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/28161853
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28161827
has answer: http://stackoverflow.com/a/28161817
tagged with: onchange
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/44695100
upvote count: 1

http://stackoverflow.com/q/28256004
score: 0
has body: I have a chart that I've been building, but for some reason, it isn't displaying as an area chart - at least, not smoothly. It's very spikey, and doesn't look very good. My data points are rather strange, but is there any way to have them transition more smoothly? You can view what the chart looks like at https://i.sstatic.net/ipKep.jpg I want it to look more like this chart: http://bl.ocks.org/mbostock/1667367 (and I copied a large portion of this code to do so, so I'm not sure why it is displaying in this odd way.) Thanks! Here is the full code below. For reference, there are data points at every point in time (which is every 3 hours). function InitChart() { var lineData = []; for (i = 0; i &lt; Math.round(totaltime / interval); i++) { lineData[i] = { "timeinterval": Date.now() - (i * interval * 1000), "reactionrate": reactionratebyinterval[i], "reach": reachbyinterval[i], "engagement": engagementbyinterval[i] }; } var margin = {top: 10, right: 10, bottom: 100, left: 40}, margin2 = {top: 430, right: 10, bottom: 20, left: 40}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom, height2 = 500 - margin2.top - margin2.bottom; var parseDate = d3.time.format("%b %Y").parse; var x = d3.time.scale().range([0, width]), x2 = d3.time.scale().range([0, width]), y = d3.scale.linear().range([height, 0]), y2 = d3.scale.linear().range([height2, 0]); var xAxis = d3.svg.axis().scale(x).orient("bottom"), xAxis2 = d3.svg.axis().scale(x2).orient("bottom"), yAxis = d3.svg.axis().scale(y).orient("left").ticks(5); var brush = d3.svg.brush() .x(x2) .on("brush", brushed); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); svg.append("defs").append("clipPath") .attr("id", "clip") .append("rect") .attr("width", width) .attr("height", height); var focus = svg.append("g") .attr("clas…
tagged with: ruby-on-rails-4
tagged with: javascript
has comment: http://stackoverflow.com/comment/44870450
has title: Area chart looks too "spikey"
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44872810
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44871848
type: Question
has comment: http://stackoverflow.com/comment/44891828

http://stackoverflow.com/comment/44696152
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28162401
has text: It's not **JavaScript**, it's binary floating-point math.
type: Comment

http://stackoverflow.com/q/28238014
has comment: http://stackoverflow.com/comment/44840136
type: Question
tagged with: firebase
has comment: http://stackoverflow.com/comment/44840006
has answer: http://stackoverflow.com/a/28239912
answer count: 1
tagged with: javascript
tagged with: angularfire
has body: I am seriously having a hard time retrieving nested data from Firebase with AngularJS. I try to save data this way in Firebase, btw I am using Angularfire to save and retrieve data from the database. How can I retrieve the value of foo with ng-repeat? I also find that the documentations is scarce and tutorials are outdated. I like the real time updates and that is why I want to use it. There are no errors in the console btw. Thanks in advance for any suggestions. --Unique id --0 --foo:"bar" --1 --foo:"bar" Now when I do this in my HTML it gives me back the index number: {{item}} x But when I do this, it does not give me the values of foo: {{item.foo}} x Javascript angular.module("app", ['firebase']) .controller("ctrl", function ($firebase, $scope) { var ref = new Firebase('https://testing12344.firebaseio.com/'); var x=[{foo:"bar"}, {foo:"bar"}]; var sync = $firebase(ref); var list = sync.$asArray(); list.$add(x); $scope.list = list; console.log($scope.list); $scope.remove = function (id){ list.$remove(id); } })
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/53457883
accepted answer: http://stackoverflow.com/a/28239912
type: AnsweredQuestion
has title: How to retrieve nested data with Angularjs ng-repeat in Firebase?

http://stackoverflow.com/comment/44872696
score: 0
type: AnswerComment
has text: @adeneo, on the latest Firefox, Chrome, Opera, Safari, iOS, Android http://caniuse.com/#feat=matchesselector. But not sure if `matches` or `matchesSelector` since the link and the description say different things.
type: Comment
comment on: http://stackoverflow.com/a/28256987

http://stackoverflow.com/comment/44650500
comment on: http://stackoverflow.com/a/28138171
has text: scope.$watch(function () {...}) means, that the watch will be evaluated on every digest cycle?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28275954
has comment: http://stackoverflow.com/comment/44906463
tagged with: php
has comment: http://stackoverflow.com/comment/44906457
has body: I've writen this code but it doesn't work. I'm pretty sure it's mostly correct, but I don't know what's wrong with it. The script returns as output "undefined" ------PHP ON SERVER----------------- (http://www.autofficinacicco.it/json.php) &lt;?php header("Access-Control-Allow-Origin: *"); header("Content-Type: application/json; charset=UTF-8"); $conn = new mysqli($nomehost, $nomeuser, $password, ""); $result = $conn-&gt;query("SELECT codice, immagine, testo FROM Promozioni"); $outp = array(); while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) { $outp[]=$rs; } $conn-&gt;close(); echo json_encode($outp); ?&gt; -----JAVA SCRIPT---------------------------------------- &lt;script&gt; var xmlhttp = new XMLHttpRequest(); var url = "http://www.autofficinacicco.it/json.php"; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { myFunction(xmlhttp.responseText); } } xmlhttp.open("GET", url, true); xmlhttp.send(); function myFunction(response) { var arr = JSON.parse(response); var i; var out = "&lt;table&gt;"; for(i = 0; i &lt; arr.length; i++) { out+=arr["immagine"]; out+="&lt;/br&gt;"; out+=arr["codice"]; out+="&lt;/br&gt;"; out+=arr["testo"]; out+="&lt;/br&gt;"; } out += "&lt;/table&gt;" document.getElementById("id").innerHTML =out; } &lt;/script&gt;
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
downvote count: 1
type: Question
has title: Read a JSON object with Javascript (Error)
upvote count: 0
has comment: http://stackoverflow.com/comment/44906946
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28276008
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44770439
type: QuestionComment
comment on: http://stackoverflow.com/q/28202077
has text: With that number of elements, I wouldn't even worry about it. Unless you have profiled your code and found this to be a bottleneck, it's premature optimization. If you have several elements that all need to do the *same* (or very nearly the same) thing when clicked, it makes sense to attach a handler at a higher level. Otherwise, I think that `switch` statement is going to be a bit of a nightmare.
score: 2
type: Comment

http://stackoverflow.com/a/28176587
has body: If you wish to be able to filter items based on their defined attributes only then you should not use tags. Simple SQL queries will do in this case. If you want items to be filtered based on non-attribute values then you can use tags(like transparent for glass items)
answers question: http://stackoverflow.com/q/28176089
type: Answer
score: 0

http://stackoverflow.com/comment/44891181
has text: OK well I don't see any `undefined` errors. Note that if you want to change that increment, it should be either `i=i+1` (perfectly fine) or `i++ ` but not `i=i++`. The answer originally posted about that part of your code was incorrect and you can ignore it.
comment on: http://stackoverflow.com/q/28267202
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/28148063
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28142299
downvote count: 0
has body: That's exactly what https://github.com/jekyll/jekyll-archives is doing.

http://stackoverflow.com/q/28158910
downvote count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28159284
type: Question
has comment: http://stackoverflow.com/comment/44689885
score: -2
tagged with: javascript
upvote count: 2
answer count: 1
has title: Can't get a variable to work in javascript
favorite count: 0
has body: It's quite simple, I'm sure. I'm just trying to use Google Charts to create a map of information slightly off from it's intended purpose. I'm basing if off of the Regions Chart (Documentation Here) (Configuration Options Here). This jsfiddle here is identical to the documentation, except I've added legend: 'none' to the options on line 15 to remove the legend bar from the map This jsfiddle here has the html pieces that I want so that I can enter multiple lines when hovering over a country. The problem is that options (now on line 19) isn't working. The bar is showing in the lower left. If I place options before {tooltip: {isHtml: true}}, then the bar goes away, but the html doesn't work. Clearly I'm doing something wrong here, I just don't know what. Please help.
has comment: http://stackoverflow.com/comment/44689943
accepted answer: http://stackoverflow.com/a/28159284
has comment: http://stackoverflow.com/comment/44689517

http://stackoverflow.com/q/28146396
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44664443
downvote count: 3
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44664405
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28146416
linked to: http://stackoverflow.com/q/28137277
has answer: http://stackoverflow.com/a/39247919
tagged with: forms
has body: I am C++ Programmer and new to JS World. This refers to my previous question. How to submit form based on certain condition? I am trying to submit my form using document.getElementById based on certain condition but there is no output. jQuery.post demo X Value: Submit
type: Question
has answer: http://stackoverflow.com/a/28146497
upvote count: 1
score: -2
has title: No action when submitting form using getElementbyID()
tagged with: javascript

http://stackoverflow.com/a/28224683
answers question: http://stackoverflow.com/q/28224624
has comment: http://stackoverflow.com/comment/44812888
has comment: http://stackoverflow.com/comment/44812640
score: 0
type: Answer
has body: If you want to find the property "bought", then you need to check for that word in the hasOwnProperty() call. So change this line: if (Drugs.hasOwnProperty(dd.bought)){ . . . to this . . . if (dd.hasOwnProperty("bought")){ In both of your test items, you are currently checking to see if the item has a property called "2" and "3", respectively, on the "Drugs" object (since that is what dd.bought equals at the time you are checking). You should really also have this in your code before assigning dd, as well: if (Drugs.hasOwnProperty(d)){

http://stackoverflow.com/comment/44642307
type: QuestionComment
has text: building so much HTML via string concatenation is a bad coding practice. But honestly, the easiest way to fix this code would be to add a wrapper element in your loop (e.g. a ) and use $(this) .closest('.corp') to keep from using IDs in the toggle() function
comment on: http://stackoverflow.com/q/28131894
score: 0
type: Comment

http://stackoverflow.com/q/28129044
has comment: http://stackoverflow.com/comment/44633020
downvote count: 0
has comment: http://stackoverflow.com/comment/44644697
tagged with: cordova-plugins
favorite count: 0
has comment: http://stackoverflow.com/comment/85868497
tagged with: android
has body: I'm using Cordova 4.2.0 for Android. I have some troubles to get FileTransfer plugin work properly. I suppose that there is a writing error exception:".myApp\/contentImages\/20150110220101.jpg: open failed: ENOENT (No such file or directory)" filename was previously tested and does not exist yet: rootFS.getFile('.myApp/contentImages/'+file,{create:false}, function(){ console.log(file+' already exists'); }, function(error){ console.log(file+" does not exist locally"); console.log("Error #"+error.code); download(file); } ); And here is the download function: function download (filename){ var localPath = rootFS.fullPath+'/.myApp/contentImages/'+filename; var fileTransfer = new FileTransfer(); fileTransfer.download( encodeURI('http://distantApp/contentImages/'+filename), // This file exists localPath, function(entry) { console.log("download complete: " + entry.fullPath); }, function (error) { console.log('download error: ' + error.code + ": "+error.exception+" ; source " + error.source+" ; target " + error.target); } ); } What could be the problem? EDIT Code for rootFS function onDeviceReady(){ window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, function(){ console.log("error requesting LocalFileSystem"); }); } function gotFS(fileSystem) { console.log("got filesystem: "+fileSystem.name); // displays "persistent" console.log(fileSystem.root.fullPath); // displays "/" window.rootFS = fileSystem.root; }
accepted answer: http://stackoverflow.com/a/28136597
type: AnsweredQuestion
tagged with: cordova
has title: Cordova's FileTransfer Writing Error (Code 1)
possible better answer: http://stackoverflow.com/a/28136456
has answer: http://stackoverflow.com/a/28136597
type: Question
score: 5
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/77312858
has comment: http://stackoverflow.com/comment/44643126
answer count: 3
tagged with: file-transfer
has answer: http://stackoverflow.com/a/28136456

http://stackoverflow.com/q/28239422
has title: JavaScript - why doesn't setting prototypes prototype work?
type: AnsweredQuestion
tagged with: javascript
linked to: http://stackoverflow.com/q/650764
has answer: http://stackoverflow.com/a/28239473
type: Question
accepted answer: http://stackoverflow.com/a/28239473
score: 0
answer count: 1
has body: I understand that inheritance in JavaScript can be accomplished with the following (copied from MDN): // Shape - superclass function Shape() { this.x = 0; this.y = 0; } // superclass method Shape.prototype.move = function(x, y) { this.x += x; this.y += y; console.info('Shape moved.'); }; // Rectangle - subclass function Rectangle() { Shape.call(this); // call super constructor. } // subclass extends superclass Rectangle.prototype = Object.create(Shape.prototype); Rectangle.prototype.constructor = Rectangle; var rect = new Rectangle(); console.log('Is rect an instance of Rectangle? ' + (rect instanceof Rectangle)); // true console.log('Is rect an instance of Shape? ' + (rect instanceof Shape)); // true rect.move(1, 1); // Outputs, 'Shape moved.' What I'm not understanding is why replacing: Rectangle.prototype = Object.create(Shape.prototype); Rectangle.prototype.constructor = Rectangle; with: Rectangle.prototype.prototype = Shape.prototype; doesn't accomplish the same thing? Performing a similar manipulation on an instance seems to work fine. Example: var rect = new Rectangle(); rect.__proto__.__proto__ = Shape.prototype; But manipulating prototypes this way is discouraged

http://stackoverflow.com/comment/44722639
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28176669
has text: @GuilhermeNascimento: That wouldn't work.

http://stackoverflow.com/a/28195167
has comment: http://stackoverflow.com/comment/44757403
upvote count: 1
has comment: http://stackoverflow.com/comment/44783618
has comment: http://stackoverflow.com/comment/44800092
has comment: http://stackoverflow.com/comment/44757883
has body: It's really hard to reason about what you are doing here without a concrete, real-world example. This is definitely not a pattern I use a lot in my code so I have a suspicion that you could go around fixing it by re-assessing your assumptions. That being said, you can use promise chaining. Note in this case promiseThatLoadsVar IS a promise, it's not a function that returns a promise. That means it maintains a state, and the second time this code runs onward it will return immediately. promisethatLoadsVar.then(function(value) { myvar = value; doSomeTreatment(myvar); }) If you could give a clearer question I'd love to provide a clearer answer for you. Edit: I want to elaborate on the example posed in the comments. Here is a solution using the LoDash library. (BTW, you should use lodash or underscore, they are basically the standard library of javascript). var getData = _.once(function() { return $.getJSON(...) }); $('button').on('click', function() { getData().then(function(data) { showDialog(data) }) }) Note here that getData is a wrapped function that after the first invocation will just return the same thing over and over without re-invoking the function. The first time you invoke it, it will return a promise that resolves when data is retrieved. The second time onward you get back the same promise which will likely already be resolved. Do you want to pass in parameters to getData? var getData = _.memoize(function(id) { return $.getJSON(url+id) }); $('button').on('click', function() { getData($('#selector').val()).then(function(data) { showDialog(data) }) }) This will do the same thing, but cache the promises by the first input parameter passed to getData.
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44758521
score: 1
has comment: http://stackoverflow.com/comment/44758179
answers question: http://stackoverflow.com/q/28194853
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28194853

http://stackoverflow.com/q/28159779
has body: I have a function that renders the HTML code from a textarea into a div of a certain size. The size of this div is determined when the page loads and is generally about 45% the width of the browser. I would like to know if there is any way to constrain what is rendered to not go out of the bounds of this div, but to instead add scrollbars if the rendered content exceeds the boundaries. Basically, I'd like this div to behave like a browser window would when you render an HTML web page. Here is the code I have that does the rendering: $(document).ready(function(){ $("#showmeImg").click(function(){ $("#outputContainer").html($(myEditor.getValue())); }); }); So when 'showmeImg' is clicked, the contents of 'myEditor' is rendered and place within the 'outputContainer' div tag. All I have for this div tag are basic styling like background color, width, and height.
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has title: How to constrain rendered HTML code inside a div
accepted answer: http://stackoverflow.com/a/28159886
has answer: http://stackoverflow.com/a/28159893
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28159872
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28159872
has answer: http://stackoverflow.com/a/28159886

http://stackoverflow.com/q/28219080
has body: I am trying to apply bootstrap popover to a DOM element. I apply the popoover immediately the view is ready -popover('show' I apply it in the compositionComplete method of bootstrap and realize that the element is not property centered horizontally. It is pushed to the right a little too much. If I remove the popover('show') and only makes it visible when on hover, all works well. If I leave the popover'show' and force the popover to apply after 1sec, all works fine. It therefore seems as the viewattached is called too early, hence the popover calculations of the position are incorrect. How can I fix this please. Below is my method function compositionComplete(view, parent) { //setTimeout(function() { --works if I all this $(element).popover({ placement: 'bottom', //trigger: 'hover', template: '&lt;div class="popover" role="tooltip"&gt;&lt;div class="arrow"&gt;&lt;/div&gt;&lt;h3 class="popover-title"&gt;&lt;/h3&gt;&lt;div class="popover-content"&gt;&lt;/div&gt;&lt;/div&gt;', content: 'This is the content', title: 'Start here', }).popover('show'); //, 1000) }
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: durandal
has title: Durandal: compositionComplete called too early
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45010331
has comment: http://stackoverflow.com/comment/45157324
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28256506
score: 7
has body: I'm trying to predictably shuffle javascript arrays the same way each time the webpage is loaded. I can shuffle the arrays randomly, but every time i reload the page it's a different sequence. I'd like it to shuffle the arrays the same way every time the page loads. There are many arrays and they are part of a procedurally generated world.
has comment: http://stackoverflow.com/comment/44871226
favorite count: 0
has comment: http://stackoverflow.com/comment/44871329
has title: Predictable Javascript array shuffle
upvote count: 8
tagged with: repeat
linked to: http://stackoverflow.com/q/16801687
has comment: http://stackoverflow.com/comment/44871414
has answer: http://stackoverflow.com/a/28256743
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/55480964
has comment: http://stackoverflow.com/comment/44871261
downvote count: 1
duplicate of: http://stackoverflow.com/q/16801687
has answer: http://stackoverflow.com/a/28256573
tagged with: javascript
has comment: http://stackoverflow.com/comment/44871301
type: Question
tagged with: random
answer count: 3
tagged with: arrays

http://stackoverflow.com/comment/44642372
has text: My example converting the promise rejection into an exception doesn't work, I've removed it. It doesn't work because, as I flagged up, control has already moved out of the `try/catch` before you throw it. I've removed it from the answer, sorry about that.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28134974

http://stackoverflow.com/comment/44675805
comment on: http://stackoverflow.com/a/28152284
has text: Syntax error: `Uncaught SyntaxError: Unexpected token var` http://jsfiddle.net/d5pm5sve/
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28142351
tagged with: canvas
accepted answer: http://stackoverflow.com/a/28142612
score: 10
tagged with: javascript
has title: Canvas lineTo() drawing y coordinate in wrong place
answer count: 2
upvote count: 10
has answer: http://stackoverflow.com/a/28142612
favorite count: 0
has answer: http://stackoverflow.com/a/32076729
has comment: http://stackoverflow.com/comment/44656388
has body: I'm trying to draw some rectangles on a canvas using ctx.lineTo(). They get drawn but the y coordinate is never right. The rectangles become too tall and on the wrong place on the y axis. When I step through with the debugger it shows the y coordinates within the lineTo() methods as being correct, but I made a canvas.click event to alert the coordinates (which are correct as I click in the top left and it alerts (0,0)). The click event shows that the y coordinate is not actually where it states it will be drawn in the lineTo() method. The x coordinate is however always correct. One thing to be considered is I create my canvas by appending html to an element with javascript, and I add an image to it that I draw on. I rescale the coordinates of the rectangles so they are appropriately place on the canvas which is scaled to the image size that works for the size of the device. Here is all my code from canvas creation to using the lineTo() method. Canvas gets created in early stages of this method (in appendPicture()): function appendSection(theSection, list) { list.append(' ' + theSection.description + ' '); if (theSection.picture) { appendPicture(list, theSection); var canvas = document.getElementById('assessmentImage'); var ctx=canvas.getContext("2d"); canvas.addEventListener("mousedown", relMouseCoords, false); var img=new Image(); img.onload = function() { ctx.drawImage(img, 0, 0,canvas.width,canvas.height); } img.src = "data:image/jpeg;base64,"+ theSection.picture; img.addEventListener('load', function() { if(theSection.allHotSpots.length > 0) { for( var x = 0; x < theSection.allHotSpots.length; x++) { appendHotSpot(theSection.allHotSpots[x], theSection.thePicture, ctx); } } }, false); } appendSectionQuestions(theSection, list); if (theSection.allSubSections) { for (var x = 0; x < theSection.allSubSections.length; x++) { var theSectionA = theSection.allSubSections[x]; appendSection(theSectionA, list); } } } Here is appendPicture which creates the canvas html and a…
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/32076729
type: Question

http://stackoverflow.com/q/28253435
type: Question
tagged with: javascript
has body: I have an application communicating with a device via serial port. Every sent command is answered by a data event containing the status/answer. Basically there are commands changing the device and a command which just returns the status. Every time the last command has been answered (so upon receiving data) the app should send the next command or as a default query the status. I'm trying to model this with rxjs. My idea here is that there is a command observable and a data observable derived from the data event. These two should be combined in such a way, that the resulting observable only emits values, when there is data and combine it with a command or the default command (request status), if no command came down the command stream. data: ---------d---d-----d---------d------d------- command: --c1---c2----------------------c3----------- ______________________________________________________ combined ---------c1--c2----dc--------dc-----c3 dc is the default command. Also no commands should be lost. Currently I have an implementation with a anonymous subject, implementing the observable and observer myself. Collecting commands from the command stream in an array, subscribing to the data event, publish the data by hand with onNext and sending the next command from the array or the default. This works, but I have the feeling this could be expressed more elegantly with rxjs. One approach was to have a separate default_command stream, repeating the default command every 100ms. This was merged with the command stream and then zipped with the data stream. The problem here was the merged command stream, because it piled up default commands, but the default command should only apply, if there is no other command.
answer count: 3
has answer: http://stackoverflow.com/a/42042630
downvote count: 0
tagged with: rxjs
favorite count: 0
has answer: http://stackoverflow.com/a/28291718
type: UnansweredQuestion
score: 1
upvote count: 1
has title: Combine Observables A and B: Should only trigger if A has data; take from B if data or default
has answer: http://stackoverflow.com/a/30335740

http://stackoverflow.com/a/28165772
type: Answer
answers question: http://stackoverflow.com/q/28165517
has body: Find the below code using jQuery HTML Others A B C jQuery $('#chk').change(function(){ if($('#chk').is(':checked')){ $('#that_select').removeAttr('disabled'); } else{ $('#that_select').attr('disabled','disabled'); } }); JSFIDDLE DEMO
score: 0

http://stackoverflow.com/comment/44889556
score: 1
comment on: http://stackoverflow.com/q/28252208
has text: I don't think that option exist "out-of-the-box", these are your options `features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],`
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28272587
type: Question
has body: The following is the code I have so far. Currently the sign-up and join links are on the top left. I want these to be in a drop down menu. So on the top left I want to have a drop down menu, that when I hover over the menu these two links appear there and when I click them the same pop up appears in the middle of the screen. Clipmarks - Online Bookmark Application Username (or email address) Password Forgot Password Your email address Password Username (or email address) ClipMarks Sign In Join About Us
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
favorite count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28272848
has comment: http://stackoverflow.com/comment/44900392
has title: I want to create a pop up box. That should be accessed using the drop down menu

http://stackoverflow.com/a/28276503
answers question: http://stackoverflow.com/q/28276133
type: Answer
has comment: http://stackoverflow.com/comment/44908044
has comment: http://stackoverflow.com/comment/44907590
has body: This line: UserCreateInputModel.prototype.validate = function() { console.log('Validating...'); if(this.password !== this.repeatPassword) throw new Error('Passwords are not equal!'); }; is modifying the InputModel object. If you have two different types "inheriting" from InputModel with what you have here, and they both have validate methods, then one is overwriting the other. To properly inherit from InputModel, use Object.create(): UserCreateInputModel.prototype = Object.create(InputModel.prototype); And then call the parent constructor from your child constructor: var UserCreateInputModel = function(req) { InputModel.call(this, &lt;arguments&gt;); This way, when you modify UserCreateInputModel.prototype, you will only be modifying UserCreateInputModel.prototype and not anything else.
score: 0
has comment: http://stackoverflow.com/comment/44907461
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28276133
has comment: http://stackoverflow.com/comment/44907894

http://stackoverflow.com/a/28136163
has body: Seems like you have an answer here From the answer: "The only way to solve the problem for all users that might be viewing your page is to break up the number of iterations your loop performs using timers, or refactor your code so that it doesn't need to process as many instructions." So the first approach can be attained using a timeout for each such large iteration.
upvote count: 1
answers question: http://stackoverflow.com/q/28136129
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28145458
accepted answer: http://stackoverflow.com/a/28145622
has answer: http://stackoverflow.com/a/28145589
tagged with: javascript
has answer: http://stackoverflow.com/a/28145496
score: 0
has comment: http://stackoverflow.com/comment/44662736
has comment: http://stackoverflow.com/comment/44662733
possible better answer: http://stackoverflow.com/a/28145496
tagged with: regex
has title: Adding attributes to all html tags
tagged with: php
has answer: http://stackoverflow.com/a/28145622
type: Question
type: AnsweredQuestion
answer count: 3
has body: I want to add id="draggable" attributes to all tags. For example - should change to abcd should change to abcd This should apply to all tags except Any suggestion?
has comment: http://stackoverflow.com/comment/44662843

http://stackoverflow.com/a/28230943
has comment: http://stackoverflow.com/comment/44824433
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28230883
accepted answer of: http://stackoverflow.com/q/28230883
type: Answer
has body: What you've discovered is that updating the value of the &lt;input&gt; updates its value property (HTMLInputElement.value), but not the value attribute (&lt;input value="..."&gt;). I'd suggest, though I'm unsure of any performance benefits, the following: // selects the collection of elements represented by the selector, // then filters that collection: $("#pos_transaction_line_line input.item_number").filter(function(){ // retains those &lt;input&gt;s the length of whose value property // is zero: return this.value.length === 0; // then retrieves the first element (as a jQuery object still): }).eq(0); The above approach does suffer from the fact that it will, however, retrieve all elements matching the selector, and then loop through those elements in the filter() method, before returning the first-match in the page. This does confer a performance penalty, but is presented as an alternative to use of the each() in the event that you may need to broaden the selection when faced with different circumstances and requirements. References: eq(). filter().
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44824269

http://stackoverflow.com/comment/44653950
has text: @Ben What makes you think that people use `Function.prototype.bind()` for memory related issues? If you know what **bind** does, then you've answered your question.
type: QuestionComment
comment on: http://stackoverflow.com/q/28140975
score: 0
type: Comment

http://stackoverflow.com/comment/44712426
comment on: http://stackoverflow.com/a/28171513
type: Comment
has text: OK. I hope it will be enough. Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28220630
score: 0
answers question: http://stackoverflow.com/q/28208031
type: Answer
has comment: http://stackoverflow.com/comment/44805598
has comment: http://stackoverflow.com/comment/44805147
has body: I hate to be a tenth answerer, but all of the given answers are bad. You understand that else if (0.34 &lt; computerChoice &lt; 0.66) { is bad syntax, right? OK, so let's also solve the bias problem: 0.33 is less than a third, and all the numbers between 0.33 and 0.34 are defaulting to scissors. If you want an even distribution, the simplest way is to make a function with early exits: function computerChoice() { var v = Math.random(); if (v &lt; (1.0 / 3.0)) return "rock"; if (v &lt; (2.0 / 3.0)) return "paper"; return "scissors"; } This is as good as double-precision floating point will allow, which is more than good enough for most purposes.

http://stackoverflow.com/q/28197111
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: drag-and-drop
answer count: 0
type: UnansweredQuestion
tagged with: yui3
has body: I am new to YUI. I am wanting to achieve a drag and drop operation with contstraints. I am following the simple YUI 3 guide and was able to achieve the drag and drop according to the code they given which is. http://yuilibrary.com/yui/docs/dd/scroll-list.html HTML Item #1 Item #2 Item #3 Item #4 Item #5 Item #6 Item #7 Item #8 Item #9 Item #10 Item #11 Item #12 Item #1 Item #2 Item #3 Item #4 Item #5 Item #6 Item #7 Item #8 Item #9 Item #10 Item #11 Item #12 CSS yui3-dd-proxy { text-align: left; } #demo { width: 600px; } #demo { border: 1px solid black; padding: 10px; margin: 10px; zoom: 1; } #demo ul li { border: 1px solid black; background-color: #8DD5E7; cursor: move; margin: 3px; list-style-type: none; } #demo:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;} #demo ul { border: 1px solid black; margin: 10px; width: 200px; height: 400px; float: left; padding: 0; zoom: 1; position: relative; overflow: auto; } #demo ul li.list1 { background-color: #8DD5E7; border:1px solid #004C6D; } #demo ul li.list2 { background-color: #EDFF9F; border:1px solid #CDCDCD; } Javascript YUI().use('dd-constrain', 'dd-proxy', 'dd-drop', 'dd-scroll', function(Y) { //Listen for all drop:over events //Y.DD.DDM._debugShim = true; Y.DD.DDM.on('drop:over', function(e) { //Get a reference to our drag and drop nodes var drag = e.drag.get('node'), drop = e.drop.get('node'); //Are we dropping on a li node? if (drop.get('tagName').toLowerCase() === 'li') { //Are we not going up? if (!goingUp) { drop = drop.get('nextSibling'); } //Add the node to this list e.drop.get('node').get('parentNode').insertBefore(drag, drop); //Set the new parentScroll on the nodescroll plugin e.drag.nodescroll.set('parentScroll', e.drop.get('node').get('parentNode')); //Resize this nodes shim, so we can drop on it later. e.drop.sizeShim(); } }); //Listen for all drag:drag events Y.DD.DDM.on('drag:drag', function(e) { //Get the last y point var y = e.target.lastXY[1]; //is it greater than …
upvote count: 1
tagged with: draggable
has title: YUI 3 drag and drop with Constraints
score: 1
type: Question

http://stackoverflow.com/comment/44878645
has text: Why do you need a ternary expression? Why not just use `Animation1 = !buttonPressed;` ?
comment on: http://stackoverflow.com/q/28260702
type: QuestionComment
score: 6
type: Comment

http://stackoverflow.com/a/28277994
has body: your question is quite broad; so I’ll try to do my best to give you some kind of answer. First of all I’d use variables of global scope when declaring variables: withones and withoutOnes. Secondly, you wanted to avoid repetition in your code. Well, for that purpose I’d use JavaScript Arrays. In an array, you can add your variables as objects. In an object you can have your ids and other data “packed” neatly in the array, which in turn helps your code to become efficient. Below is an array with objects: objectArray = [{ id: "withones", checked: false, method: function () { return 2 + 2; } }, { id: "withoutOnes", checked: false, method: function () { return 'blah'; } }]; The above array can be used in your $('.checkboxes :checkbox').click(function() handler and add() function to avoid repetition. The updated code is below where jQuery's each() method is used for looping Array elements. The last a bit of your question was related to add() function. Well, this was the tricky bit of your question, and I tried to use a callback function hopefully in the right way to execute your functions from the array. In the add method I tried to follow this answer: https://stackoverflow.com/a/13343452/2048391 About the last bit I’m not 100% sure did I use a callback function in the right way; so I hope someone more familiar with these tricky JavaScript functions can correct me, if something needs to be changed –thanks. objectArray = [{ id: "withones", checked: false, method: function () { return 2 + 2; } }, { id: "withoutOnes", checked: false, method: function () { return 'blah'; } }]; $(document).ready(function () { $('.checkboxes :checkbox').click(function () { var id = this.id; var checkedValue = this.checked; $.each(objectArray, function (index, object) { if (object.id === id) { object.checked = checkedValue; } }); add(); }); function add() { // clear results $("#addResults").text(""); $.each(objectArray, function (index, object) { if (object.checked === true) { var returnValue = …
has comment: http://stackoverflow.com/comment/44910530
answers question: http://stackoverflow.com/q/28276123
type: Answer
score: 0

http://stackoverflow.com/q/28141271
tagged with: django
type: AnsweredQuestion
has body: Just trying to get my JSON file to update my google maps location data every 5 seconds. At the moment the initial dataset loads, but the contnuous stream from the json file does not seem to load correctly. Here is the code i have been using in my Django project. $(function() { var locations = {};//A repository for markers (and the data from which they were constructed). var MAPS_URL = "{% url 'alarmviewer:maps' %}"; //initial dataset for markers var locs = { 1: { info:'11111. Some random info here', lat:40.538834, lng:-74.555049 }, //these values are wrong 2: { info:'22222. Some random info here', lat:40.543127, lng:-74.606598 }, 3: { info:'33333. Some random info here', lat:40.544770, lng:-74.632273 }, 4: { info:'44444. Some random info here', lat:40.489954, lng:-74.586175 } }; var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 11, center: new google.maps.LatLng(40.5000, -74.6203), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var auto_remove = true;//When true, markers for all unreported locs will be removed. function setMarkers(locObj) { if(auto_remove) { //Remove markers for all unreported locs, and the corrsponding locations entry. $.each(locations, function(key) { if(!locObj[key]) { if(locations[key].marker) { locations[key].marker.setMap(null); } delete locations[key]; } }); } $.each(locObj, function(key, loc) { if(!locations[key] &amp;&amp; loc.lat!==undefined &amp;&amp; loc.lng!==undefined) { //Marker has not yet been made (and there's enough data to create one). //Create marker loc.marker = new google.maps.Marker({ position: new google.maps.LatLng(loc.lat, loc.lng), map: map }); //Attach click listener to marker google.maps.event.addListener(loc.marker, 'click', (function(key) { return function() { infowindow.setContent(locations[key].info); infowindow.open(map, locations[key].marker); } })(key)); //Remember loc in the `locations` so its info can be displayed and so its marker can be d…
linked to: http://stackoverflow.com/q/14771422
tagged with: http://stackoverflow.com/tag/json
has title: Google maps JSON not Updating
has answer: http://stackoverflow.com/a/28142141
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: google-maps-api-3
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28142141

http://stackoverflow.com/comment/44668816
has text: @DavidThomas That'd mean using ``document.querySelectorAll("*.country")`` instead right?
comment on: http://stackoverflow.com/a/28148694
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44669265
score: 2
comment on: http://stackoverflow.com/q/28148962
type: Comment
type: QuestionComment
has text: You have a bunch of broken strings missing quotes, you're using php variables in your JavaScript, which is simply not possible like that, and you'll finish counting `$i` before the script even gets to the JS part.

http://stackoverflow.com/a/28255809
has comment: http://stackoverflow.com/comment/44872874
has comment: http://stackoverflow.com/comment/44870620
has comment: http://stackoverflow.com/comment/44870161
has comment: http://stackoverflow.com/comment/44870244
score: 0
has comment: http://stackoverflow.com/comment/44870991
answers question: http://stackoverflow.com/q/28255571
type: AcceptedAnswer
has body: UPDATE this is a .js file, its taken from ajax chat It won't work inside a .js file, because those files are not parsed by PHP. It can be set up so that they get parsed, but I strongly suggest you don't do it, ever. Besides, you don't need PHP for what you're doing. ORIGINAL ANSWER This is not a proper PHP inside this line: + '&lt;/a&gt;&lt;?php echo \'&lt;img src="test.php" /&gt;\' ?&gt;' Or just to strip the PHP part: &lt;?php echo \'&lt;img src="test.php" /&gt;\' ?&gt; To get it to work, you need to remove those escaped quotes (you don't need to worry about JS quotes, because PHP parser will hit the file first, leaving you with whatever you echoed), and add a semi-colon: &lt;?php echo '&lt;img src="test.php" /&gt;'; ?&gt; and the full line should be: + '&lt;/a&gt;&lt;?php echo '&lt;img src="test.php" /&gt;'; ?&gt;' which will render as: + '&lt;/a&gt;&lt;img src="test.php" /&gt;' It doesn't really make sense to use PHP for this, but okay. Of course, it has to be inside a file that the server will parse with PHP (.php files by default, strongly suggest you don't set up PHP parsing for JS files). You never answer about the filetype in the comments.
type: Answer
has comment: http://stackoverflow.com/comment/44872547
has comment: http://stackoverflow.com/comment/44870583
accepted answer of: http://stackoverflow.com/q/28255571
has comment: http://stackoverflow.com/comment/44870029

http://stackoverflow.com/a/28148119
type: AcceptedAnswer
type: Answer
has body: You need some Javascript for that. For instance: document.body.addEventListener( 'mouseover', function( event ) { if( event.target.classList.contains( 'hov' ) ) { [].forEach.call(document.getElementsByClassName( 'hov' ), function( elem ) { elem.classList.add( 'hover' ); }); } }); document.body.addEventListener( 'mouseout', function( event ) { if( event.target.classList.contains( 'hov' ) ) { [].forEach.call(document.getElementsByClassName( 'hov' ), function( elem ) { elem.classList.remove( 'hover' ); }); } }); And you need to create a css class called hover which applies the same properties in this scenario. Demo: http://jsfiddle.net/1LkfbcLx/
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/44667856
accepted answer of: http://stackoverflow.com/q/28148040
answers question: http://stackoverflow.com/q/28148040
upvote count: 7

http://stackoverflow.com/comment/44748468
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28190200
has text: use eval function to do so

http://stackoverflow.com/comment/44805147
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28220630
type: AnswerComment
has text: I've noticed you left out an else if/else keyword. Are you implying that the program will just run over them and select the correct choice it picks up first?

http://stackoverflow.com/q/28137668
has answer: http://stackoverflow.com/a/28137706
favorite count: 0
has answer: http://stackoverflow.com/a/28137742
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28137726
tagged with: php
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28137727
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28137726
tagged with: javascript
has title: Javascript Function with PHP IF
has comment: http://stackoverflow.com/comment/44647017
tagged with: get
tagged with: function
has body: Hi there I want to ask something very simple , unfortunately I run out of ideas , I want a function when is being $GET to do a JavaScript function straight away, but I just want to make sure that's how you do it... 8 <?PHP if(isset($_GET['id'])) { watch () <<<ISSUE //run that function if ittselts GET } ?>
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28137706

http://stackoverflow.com/comment/44862230
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28251170
type: Comment
has text: Before you accept an answer, why don't you check it and make sure it actually does what you are asking. The one you accepted does not. It does not even create an array. The object it does create does not contain the non-numeric values.

http://stackoverflow.com/q/28197846
answer count: 2
has comment: http://stackoverflow.com/comment/44762339
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has body: how to map image and text in html? suppose image is there in image folder and text is coming from DB? How to put them in one place in a web page? suppose milkbottel is there in my image folder and milkbottle text is comming from the db so how to ** map dynamically ** this two in a way that milkbottle image and milk bottle text will be in one place in a web page?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28199071
has title: How to map image and text coming from different source?
has comment: http://stackoverflow.com/comment/44762520
has answer: http://stackoverflow.com/a/28198205
type: AnsweredQuestion
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/28198205
tagged with: jsp
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44762682
accepted answer: http://stackoverflow.com/a/28199071

http://stackoverflow.com/a/54038329
has comment: http://stackoverflow.com/comment/129692085
type: Answer
upvote count: 20
answers question: http://stackoverflow.com/q/28230845
has comment: http://stackoverflow.com/comment/100302207
has body: I've created a library sysend.js for sending messages between browser tabs and windows. The library doesn't have any external dependencies. You can use it for communication between tabs/windows in the same browser and domain. The library uses BroadcastChannel, if supported, or storage event from localStorage. The API is very simple: sysend.on('foo', function(data) { console.log(data); }); sysend.broadcast('foo', {message: 'Hello'}); sysend.broadcast('foo', "hello"); sysend.broadcast('foo', ["hello", "world"]); sysend.broadcast('foo'); // empty notification When your browser supports BroadcastChannel it sends a literal object (but it's in fact auto-serialized by the browser) and if not, it's serialized to JSON first and deserialized on another end. The recent version also has a helper API to create a proxy for cross-domain communication (it requires a single HTML file on the target domain). Here is a demo. The new version also supports cross-domain communication, if you include a special proxy.html file on the target domain and call proxy function from the source domain: sysend.proxy('https://target.com'); (proxy.html is a very simple HTML file, that only have one script tag with the library). If you want two-way communication you need to do the same on other domains. NOTE: If you will implement the same functionality using localStorage, there is an issue in Internet Explorer. The storage event is sent to the same window, which triggers the event and for other browsers, it's only invoked for other tabs/windows.
score: 20
downvote count: 0

http://stackoverflow.com/a/28203745
has comment: http://stackoverflow.com/comment/44773796
has comment: http://stackoverflow.com/comment/44773525
accepted answer of: http://stackoverflow.com/q/28203671
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44774188
has body: Your error is coming from the __DIR__ which is not defined in your showHint function. Remove this or update it to the correct path in which you're storing your autocomplete dictionary and you should be good. To echo __DIR__ as the path to your gethint.php file, do the following: xmlhttp.open("GET","&lt;?php echo __DIR__; ?&gt;/gethint.php?q=" + str, true); However, i'm going to assume that you're not wanting to do __DIR__ as your path. Ultimately it's up to you to figure out how to set the path to your gethint.php file. We do not know the directory structure of your application or how where you have files stored.
has comment: http://stackoverflow.com/comment/44774166
score: 1
has comment: http://stackoverflow.com/comment/44774948
has comment: http://stackoverflow.com/comment/44773643
has comment: http://stackoverflow.com/comment/44773875
has comment: http://stackoverflow.com/comment/44773620
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44775191
answers question: http://stackoverflow.com/q/28203671
has comment: http://stackoverflow.com/comment/44773540

http://stackoverflow.com/a/28253172
accepted answer of: http://stackoverflow.com/q/28245441
has body: There is no real "best" way, although I'd advise against using variable names to signify types. If you need to support custom types, color for example, I would take the following approach: My approach would be to add a type to all objects yourself, as a property: var date = { value: "31/01/2015", type: "date" }; You could also add a type object, as a sort of enum, so you won't spell your types wrong any time. var types = { date: "date", number: "number" }; This is not needed as long as you use native JavaScript types, like number, string, date and such. In my own property browser experiment, I simply use typeof to determine what type an object is. JavaScript only has a few basic types (array, undefined, string, number, boolean and function), however, there's a hidden property that you can use to separate a RegEx or a date from an object. // this function was taken from https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/ function toType(obj) { return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); } typeof /aregex/ === "object" // true typeof new Date() === "object" // true toType(/aregex/) === "regexp" // true toType(new Date()) === "date" // true For some more inspiration, you can take a look at my experimental property browser, it supports numbers, objects, booleans and functions. Since I couldn't answer your question precisely, I hope this general information can help you find the answer.
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28245441
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28230012
has answer: http://stackoverflow.com/a/28272025
has title: Intl.NumberFormat#format maximum integer value
has body: In ECMAScript Internationalization API 1.0 spec, NumberFormat object has a format function which takes in a value and formats the number according to NumberFormat object. What is the maximum value NumberFormat#format function can digest? In Chrome, and Firefox running below: new Intl.NumberFormat().format(1111111111111111); // =&gt; "1,111,111,111,111,110" // ^ // 16th digit It seems that anything after 15th digit is converted to 0. I had a quick look at the spec, but couldn't figure out why. Does anyone know why? Maybe because the above ES5 spec follows IEEE 754 specification? Can't think of anything else…
tagged with: ecmascript-intl
tagged with: internationalization
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28272025
upvote count: 2
answer count: 1
tagged with: number-formatting
favorite count: 0

http://stackoverflow.com/comment/44664295
score: 0
comment on: http://stackoverflow.com/q/28145975
has text: What is the significance of such assignment when the internal logic of the function is same. You should rather choose a generic name for your method to avoid such things and increase readability. This will reduce the LOC as well :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44911506
score: 0
has text: Any error messages? Why remove all child nodes if you're replacing the innerHTML anyway? Try it without that `while` loop.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28278251

http://stackoverflow.com/comment/44834903
type: Comment
has text: It will work with (0 to infinity) if you want to add them all. The code is seperated from the data - it will check what is selected when you click the button and then use whatever the `value` is as the url. This makes it endlessly scalable.
comment on: http://stackoverflow.com/a/28236409
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44689485
type: Comment
comment on: http://stackoverflow.com/a/28158232
type: AnswerComment
has text: Brilliant, thank you so much. Will up vote soon as I have my reputation up (new to SOF).
score: 0

http://stackoverflow.com/q/28145767
possible better answer: http://stackoverflow.com/a/31137808
tagged with: javascript
has answer: http://stackoverflow.com/a/31137808
favorite count: 0
has comment: http://stackoverflow.com/comment/44663648
has answer: http://stackoverflow.com/a/28161294
has title: How can I find the closest coordinates in google map
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44691223
upvote count: 1
accepted answer: http://stackoverflow.com/a/28161294
type: Question
has comment: http://stackoverflow.com/comment/44691486
has comment: http://stackoverflow.com/comment/44689860
has body: I'm currently using an input field where, upon entering an address, the user will be given directions to the closest marker on a Google map. What I have gotten to work so far is the ability for someone to click on a marker, click "Get Directions", which invokes the calcRoute function in javascript and supplies the user with directions. However, I still can't find a way to have the longitude and latitude of the closest marker be found dynamically when someone enter an address . Can anyone help me? Locaiton 1 Location 2 Updated the calcRoute function and added find_closest_marker function however I keep getting a Uncaught InvalidValueError: in property destination: not a string; and not a LatLng or LatLngLiteral: not an Object error. It seems my calcRoute function keeps executing without waiting for a result from the find_closest_marker function. function find_closest_marker( address ) { var lat, lng, pos; var closestMarker = -1; var closestDistance = Number.MAX_VALUE; geocoder.geocode( { 'address': address}, function(results, status) { // and this is function which processes response if (status == google.maps.GeocoderStatus.OK) { lat = results[0].geometry.location.lat(); lng = results[0].geometry.location.lng(); pos = new google.maps.LatLng(lat, lng); for( i=0;i<markers.length; i++ ) { var distance = google.maps.geometry.spherical.computeDistanceBetween(markers[i].getPosition(), pos); if ( distance < closestDistance ) { closestMarker = i; closestDistance = distance; } } } lat = markers[closestMarker].position.lat(); lng = markers[closestMarker].position.lng(); pos = new google.maps.LatLng(lat, lng); return pos; }); } function calcRoute(lat, lg) { var start, end; start = document.getElementById('start').value; if (!lat) { end = find_closest_marker(start); } else { end = lat + ',' + lg; } var request = { origin: start, destination: end, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.…
score: 1
tagged with: google-maps-api-3
answer count: 2
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44687339
downvote count: 0

http://stackoverflow.com/comment/44706397
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28168051
type: QuestionComment
has text: What do you mean by "select" the dropdown item? What exactly do you want to happen when you click on a menu item?

http://stackoverflow.com/comment/44843955
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28181716
has text: Thank you very much, but It is still very clumsy to create a connection using Parse.com.
type: AnswerComment

http://stackoverflow.com/a/28205323
has comment: http://stackoverflow.com/comment/44776433
score: 0
has comment: http://stackoverflow.com/comment/44776540
answers question: http://stackoverflow.com/q/28205234
type: Answer
has comment: http://stackoverflow.com/comment/44776434
has comment: http://stackoverflow.com/comment/44776421
has body: JavaScript does not have arrays the way they are implemented in most other languages. The docs state: Arrays are list-like objects whose prototype has methods to perform traversal and mutation operations. ar[i] notation merely refers to property i of object ar that could be numeric. The following is perfectly legal in JavaScript: var ar={}; ar[1] = 1; ar[3] = 2; We still call it an array. But it does not have to have contiguous indices. What should be noted, that length property of such array will be 3 (the largest value of its index). So the most logical way to think about JS arrays as special objects (see the quote from docs above) with numeric properties.

http://stackoverflow.com/a/28179902
has body: Your ajax call is an asynchronous call. Your app fires a request to "/Together/TogetherServlet?action=GetEvents" but the script keeps running, and instances the Heatmap before the request returns any actual data, therefore you are creating a Heatmap with an empty jsonArray. The solution here is to instance the heatmap inside the ajax success handler. $.ajax({ url: "/Together/TogetherServlet?action=GetEvents", type: "GET", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { $.each(data, function (i, jsondata) { var jsonObject = {}; jsonObject.xcoord = jsondata.xcoord; jsonObject.ycoord = jsondata.ycoord; jsonArray.push(new google.maps.LatLng(jsonObject.ycoord, jsonObject.xcoord)); }); var pointArray = new google.maps.MVCArray(jsonArray); heatmap = new google.maps.visualization.HeatmapLayer({ data: pointArray, map: map, radius: 40, gradient: gradient }); } }); Also, you don't really need to instance a new heatmap on every function call. I suggest refreshing just its data var heatmap = new google.maps.visualization.HeatmapLayer({ data: [], map: null, radius: 40, gradient: gradient }); function updateHeatmap(){ heatmap.setMap(null); var jsonArray = []; $.ajax({ url: "/Together/TogetherServlet?action=GetEvents", type: "GET", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { $.each(data, function (i, jsondata) { var jsonObject = {}; jsonObject.xcoord = jsondata.xcoord; jsonObject.ycoord = jsondata.ycoord; jsonArray.push(new google.maps.LatLng(jsonObject.ycoord, jsonObject.xcoord)); }); var pointArray = new google.maps.MVCArray(jsonArray); heatmap.setData(pointArray); heatmap.setMap(map); } }); }
downvote count: 0
answers question: http://stackoverflow.com/q/28134114
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44769336
has text: Thanks @PeterLyons. I always try to avoid async library because of issues I have had with it previously. But I suppose it's time to learn it!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28185039
score: 0

http://stackoverflow.com/q/28267158
downvote count: 1
has title: Array of input values where id contains specific text - Jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28267210
accepted answer: http://stackoverflow.com/a/28267210
has answer: http://stackoverflow.com/a/28267206
type: AnsweredQuestion
upvote count: 0
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: -1
possible better answer: http://stackoverflow.com/a/28267206
has body: I have this code here: $('*[id*=ask]:visible').each(function questions() { pollQuestions = $(this).val(); }); This only displays the latest input's value from a row of inputs. (I am appending more inputs with a click). I want instead an array of all inputs' values. The appended inputs have id's like 'id="ask[1]"', 'id="ask[2]"', etc. Thank you

http://stackoverflow.com/comment/44804639
type: QuestionComment
has text: I guess for starters, you'd probably want to learn Javascript and/or jQuery! Stack Overflow usually functions to help people debug problems they're having with code *they've already written*, rather than to write your code *for* you. :P
comment on: http://stackoverflow.com/q/28219697
score: 0
type: Comment

http://stackoverflow.com/comment/54779043
type: QuestionComment
comment on: http://stackoverflow.com/q/28213329
has text: @commandantp Did you have any luck with this I am facing the same issue with `laravel-session` cookie value
score: 0
type: Comment

http://stackoverflow.com/comment/44654278
has text: You must get the PHP side ready to accept the ajax request.
comment on: http://stackoverflow.com/q/28141263
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28274411
score: 0
has body: Try like this without using javascript: .tooltip { display: none; } .mouseover:hover .tooltip{ display:block; } Check out this fiddle:http://jsfiddle.net/mncknja0/
has comment: http://stackoverflow.com/comment/44903996
type: Answer
answers question: http://stackoverflow.com/q/28274250

http://stackoverflow.com/q/28150592
has answer: http://stackoverflow.com/a/28151733
score: 3
upvote count: 3
type: Question
has title: Difference between d3.js and d3.v3.js
has body: What is the difference between d3.js and d3.v3.js? I didn't find any declaration in office website, but it seems the one downloaded from github repository is d3.js/d3.min.js, but the office CDN is d3.v3.js? Are they the same?
tagged with: javascript
has answer: http://stackoverflow.com/a/28159587
answer count: 3
has answer: http://stackoverflow.com/a/50188296
downvote count: 0
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/a/28163257
score: 1
has body: You can use jQuery.inArray() or function like that &lt;script&gt; var LOW_VALUE = 0.00001; function check(number) { if (number &lt; 1 || number &gt; 1.99) return false return (Math.abs(number % (1/64)) &lt; LOW_VALUE); } console.log(check(0.15625)); console.log(check(1.984375)); console.log(check(0.6)); &lt;/script&gt;
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28163149
downvote count: 0

http://stackoverflow.com/comment/44801998
comment on: http://stackoverflow.com/a/28218230
has text: Ok... It's still essentially the same problem. Your server-side code is receiving a variable called `sEcho`. You need to return `sEcho`, but it should be the value received by the server-side code.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28180564
score: 0
answer count: 0
type: UnansweredQuestion
has title: My Ajax calls are waiting for the first one to finish before it finishes
type: Question
has body: I am trying to build a tail like log viewer for my site using Ajax.. however for whatever reason, the ajax calls are waiting for the first one to finish before it completes the next call. Looking at Firebug, both calls are fired off at the same time, however the second call (which only takes a couple of ms) sits there spinning and waiting for the first call to finish (which can take many seconds). I am unsure why.. the first call that takes about 10 seconds looks like this: $.ajax({ url : "{{ url('json/import/run-import') }}", type : "POST", data : formData, contentType: false, processData: false, success : function ( data ) { if ( data.success ) { } else { flashMessage(data.severity, data.message); } }, error : function() { flashMessage("error", "An error occurred whilst running the import."); } }) For the log viewer, I am using the following code: https://github.com/ukhas/js-logtail#readme Is this a browser issue? I am using Apache on Windows (XAMPP) and Firefox.
has comment: http://stackoverflow.com/comment/44730552
has comment: http://stackoverflow.com/comment/44730448
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/a/28159272
answers question: http://stackoverflow.com/q/28158624
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44895295
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28158624
has body: Change the insert to an update. ComicsList.update({_id:this._id}{$set{publisher: publisherVar, superhero: superheroVar, appearance: firstAppearance, coverImage: coverImage, imgDescript: imgDescript }}); this._id, refers to the current document, if you have the submit inside an {{#each}}, it will work

http://stackoverflow.com/q/28127507
has answer: http://stackoverflow.com/a/70958108
downvote count: 0
answer count: 5
has answer: http://stackoverflow.com/a/28127844
has answer: http://stackoverflow.com/a/28127608
has title: Incrementing value continuously on mouse hold
has answer: http://stackoverflow.com/a/28127894
has body: I have an HTML5 'range' control to which I want to add a plus (+) and minus (-) buttons on either sides. The fiddle works fine, except that the value increase (or decrease) only once on 'click and hold'. While I want is it should increase (or decrease) continuously. Fiddle HTML, &lt;input type='button' id='minus'/&gt; &lt;div class='range-container'&gt; &lt;input id='range' type='range' min='0' max='100' step='1'/&gt; &lt;/div&gt; &lt;input type='button' id='plus'/&gt; JavaScript, $('#plus').click(function() { $('#range').val(parseInt($('#range').val()) + 1); }); $('#minus').click(function() { $('#range').val(parseInt($('#range').val()) - 1); }); HTML5 'number' control have this experience natively. Looked through SO, couldn't find this question anywhere. Closest I got is, this, which again does only one click.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44628071
has comment: http://stackoverflow.com/comment/44628576
type: Question
score: 9
has comment: http://stackoverflow.com/comment/44628611
linked to: http://stackoverflow.com/q/3977091
linked to: http://stackoverflow.com/q/50959500
has answer: http://stackoverflow.com/a/28127763
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28127894
accepted answer: http://stackoverflow.com/a/28127763
tagged with: jquery
linked to: http://stackoverflow.com/q/4080497
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44628443
favorite count: 0
upvote count: 9

http://stackoverflow.com/comment/44646929
comment on: http://stackoverflow.com/q/28136974
score: 0
type: Comment
has text: @charlietfl yes. you're right, Thank you. I've written that. working. but because I think it's not optimal, I didn't include it not to interrupt your mind. Now I've added it to the question
type: QuestionComment

http://stackoverflow.com/a/28182904
score: 2
answers question: http://stackoverflow.com/q/28182724
has comment: http://stackoverflow.com/comment/44737877
has body: If you break it down, it does the same as: var c = {}; for (var i = 0; i &lt; arr.length; i++) { var a = arr[i]; // count item for the first time if (c[a] === undefined) { c[a] = 1; // increment count } else { c[a] = c[a] + 1; } } You can keep going: if (!c[a]) { c[a] = 1 } else { c[a] += 1 } And more: c[a] = c[a] ? (c[a] + 1) : 1 Until you get: c[a] = (c[a] + 1) || 1 // OR passes because NaN (hacky) Which could also be expressed as: c[a] = (c[a] || 0) + 1
upvote count: 2
downvote count: 0
type: Answer

http://stackoverflow.com/q/28183652
has comment: http://stackoverflow.com/comment/44740213
has answer: http://stackoverflow.com/a/28184555
type: AnsweredQuestion
has body: In order to fix a text duplication bug with contenteditable areas and Meteor I did following: document_page.js: Template.documentPage.helpers({ contenteditable: function() { return '&lt;div class="content" contenteditable="true"&gt;' + this.content + '&lt;/div&gt;' }, document_page.html: &lt;div class="editor"&gt; &lt;input class="title" type="text" value="{{title}}"&gt; {{{contenteditable}}} &lt;/div&gt; The problem now is jQuery no longer works with the HTML generated by {{contenteditable}} Example: Template.documentPage.rendered = function() { $('.content').addClass('test') // &lt;--this does nothing How can I fix this?
has comment: http://stackoverflow.com/comment/44739891
has comment: http://stackoverflow.com/comment/44740184
type: Question
accepted answer: http://stackoverflow.com/a/28184555
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44739478
has title: How to make helper-generated HTML to work with jQuery (Meteor)?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: meteor
has comment: http://stackoverflow.com/comment/44739928

http://stackoverflow.com/a/28195246
answers question: http://stackoverflow.com/q/28194702
score: 0
has body: Just as an aside, a better idea than making an array out of your input might be to map it into an object. For example: var s = "name=noazet difficulty=easy"; var obj = s.split(" ").reduce(function(c,n) { var a = n.split("="); c[a[0]] = a[1]; return c; }, {}); This will give you an object that looks like this: { name: "noazert", difficulty: "easy" } Which makes getting the right values really easy: var difficulty = obj.difficulty; // or obj["difficulty"]; And this is more robust since you don't need to hard code array indexes or worry about what happens if you set an input string where the keys are reversed, for example: var s = "difficulty=easy name=noazet"; Will produce an equivalent object, but would break your code if you hard coded array indexes.
type: Answer

http://stackoverflow.com/a/28210521
score: 9
accepted answer of: http://stackoverflow.com/q/28210487
type: AcceptedAnswer
downvote count: 0
has body: If you read the doc you will understand that is not possible: Notes The alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message. Dialog boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window). Chrome users (e.g. extensions) should use methods of nsIPromptService instead.
type: Answer
upvote count: 9
answers question: http://stackoverflow.com/q/28210487

http://stackoverflow.com/comment/70705656
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28246873
has text: return date.getMonth() + 1 should be return (date.getMonth() + 1)

http://stackoverflow.com/comment/44815565
comment on: http://stackoverflow.com/a/28224803
score: 0
type: AnswerComment
type: Comment
has text: wow ... thanks for the good advice, i will try this ... everything else works great, but I really want to make certain that the user experience isn't compromised.

http://stackoverflow.com/comment/44711773
has text: Are you assigning the parsed JSON to a variable? `var obj = JSON.parse(data);`?
score: 0
comment on: http://stackoverflow.com/q/28171098
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44627459
type: AnswerComment
has text: No, I know the number before I try to insert it.
comment on: http://stackoverflow.com/a/28126931
type: Comment
score: 0

extjs5
tags question: http://stackoverflow.com/q/28167221
tags question: http://stackoverflow.com/q/28154962
tags question: http://stackoverflow.com/q/28140379
tags question: http://stackoverflow.com/q/28178097
tags question: http://stackoverflow.com/q/28195934
type: Tag
tags question: http://stackoverflow.com/q/28278057
tags question: http://stackoverflow.com/q/28279580
tag name: extjs5
tags question: http://stackoverflow.com/q/28167452

http://stackoverflow.com/comment/44670272
comment on: http://stackoverflow.com/q/28149462
type: QuestionComment
score: 5
type: Comment
has text: Use JSON.stringify(data) to convert it into string ang then try to print.

http://stackoverflow.com/comment/44797882
has text: Client-side you will probably need to use hidden fields fro clientside access of viewstate var, see this: http://stackoverflow.com/questions/6980714/how-to-access-viewstate-using-javascript
score: 0
comment on: http://stackoverflow.com/q/28217130
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28197179
has answer: http://stackoverflow.com/a/35550491
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44800119
has comment: http://stackoverflow.com/comment/44761043
upvote count: 27
downvote count: 0
linked to: http://stackoverflow.com/q/21628378
has answer: http://stackoverflow.com/a/39370249
type: Question
tagged with: arrays
tagged with: javascript
has body: I'm using AngularJS with an HTTP resource to call an external API and my response is a byte array. I need to turn this byte array into a PDF in a new window. I haven't seen any very good solutions on here that work cross browser or that are pure javascript. Is there a way to do this? Here is my code: Javascript Document.preview({id: $scope.order.id}, function(data){ // Open PDF Here var file = new Blob([data], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file); window.open(fileURL); });
tagged with: jquery
score: 27
has comment: http://stackoverflow.com/comment/44761350
answer count: 2
has title: Javascript: Open PDF in new tab from byte array
tagged with: http://stackoverflow.com/tag/pdf
favorite count: 0
linked to: http://stackoverflow.com/q/21729451
tagged with: angularjs

http://stackoverflow.com/comment/44801439
has text: This should work, and you could define the property as an argument of [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) rather than call `Object.defineProperty` afterwards. http://jsfiddle.net/Xotic750/j66peg0z/
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28218769

http://stackoverflow.com/q/28189981
has body: I have a variable in a JavaScript say like this var divId = 2; now I want to define some variable which will be like this var day_2_0 = $("#rules_" + divId + "_offer_number").val(); but I dont want to define var day_2_0 straightforward. I want something like this, if at all possible var day = "day_"+divID+"_0"; so that var (var day) =&gt; var day_2_0; Is anything like this possible in JavaScript? NOTE: its something equivalent to this php snippet $offer = "offer1"; $$offer then means $offer1 so if we write echo $$offer; then it means echo $offer1;
has comment: http://stackoverflow.com/comment/44747832
type: Question
has title: Concatenate variable with a string to define another variable
tagged with: javascript
has answer: http://stackoverflow.com/a/28190090
score: 0
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44747853

http://stackoverflow.com/q/28155376
has comment: http://stackoverflow.com/comment/44682232
type: AnsweredQuestion
tagged with: settimeout
downvote count: 0
score: 1
has title: get SetTimeout to finish before continuing loop
tagged with: loops
has body: I'm trying to get a row of letters to light up one by one using Javascript/jquery. I created an array using span elements and am looping over each letter to first change its color red and then back to black again. The problem is that the $.each loop function doesn't wait for setTimeout to finish...it loops over all of them instantly making them all turn red instantly instead of one by one. Any ideas how to fix this? Here is my code: JSFiddle: http://jsfiddle.net/john23/8chu18k9/ var array = $(".one"); var doIt = function () { $.each(array, function(index, value){ array.eq(index).css('color','red'); setTimeout(function(){ array.eq(index).css('color','black'); }, 500); }); }; doIt(); P { color:black; } Hello My Na
possible better answer: http://stackoverflow.com/a/28155656
type: Question
has answer: http://stackoverflow.com/a/28155656
tagged with: javascript
answer count: 3
upvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28155543
accepted answer: http://stackoverflow.com/a/28155543
has answer: http://stackoverflow.com/a/28156656

http://stackoverflow.com/comment/44734396
score: 0
type: Comment
type: QuestionComment
has text: table sorting scripts should work fine. post one not working and we can help from there.
comment on: http://stackoverflow.com/q/28182477

http://stackoverflow.com/a/28220253
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28219238
has body: Correct, within the groups option, you cannot use names if they contain special characters. Within the rules option, you'd surround the names with quotes as per the documentation. But unfortunately, that trick does not work for the groups option. However, there is one workaround. You would construct the parameter outside of the .validate() method and assign it to a variable. Then insert the variable itself within .validate(). For your case, I use a jQuery "starts with" selector to grab all input elements that start with firstname. You could use something else instead, like a class, if you want, as long as you only select all elements for this particular grouping. var names = ""; // create empty string $('input[name^="firstname"]').each(function() { // grab each input starting w/ 'firstname' names += $(this).attr('name') + " "; // append each name + single space to string }); names = $.trim(names); // remove the empty space from the end $('#myform').validate({ // other options, groups: { validDateOfBirth: names // reference the string } }); Working DEMO: http://jsfiddle.net/wpzk47t8/ Source: https://stackoverflow.com/a/28029469/594235
type: Answer

http://stackoverflow.com/comment/44893697
has text: In your current code add the `replace` or `href` after `setCookie('referrer',document.referrer,1);` line
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28247779
type: AnswerComment

http://stackoverflow.com/comment/44951251
comment on: http://stackoverflow.com/a/28183962
score: 0
type: AnswerComment
type: Comment
has text: This answers my original question.

http://stackoverflow.com/q/28127147
has answer: http://stackoverflow.com/a/28127264
type: AnsweredQuestion
tagged with: forms
possible better answer: http://stackoverflow.com/a/28127264
type: Question
answer count: 2
downvote count: 4
has body: My code is below. I would like the player to input their name into the html form and for this value to be submitted into the javascript scorecard class so that this.players = "name". How would I best do this? I have been trying to use jquery but am having no success. HTML: &lt;section class="name1-2-12"&gt; &lt;form class='name' action=''&gt; &lt;input type="text" name="name" placeholder="NAME"&gt; &lt;input type='submit' name='submit'&gt; &lt;/form&gt; &lt;/section&gt; JAVASCRIPT: var Scorecard = function() { this.players = 0; }; Scorecard.prototype.addPlayer = function(name) { this.players = name };
score: -2
has title: How do you pass html input text into a javascript function as a parameter?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28127671
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28127671
favorite count: 0
upvote count: 2
tagged with: input

http://stackoverflow.com/q/28162990
has answer: http://stackoverflow.com/a/28163054
possible better answer: http://stackoverflow.com/a/28163041
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28163054
has body: In fact, this is not going to serve like a real value, just for the decoration purposes, functioning like a placeholder. I wrote this code, with only the $ sign it works fine, but I can't modify it, for example, so as it could be like "From $" or any other combination. Codepen link to demostrate function priceInputPlaceholder(){ $( 'input' ).on('input', function() { $( this ).val( function( index, val ) { return (val[0] == "$" || !val) ? val : "$" + val; }); }); } priceInputPlaceholder(); As you see, it, no matter what, always keeps the dollar sign before the value. No matter how many times I click or what I input there. However, if I modify it like this: Codepen link function priceInputPlaceholder(){ $( 'input' ).on('input', function() { $( this ).val( function( index, val ) { return (val[0] == "From$" || !val) ? val : "From$" + val; }); }); } priceInputPlaceholder(); It is just adding "From$" on each keypress. Which is really unclear to me. I thought maybe the issue is with the val array, I tried different combination with indexes inside, but they didn't work.
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Add some value to input that servers as a placeholder when user changes it and keep it
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28163041
has comment: http://stackoverflow.com/comment/44697027

http://stackoverflow.com/q/28166294
tagged with: javascript
has body: I'm trying to implement a grid like layout using ng-repeat. When the list is having empty data grid is getting alignment issues. I'm not getting where I've gone wrong. please help me solve this. JS Fidlle HTML {{goals}} JS var n = [ ["Empty","Jan","Feb","Mar","APR","MAY"],["person1",".",".",".",".","."],["person2",".",".",".",".","."],["person3",".",".",".",".","."],["person4",".",".",".",".","."],["person5","","","","",""] ] function MyCtrl($scope) { $scope.items = n; }
has title: issue with grid using ng-repeat
score: 0
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28166587
tagged with: css
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44704408
has comment: http://stackoverflow.com/comment/44703518
has answer: http://stackoverflow.com/a/28166587

http://stackoverflow.com/q/28210826
answer count: 2
has answer: http://stackoverflow.com/a/28210971
tagged with: javascript
has title: Add Heading one time in foreach loop
has body: I need to print heading div only one time. for example: $cat_val=array(69,35,35,35,69) {foreach from=$cat_val item=catval} {if $catval=='69'} Products {/if} some code {/foreach}
has comment: http://stackoverflow.com/comment/44787736
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44786067
type: UnansweredQuestion
tagged with: foreach
has answer: http://stackoverflow.com/a/28210876
type: Question

http://stackoverflow.com/q/28265322
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/14236873
favorite count: 0
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44887225
upvote count: 1
has answer: http://stackoverflow.com/a/28265430
has body: I have a divcontaining many input boxes. I don't want the user to be able to submit a space key into the field. HTML &lt;div class="container"&gt; Input1&lt;input type="text"&gt; Input2&lt;input type="text"&gt; &lt;/div&gt; Javascript $(".container :input").keydown(function(event){ if(event.which == 32){ //code to change the specific text box to = "" }; }); I have tried this.val() = "" but that doesn't seem to work for some reason. If there is an alternative through html to stop the input boxes accepting space then that will work to.
possible better answer: http://stackoverflow.com/a/28265401
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28265401
accepted answer: http://stackoverflow.com/a/28265430
has title: How to find the specific input box that triggered keydown event from many other inputs
has comment: http://stackoverflow.com/comment/44887333
type: AnsweredQuestion

http://stackoverflow.com/a/28202612
has comment: http://stackoverflow.com/comment/44865660
has comment: http://stackoverflow.com/comment/44771815
accepted answer of: http://stackoverflow.com/q/28201164
has comment: http://stackoverflow.com/comment/44972685
upvote count: 66
has comment: http://stackoverflow.com/comment/44884504
type: AcceptedAnswer
downvote count: 0
score: 66
has body: First fundamentals. V8 uses hidden classes connected with transitions to discover static structure in the fluffy shapeless JavaScript objects. Hidden classes describe the structure of the object, transitions link hidden classes together describing which hidden class should be used if a certain action is performed on an object. For example the code below would lead to the following chain of hidden classes: var o1 = {}; o1.x = 0; o1.y = 1; var o2 = {}; o2.x = 0; o2.y = 0; This chain is created as you construct o1. When o2 is constructed V8 simply follows established transitions. Now when a property fn is used to store a function V8 tries to give this property a special treatment: instead of just declaring in the hidden class that object contains a property fn V8 puts function into the hidden class. var o = {}; o.fn = function fff() { }; Now there is an interesting consequence here: if you store different functions into the field with the same name V8 can no longer simply follow the transitions because the value of the function property does not match expected value: var o1 = {}; o1.fn = function fff() { }; var o2 = {}; o2.fn = function ggg() { }; When evaluating o2.fn = ... assignment V8 will see that there is a transition labeled fn but it leads to a hidden class that does not suitable: it contains fff in fn property, while we are trying to store ggg. Note: I have given function names only for simplicity - V8 does not internally use their names but their identity. Because V8 is unable to follow this transition V8 will decide that its decision to promote function to the hidden class was incorrect and wasteful. The picture will change V8 will create a new hidden class where fn is just a simple property and not a constant function property anymore. It will reroute the transition and also mark old transition target deprecated. Remember that o1 is still using it. However next time code touches o1 e.g. when a property is loaded from it - runtime will migrate o1 off the dep…
has comment: http://stackoverflow.com/comment/44865707
has comment: http://stackoverflow.com/comment/44985511
type: Answer
answers question: http://stackoverflow.com/q/28201164

http://stackoverflow.com/a/28274457
score: 2
answers question: http://stackoverflow.com/q/28274439
downvote count: 0
upvote count: 2
has body: Assuming you have added the jquery library, You need to attach the event when DOM is loaded.i.e. on DOM ready event: $(function(){//document ready function $("#check_user").click(function(){ alert("good"); }); });
type: Answer

http://stackoverflow.com/comment/44893523
comment on: http://stackoverflow.com/a/28268330
type: AnswerComment
score: 0
has text: Yeah, just make that gatheredData into something more complex, perhaps add another parameter to sendData, so you know the origin of data, etc... but that should do it. You're welcome!
type: Comment

http://stackoverflow.com/comment/44855670
comment on: http://stackoverflow.com/a/28247530
score: 0
type: AnswerComment
type: Comment
has text: this is the ajax.php script. in order to call it without refresh, I use jquery

http://stackoverflow.com/q/28217575
score: -1
has comment: http://stackoverflow.com/comment/44800055
downvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44800025
has answer: http://stackoverflow.com/a/28218380
upvote count: 0
has comment: http://stackoverflow.com/comment/44798769
has body: http://jsfiddle.net/pkb9ovLa/ I am creating a HighMap for the US. When I run my code, I do not get any output. Why is this? $(function () { $.getJSON('http://localhost:52149/Scripts/BrokerInfo.json', function (data) { $('#container').highcharts('Map', { chart : { borderWidth : 1 }, title : { text : 'Broker Zonal Assignment' }, mapNavigation: { enabled: true }, series : [{ animation: { duration: 1000 }, data : data, mapData: Highcharts.maps['countries/us/us-all'], joinBy: ['State', 'State'], dataLabels: { enabled: true, color: 'white', format: '{point.State}' }, name: 'Vice President', tooltip: { pointFormat: '{point.state}: {point.VicePresident}' } }] }); });
has comment: http://stackoverflow.com/comment/44799433
has title: The Json file i have given to my Highmaps is not working i do not get tooltip or the hover feature
has comment: http://stackoverflow.com/comment/44799601
type: Question
tagged with: highmaps
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28274898
has answer: http://stackoverflow.com/a/28281905
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
type: Question
downvote count: 0
tagged with: tv4
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28281905
has comment: http://stackoverflow.com/comment/44909996
score: 3
tagged with: validation
answer count: 1
has comment: http://stackoverflow.com/comment/44959585
favorite count: 0
has body: is possible to validate JSON, if value of object is true, then this object is valid, and if Obj2.included == true is valid, if Obj1.included == true ? This is small piece of schema: 'attachments': { 'type': 'object', 'properties': { 'ZalA': { 'type': 'object', 'properties': { 'included': { 'type': 'boolean' }, 'version': { 'type': 'integer' } }, 'required': [ 'included', 'version' ] }, 'ZalB': { 'type': 'object', 'properties': { 'version': { 'type': 'integer' }, 'included': { 'type': 'boolean' }, 'required': [ 'included', 'version' ] } } } } I would like to check: if ZalA.included == true, then valid. if ZalA.included == true and ZalB.included == true, then valid. if ZalA.included == false and ZalB.included == true, then invalid. Is it possible to check these constraints with tv4 JSON validator ?
has title: JSON tv4 object valid if true and if other object is present
type: AnsweredQuestion

http://stackoverflow.com/comment/44715331
type: QuestionComment
comment on: http://stackoverflow.com/q/28173104
has text: can you please add your ajax call as well.
score: 0
type: Comment

http://stackoverflow.com/q/28256824
has body: I have a link on my page with href="javascript:sayhello()", is it possible to add this function to full url? Somethink like: http://example.com/page.html+javascript:sayhello()
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44872161
type: Question
has answer: http://stackoverflow.com/a/28256880
accepted answer: http://stackoverflow.com/a/28256880
tagged with: javascript
has comment: http://stackoverflow.com/comment/44871909
duplicate of: http://stackoverflow.com/q/4163879
has comment: http://stackoverflow.com/comment/44871956
has title: Add a javascript call to link
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/4163879

knockout.js
tags question: http://stackoverflow.com/q/28235593
tags question: http://stackoverflow.com/q/28228056
tags question: http://stackoverflow.com/q/28277881
tags question: http://stackoverflow.com/q/28125955
tags question: http://stackoverflow.com/q/28190856
tags question: http://stackoverflow.com/q/28231053
tags question: http://stackoverflow.com/q/28243567
tags question: http://stackoverflow.com/q/28204397
tags question: http://stackoverflow.com/q/28274463
tags question: http://stackoverflow.com/q/28219991
tags question: http://stackoverflow.com/q/28260527
tags question: http://stackoverflow.com/q/28206351
tags question: http://stackoverflow.com/q/28134641
tags question: http://stackoverflow.com/q/28230246
tags question: http://stackoverflow.com/q/28191504
tags question: http://stackoverflow.com/q/28212774
tags question: http://stackoverflow.com/q/28217555
tags question: http://stackoverflow.com/q/28252708
tags question: http://stackoverflow.com/q/28149013
tags question: http://stackoverflow.com/q/28153806
tags question: http://stackoverflow.com/q/28148129
tag name: knockout.js
tags question: http://stackoverflow.com/q/28227516
tags question: http://stackoverflow.com/q/28213491
tags question: http://stackoverflow.com/q/28150275
tags question: http://stackoverflow.com/q/28189865
tags question: http://stackoverflow.com/q/28238155
tags question: http://stackoverflow.com/q/28227332
tags question: http://stackoverflow.com/q/28277563
tags question: http://stackoverflow.com/q/28236834
tags question: http://stackoverflow.com/q/28235554
tags question: http://stackoverflow.com/q/28159370
tags question: http://stackoverflow.com/q/28222785
tags question: http://stackoverflow.com/q/28197029
tags question: http://stackoverflow.com/q/28176524
tags question: http://stackoverflow.com/q/28268103
tags question: http://stackoverflow.com/q/28138364
tags question: http://stackoverflow.com/q/28123037
tags question: http://stackoverflow.com/q/28262401
tags question: http://stackoverflow.com/q/28157533
tags question: http://stackoverflow.com/q/28255360
tags question: http://stackoverflow.com/q/28225990
type: Tag
tags question: http://stackoverflow.com/q/28268125
tags question: http://stackoverflow.com/q/28132995
tags question: http://stackoverflow.com/q/28215874
tags question: http://stackoverflow.com/q/28274940
tags question: http://stackoverflow.com/q/28225797
tags question: http://stackoverflow.com/q/28201186
tags question: http://stackoverflow.com/q/28146585
tags question: http://stackoverflow.com/q/28250803
tags question: http://stackoverflow.com/q/28148340
tags question: http://stackoverflow.com/q/28174335
tags question: http://stackoverflow.com/q/28202140
tags question: http://stackoverflow.com/q/28150651
tags question: http://stackoverflow.com/q/28152787
tags question: http://stackoverflow.com/q/28172084

http://stackoverflow.com/comment/44709749
score: 0
type: Comment
type: QuestionComment
has text: Why is there a `$` in the regex?
comment on: http://stackoverflow.com/q/28170141

http://stackoverflow.com/q/28234904
has answer: http://stackoverflow.com/a/28235044
has comment: http://stackoverflow.com/comment/44831526
score: 3
accepted answer: http://stackoverflow.com/a/28235044
tagged with: arrays
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/1200562
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44831482
has title: How to get difference of two JS objects
has body: New to JavaScript and have very limited knowledge of JS objects. I want to get difference of two JS objects. a=[{"month":1,"year":2015},{"month":2,"year":2015},{"month":3,"year":2015},{"month":4,"year":2015},{"month":5,"year":2015}]; b=[{"month":1,"year":2015},{"month":2,"year":2015},{"month":5,"year":2015}]; The result I dreamed should be result=[{"month":3,"year":2015},{"month":4,"year":2015}]; I got the above format using JSON.stringify.
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44831477
type: Question
linked to: http://stackoverflow.com/q/1885557
has comment: http://stackoverflow.com/comment/44831408
has comment: http://stackoverflow.com/comment/44831418
tagged with: javascript

http://stackoverflow.com/q/28141267
type: Question
tagged with: prototype
has title: prototype object property created by constructor function in javascript
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44655762
has comment: http://stackoverflow.com/comment/44654228
has comment: http://stackoverflow.com/comment/44658848
has body: In JavaScript, if I create a constructor function Foo, a prototype object will also be created as Foo.prototype. So I tried this: function Foo() { this.xx = 1000} I thought the created prototype object Foo.prototype will have the property xx = 1000. So I tried this: console.log(Foo.prototype.xx); But the result is "undefined". Why is this? Shouldn't there be a Foo.prototype object with single property xx to be 1000? Thanks.
has answer: http://stackoverflow.com/a/28141402
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16063394

http://stackoverflow.com/a/28409923
answers question: http://stackoverflow.com/q/28243144
has comment: http://stackoverflow.com/comment/45157847
has body: I had to do something similar recently. First off, you can't really have two different elements "selected" simultaneously. So in order to accomplish this you're going to need to mimic the browser's built-in 'selected text highlight'. To do this, you're going to have to insert spans into the text to simulate highlighting, and then capture the mousedown and mouseup events. Here's a fiddle from StackOverflow user "fullpipe" which illustrates the technique I used. http://jsfiddle.net/fullpipe/DpP7w/light/ $(document).ready(function() { var keylist = "abcdefghijklmnopqrstuvwxyz123456789"; function randWord(length) { var temp = ''; for (var i=0; i &lt; length; i++) temp += keylist.charAt(Math.floor(Math.random()*keylist.length)); return temp; } for(var i = 0; i &lt; 500; i++) { var len = Math.round(Math.random() * 5 + 3); document.body.innerHTML += '&lt;span id="'+ i +'"&gt;' + randWord(len) + '&lt;/span&gt; '; } var start = null; var end = null; $('body').on('mousedown', function(event) { start = null; end = null; $('span.s').removeClass('s'); start = $(event.target); start.addClass('s'); }); $('body').on('mouseup', function(event) { end = $(event.target); end.addClass('s'); if(start &amp;&amp; end) { var between = getAllBetween(start,end); for(var i=0, len=between.length; i&lt;len;i++) between[i].addClass('s'); alert('You select ' + (len) + ' words'); } }); }); function getAllBetween(firstEl,lastEl) { var firstIdx = $('span').index($(firstEl)); var lastIdx = $('span').index($(lastEl)); if(lastIdx == firstIdx) return [$(firstEl)]; if(lastIdx &gt; firstIdx) { var firstElement = $(firstEl); var lastElement = $(lastEl); } else { var lastElement = $(firstEl); var firstElement = $(lastEl); } var collection = new Array(); collection.push(firstElement); firstElement.nextAll().each(function(){ var siblingID = $(this).attr("id"); if (siblingID != $(lastElement).attr("id")) { collection.push($(this)); } else { return false; } }); collection.push(lastElement); return collection; } …
score: 0
type: Answer

http://stackoverflow.com/a/28228236
downvote count: 0
score: 10
has body: You will have to delay the call to the callback when everything is synchronous because any code in the callback won't be able to reference the object yet (as you've seen). Because the constructor hasn't finished executing, the assignment of it's return value also hasn't finished yet. You could pass the object to the callback and force the callback to use that reference (which will exist and be fully formed), but you're requiring people to know that they can't use a normally accepted practice so it's much better to make sure the callback is only called asynchronously and people can then write their code in the normal ways they would expect to. In node.js, it will be more efficient to use process.nextTick() instead of setTimeout() to accomplish your goal. See this article for more details. var child = function(parent, cb) { var self = this; this.ready = false; this.isReady = function() { return self.ready; } /* This works */ process.nextTick(function() { self.ready = true; cb(null, true); }, 0); } Here's a general observation. Many people (myself included) think that it overcomplicates things to put any async operation in a constructor for reasons related to this. Instead, most objects that need to do async operations in order to get themselves set up will offer a .init() or .connect() method or something like that. Then, you construct the object like you normally would in a synchronous fashion and then separately initiate the async part of the initialization and pass it the callback. That gets you away from this issue entirely. If/when you want to use promises for tracking your async operation (which is great feature direction to go), it's way, way easier to let the constructor return the object and the .init() operation to return a promise. It gets messy to try to return both the object and a promise from the constructor and even messier to code with that. Then, using promises you can do this: var o = new child(p); o.init().then(function() { // object o is fully ini…
type: Answer
answers question: http://stackoverflow.com/q/28227480
upvote count: 10

http://stackoverflow.com/a/28181485
answers question: http://stackoverflow.com/q/28181384
type: Answer
score: 0
has body: You need to clone the object before adding it to an array if you want to take "snapshots" of its state: function addToArr(obj, arr) { var newObj = {}; for (var prop in obj) { newObj[prop] = obj[prop]; } arr.push(newObj); } Every time you want to push the object to the array, just call addToArr(obj_initial, obj_final);

http://stackoverflow.com/a/28229578
type: Answer
answers question: http://stackoverflow.com/q/28229249
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/44839224
has comment: http://stackoverflow.com/comment/44841058
accepted answer of: http://stackoverflow.com/q/28229249
has body: It looks like you want to clip a 400x300 subsection of the image and draw it into the canvas. You don't need .getImageData and .putImageData to accomplish that. You can use the clipping version of .drawImage to do that: context.drawImage( img, // the image source 0,0, // start clipping from the source at x=0, y=0 400,300 // clip a subsection that's 400x300 in size 0,0 // draw that clipped subsection on the canvas at x=0,y=0 400,300 // make the drawing 400x300 (don't scale) ) Here's example code and a Demo: var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw=canvas.width; var ch=canvas.height; var img=new Image(); img.onload=start; img.src="https://dl.dropboxusercontent.com/u/139992952/stackoverflow/landscape2.jpg"; function start(){ ctx.drawImage(img, 0,0,400,300, 0,0,400,300); } body{ background-color: ivory; padding:10px; } #canvas{border:1px solid red;} subsection clipped to the canvas The original image

http://stackoverflow.com/q/28166833
has comment: http://stackoverflow.com/comment/44704569
has comment: http://stackoverflow.com/comment/44705691
has comment: http://stackoverflow.com/comment/44706914
has comment: http://stackoverflow.com/comment/45302625
has body: As it is right now, I have some sections of my website that have style="display:none;" in the code. Some of the buttons on my website run Javascript that show those, $('#phonecompText').fadeIn();. When I let the lines of text on my site fadein, the background does not keep up with the page. Before Any idea on how I can have the background stretch down? These are the files in my css folder. And here is my style.css @charset 'UTF-8'; @import url("font-awesome.min.css"); @import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,700|Open+Sans+Condensed:300,700"); /*********************************************************************************/ /* Basic */ /*********************************************************************************/ body { background-color: #dbdbdb; background-image: url('images/bg02.png'); } body.is-loading * { -moz-transition: none !important; -webkit-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; -moz-animation: none !important; -webkit-animation: none !important; -o-animation: none !important; -ms-animation: none !important; animation: none !important; } body, input, textarea, select { font-family: 'Source Sans Pro', sans-serif; font-weight: 400; color: #565656; } a { color: #1784CD; } strong, b { font-weight: 700; color: #232323; } h2, h3, h4, h5, h6 { font-family: 'Open Sans Condensed', sans-serif; font-weight: 700; color: #232323; } h2 a, h4 a, h5 a, h6 a { text-decoration: none; color: inherit; } blockquote { border-left: solid 5px #ddd; padding: 1em 0 1em 2em; font-style: italic; } em, i { font-style: italic; } hr { border: 0; border-top: solid 1px #ddd; padding: 1.5em 0 0 0; margin: 1.75em 0 0 0; } sub { position: relative; top: 0.5em; font-size: 0.8em; } sup { position: relative; top: -0.5em; font-size: 0.8em; } br.clear { clear: both; } p, ul, ol, dl, table { margin-bottom: 1em; } /* Table */ table { width: 100%; } table.default { } ta…
has comment: http://stackoverflow.com/comment/44704846
has title: Website background doesn't fill with display:none
has comment: http://stackoverflow.com/comment/44705524
has comment: http://stackoverflow.com/comment/44704539
score: 0
has comment: http://stackoverflow.com/comment/44704575
tagged with: javascript
has comment: http://stackoverflow.com/comment/44706173
has comment: http://stackoverflow.com/comment/44707165
has comment: http://stackoverflow.com/comment/44704096
has comment: http://stackoverflow.com/comment/44704381
has comment: http://stackoverflow.com/comment/44703949
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44705538
has comment: http://stackoverflow.com/comment/44704707
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45302583
has comment: http://stackoverflow.com/comment/44704351
type: Question
has comment: http://stackoverflow.com/comment/44703999

http://stackoverflow.com/a/28207080
accepted answer of: http://stackoverflow.com/q/28200514
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28200514
score: 0
type: Answer
has body: I assume the above is just pseudo code because there are lots of little errors. But there are a number of issues with this approach. If you know what the new image needs to be in advance, then preload it up front and then use loadTexture to apply it: function preload() { game.load.image('Car', 'car.jpg'); game.load.image('Pumpkin', 'pumpkin.png'); } ... function update() { if (car.x &gt; game.width) { car.loadTexture('Pumpkin'); } } Also some other things to watch out for: 1) Only change the texture if it's not already set (in the example above it will run loadTexture over and over, unless you reset the car.x coordinate) 2) If you can't preload the image up front, then you can load it during play. Look at the "Loader Events" example code for details. 3) You need to check the sprite position in update and not create (as it won't have moved at all by that point).

http://stackoverflow.com/a/28208249
answers question: http://stackoverflow.com/q/28207913
downvote count: 1
has body: Try this, $("[name^=a]") - attribute name starts with $("[name*=a]") - attribute name contains $(this).next() - next element of this $(function () { $("[name^=a]").change(function () { var d = $(this).val(); console.log(d); $(this).next().val(d); }); });
score: -1
upvote count: 0
type: Answer

http://stackoverflow.com/comment/44664599
comment on: http://stackoverflow.com/a/28146444
score: 0
type: Comment
has text: @null Yes, that would work. But I find that instructing an iteration over an array is far more readable than instructing a *backwards* iteration over a numeric variable, which happens to have calls to an array inside. :)
type: AnswerComment

http://stackoverflow.com/a/28183869
type: Answer
score: 0
has body: Try this: if(data[0] == "#l" || data[0] == "#L") { if(data[0].search("#g") != -1 || data[0].search("#G") != -1){ }else{ isLayer = true; } }else if(data[0] == "#g" || data[0] == "#G"){ if(data[0].search("#l") != 0 || data[0].search("#L") != 0){ }else{ is group = true; } } You see, what you weren't doing was checking if both were present. What my code does is checks that The item is #g or #l The item is not the opposite as well. This ensures that one, and only one option is chosen. Good day, And good luck.
answers question: http://stackoverflow.com/q/28183683

django
tags question: http://stackoverflow.com/q/28161821
tags question: http://stackoverflow.com/q/28216298
tags question: http://stackoverflow.com/q/28141271
type: Tag
tags question: http://stackoverflow.com/q/28226675
tags question: http://stackoverflow.com/q/28206773
tag name: django
tags question: http://stackoverflow.com/q/28128803
tags question: http://stackoverflow.com/q/28235114
tags question: http://stackoverflow.com/q/28264024
tags question: http://stackoverflow.com/q/28129571
tags question: http://stackoverflow.com/q/28268574
tags question: http://stackoverflow.com/q/28224931
tags question: http://stackoverflow.com/q/28173352
tags question: http://stackoverflow.com/q/28224737
tags question: http://stackoverflow.com/q/28124306

http://stackoverflow.com/a/28138085
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28135705
answers question: http://stackoverflow.com/q/28135705
has body: You cannot. The HTML5 spec clearly says: “If the readonly attribute is specified on an input element, the element is barred from constraint validation.”

http://stackoverflow.com/a/28193351
type: AcceptedAnswer
type: Answer
has body: You are using ? twice in longString, which in turn will make split() return an array with only one value. You need to change it to: var longString = "?s=" + token + "&amp;_sft_category="; The ? character should only be used once, at the start of the querystring.
score: 0
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28192958
accepted answer of: http://stackoverflow.com/q/28192958

http://stackoverflow.com/comment/44787399
type: Comment
has text: That makes sense, thanks. I will accept your answer in 3 minutes.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28211463

http://stackoverflow.com/a/31137808
downvote count: 0
type: Answer
has body: I did something like before and it's running now : HTML : Alkhaldia/King abdulaziz road Saied Al Shuhada Sport City Al duaitha Alia Mall The Closest Position to me JavaScript : Finally HTML : And it's working good with out error
upvote count: 1
answers question: http://stackoverflow.com/q/28145767
score: 1

http://stackoverflow.com/a/28172153
has comment: http://stackoverflow.com/comment/44713550
upvote count: 1
has body: You need to compare the typeof the value with 'undefined'. For example: Your defined Please see the MDN documentation for this type of check. And a snippet that illustrates this: var x = { y: 50 }; document.getElementById('output').innerHTML = 'x.y is undefined: ' + (typeof x.y === 'undefined') + '; x.z is undefined: ' + (typeof x.z === 'undefined');
answers question: http://stackoverflow.com/q/28172084
type: Answer
has comment: http://stackoverflow.com/comment/44713375
downvote count: 0
score: 1

http://stackoverflow.com/q/28167305
accepted answer: http://stackoverflow.com/a/28167678
type: Question
has body: I AM NEW TO THIS AND I DON'T KNOW ANYTHING ABOUT JS OR CSS How can I redirect a user to another page depending on the option selected(After the button has been clicked, not after an option has been selected) For instance, if I select Veg and click the 'Done' button, I should be taken to VegMenu.html and if I select Non-veg, I should be taken to NonVegMenu.html I tried doing this but I'm redirected to the page as I select the option which I don't want. I want be redirected after pressing 'Done' Veg Non-Veg Done
possible better answer: http://stackoverflow.com/a/28167451
linked to: http://stackoverflow.com/q/19388382
has answer: http://stackoverflow.com/a/28167451
tagged with: javascript
has title: How to redirect a user based on option/select in html (After clicking a button)
favorite count: 0
has answer: http://stackoverflow.com/a/28167420
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44704750
answer count: 4
has answer: http://stackoverflow.com/a/28167678
has answer: http://stackoverflow.com/a/28167463
upvote count: 2
downvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44704660

http://stackoverflow.com/q/28226049
tagged with: arrays
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44815375
has comment: http://stackoverflow.com/comment/44815370
has comment: http://stackoverflow.com/comment/44815486
has answer: http://stackoverflow.com/a/28226209
has comment: http://stackoverflow.com/comment/44815404
has comment: http://stackoverflow.com/comment/44815349
tagged with: node.js
type: AnsweredQuestion
has body: Check this out alert("wtf/http://google.com".split('/', 2)); the resulted array contains 2 elements: wtf, http:. Shouldn't it have wtf and the rest of the string? :/
has comment: http://stackoverflow.com/comment/44815407
possible better answer: http://stackoverflow.com/a/28226117
has answer: http://stackoverflow.com/a/28226161
has answer: http://stackoverflow.com/a/28226117
has title: Split not working correctly in javascript
type: Question
tagged with: split
accepted answer: http://stackoverflow.com/a/28226209

http://stackoverflow.com/comment/44644998
type: QuestionComment
comment on: http://stackoverflow.com/q/28136427
has text: Thanks guys. I tried to get it as accurate as possible Nicholas, but never mind.
score: 0
type: Comment

http://stackoverflow.com/a/28954127
has comment: http://stackoverflow.com/comment/82319018
type: Answer
score: -5
downvote count: 8
answers question: http://stackoverflow.com/q/28258106
has comment: http://stackoverflow.com/comment/53288319
upvote count: 3
has body: Just to follow up on this since the top answer recommends not using materializecss... in the current version of materialize you no longer need to initialize selects.
has comment: http://stackoverflow.com/comment/47495586
has comment: http://stackoverflow.com/comment/46585761

http://stackoverflow.com/comment/44653329
has text: Your `handle` has width 12%. why? The width should match the right ratio and should be also calculated on window resize since than the scrollWidth of the #photos changes.
comment on: http://stackoverflow.com/q/28136491
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44773419
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28203599
type: Comment
has text: What @jacob-budin says: then the param you're looking for is params["send_welcome"] = false;

http://stackoverflow.com/comment/44789187
comment on: http://stackoverflow.com/q/28211915
score: 0
has text: In the developer console, consent screen make sure you added email address and product name. Also looks like the scope you are using is the google+ scope which is no the Google analytics scope you will have to change that but its not related to the client error message.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28198597
has comment: http://stackoverflow.com/comment/44763578
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28198490
downvote count: 0
has body: EDIT: The answer is no. JavaScript can be used to do just about anything on a site including customizing the look and feel, changing colour, adding elements, applying classes, etc... But Javascript is NOT an aspect of HTML as correctly pointed out in the comments below.
has comment: http://stackoverflow.com/comment/44763556

http://stackoverflow.com/comment/47743882
type: AnswerComment
has text: @Zapnologica I believe we have geographic location in common ... wonder if it isn't related to our archaic internet infrastructure?
type: Comment
comment on: http://stackoverflow.com/a/29788621
score: 2

http://stackoverflow.com/a/28238367
downvote count: 0
answers question: http://stackoverflow.com/q/28236522
type: Answer
upvote count: 1
score: 1
has body: Try this angular.module('app',[]) .controller('MainController', function($scope) { var studentList = [ {id: '111', name: 'Anna', present: 1}, {id: '222', name: 'Bob', present: 1}, {id: '333', name: 'Cath', present: 1}, {id: '111', name: 'Anna', present: 0}, {id: '222', name: 'Bob', present: 0}, {id: '333', name: 'Cath', present: 1} ]; $scope.students = studentList; var students = {} var stu_count = {} var presentData = [] studentList.forEach( function(e){ if(!students[e.name]){ students[e.name] = 0 stu_count[e.name] = 0 } students[e.name] += e.present stu_count[e.name]++ } ); for(var name in students){ presentData.push({name : name, present : stu_count[name]}) } $scope.presntTotal = presentData; }); {{ student.name }} || {{student.present}}

http://stackoverflow.com/comment/44724594
score: 1
comment on: http://stackoverflow.com/q/28177650
has text: if recent version, global functions no longer supported for controllers and you have no `ng-app`
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28269706
has comment: http://stackoverflow.com/comment/44895366
answer count: 1
has comment: http://stackoverflow.com/comment/44895340
type: UnansweredQuestion
tagged with: php
has title: jquery get character limit?
has answer: http://stackoverflow.com/a/28272342
has comment: http://stackoverflow.com/comment/44895437
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44895313
type: Question
tagged with: xampp
has comment: http://stackoverflow.com/comment/44895320
tagged with: javascript
has body: I have a code like this. $.get("url") .done(function(data){ alert("success"); alert(JSON.stringify(data)); }) .fail(function(data){ alert("fail"); alert(JSON.stringify(data)); }); When I make the url return 95 elements, it goes into done, alerts success, and alerts the contents of the array. But if I make it return an array greater than 95, it goes into fail but still prints the contents of the array correctly. I used Chrome's DHC - REST/HTTP API Client app to test it out also. When I make the url return 95 elements everything is good. If I make it return 96 elements, it still shows all the elements inside the array but says 'Unexpected token END OF FILE at position 8430.' at the top. I'm not sure how to resolve this issue. Googling didn't get me anywhere.

http://stackoverflow.com/a/28187918
downvote count: 1
has comment: http://stackoverflow.com/comment/44745261
has comment: http://stackoverflow.com/comment/44744315
has body: Unfortunately, you can show only raw text message, without tags and style. Moreover, firefox shows only it's own default message (HTML onbeforeunload Event Attribute)
upvote count: 0
has comment: http://stackoverflow.com/comment/44744341
type: Answer
score: -1
answers question: http://stackoverflow.com/q/28187701
has comment: http://stackoverflow.com/comment/44744617

http://stackoverflow.com/q/28279436
has comment: http://stackoverflow.com/comment/44916117
has comment: http://stackoverflow.com/comment/44914354
answer count: 1
downvote count: 0
has body: I'm just starting with GAS so I would appreciate any insight and apologize if this is an obvious question. I am trying to implement a date picker so that a user can choose some dates instead of typing them out. I do this using the code from this question: Returning a value using Date picker in HTMLService / Google Apps Script This works great, but my issue is that the rest of my code continues to run before the user can input dates. The function to call the html is: function showDialog() { var html = HtmlService.createHtmlOutputFromFile('dateDialog') .setSandboxMode(HtmlService.SandboxMode.IFRAME); SpreadsheetApp.getUi() .showModalDialog(html, 'Please provide a Date Range'); Logger.log("HTML return = %s", html.getContent()); return html.getContent(); } And I call this from my main script file below. The picker shows up but then the rest of my code continues to execute. In this case, I have a msgBox that pops up and closes the datepicker. function runthis(){ var a = showDialog(); Logger.log(a); //rest of code would go here Browser.msgBox('hello world'); } I guess I could loop some timeout or pause until the html has returned values but this seems unnecessary. What am I doing wrong? Thanks for any help.
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28281034
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
has title: GAS - Wait until user enters data before function continues
upvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28281034
linked to: http://stackoverflow.com/q/24841089
tagged with: google-apps-script

http://stackoverflow.com/q/28172527
tagged with: database
tagged with: javascript
type: UnansweredQuestion
tagged with: canvas
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28177213
score: 0
has title: Save canvas as jpeg and inputfields to database via js
answer count: 1
has body: So I can upload a picture into canvas, then in canvas you should be able to customise the picture (which also doesn't work but that problem is less pressing). Then after you customise it you must give your email and name, and these 3 things should be sent to the database so I can get them in a gallery. But my code-skills are not good enough to get this right, and finding all these different methods just confuse me at the moment. This is my form Name Email I have no idea how to continue from here out.

http://stackoverflow.com/a/28198927
answers question: http://stackoverflow.com/q/28197974
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44767608
has body: It sounds like the date is being passed into your Fusion table correctly, but you need to adjust the formatting in the Table itself. To do this, open the fusion table and hover over the header of your date column. Click the Down arrow and choose "Change". Make sure the Type is set to "Date/Time", then choose the desired format from the list.

http://stackoverflow.com/q/28241267
type: Question
tagged with: tooltip
has answer: http://stackoverflow.com/a/28241902
tagged with: javascript
tagged with: jquery-validate
score: 0
answer count: 1
has title: How to properly integrate tooltips with jQuery Validate
has comment: http://stackoverflow.com/comment/44845002
linked to: http://stackoverflow.com/q/14741688
tagged with: jquery
type: UnansweredQuestion
has body: I have the following code for displaying a validation error in a tooltip: Base Address: . . . This works great but there is one issue: Is there an easy of only displaying one error popup at a time?

http://stackoverflow.com/q/28255372
has comment: http://stackoverflow.com/comment/44869333
has body: I'm new to JavaScript and I'm trying to write a simple game-loop. Here's my Game object: var Game = { timers: [], start: timestamp(), stopTimers: function() { consoleEntry('All timers have been stopped.'); this.timers.length = 0; }, update: function(elasped) { for (var i = 0; i &lt; this.timers.length; ++i) { var timer = elapsed - timers[i].startTime; console.log('Timer: ' + timer + '. Timer interval: ' + this.timers[i].interval + '.'); if (this.timers[i].interval &lt;= timer) { this.timers[i].times--; this.timers[i].report = true; if (this.timers[i].times != 0) { this.timers[i].startTime = elapsed; } } } }, render: function() { for (var i = 0; i &lt; this.timers.length; ++i) { if (this.timers[i].report) { consoleEntry('Timer: ' + this.timers[i].name + ' (' + this.timers[i].times + ' remaining).'); this.timers[i].report = false; if (this.timers[i].times == 0) this.timers.splice(i, 1); } } }, gameLoop: function() { var elapsed = timestamp() - this.start; this.update(elapsed); this.render(); requestAnimationFrame(this.gameLoop); }, startGame: function() { console.log(this); requestAnimationFrame(this.gameLoop); } } I call Game.startGame(); when the &lt;body&gt; loads. Here's the error I receive: Uncaught TypeError: undefined is not a function. It refers to this.update(elapsed); inside the gameLoop function. For some reason I don't understand, when I do console.log(this) inside startGame I get the object it belongs to (which is awesome), but when I do the same inside gameLoop, I get the Window object. Does anyone know why this happens? Thank you!
has comment: http://stackoverflow.com/comment/44869113
tagged with: this
has comment: http://stackoverflow.com/comment/44869188
tagged with: javascript
has title: 'this' in an object method
has comment: http://stackoverflow.com/comment/44869129
score: 0
answer count: 1
duplicate of: http://stackoverflow.com/q/20279484
has answer: http://stackoverflow.com/a/28255573
has comment: http://stackoverflow.com/comment/44869068
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44869159
tagged with: object
has comment: http://stackoverflow.com/comment/44869370
linked to: http://stackoverflow.com/q/20279484
tagged with: methods
type: Question
has comment: http://stackoverflow.com/comment/44869115

http://stackoverflow.com/q/28228599
answer count: 2
tagged with: javascript
has title: CKEDITOR inline on dynamic created element ( droppable/sortable )
tagged with: ckeditor
tagged with: jquery
upvote count: 1
has comment: http://stackoverflow.com/comment/44820789
has answer: http://stackoverflow.com/a/28268716
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44825995
has answer: http://stackoverflow.com/a/28238869
downvote count: 0
has body: Let's take this jquery example: http://jqueryui.com/sortable/#connect-lists When i'm moving elements from right list to left list i want to have an inline CKEditor for the text of the dropped element that is cloned. Here is what i tried: $("#maincontent").droppable({ drop: function(event, ui) { var blockId = ui.draggable.attr('block-id'); ui.draggable.load(site_url+'/blocks/'+blockId+'.html'); ui.draggable.attr('contenteditable','true'); ui.draggable.css('width','100%'); ui.draggable.css('height','auto'); CKEDITOR.inline( ui.draggable.get( 0 ) ); }, over: function(event, ui) {} }); My problem is that i get this error: [ Uncaught The editor instance "editor2" is already attached to the provided element ] and obviously the sortable list doesn't work anymore. The weird thing is that the ckeditor does work for that new cloned element. I saw this example: http://jsfiddle.net/RKPYw/ but i just can't understand why i get this error and why isn't working for me with that sortable lists. Can anyone help me to understand ? HERE is my code: jsfiddle.net/0wp1gy7c/5 Thanks. UPDATE: after a while i've managed to do it, here is my tutorial about it: CLICK HERE
score: 1
has comment: http://stackoverflow.com/comment/44832368
type: Question

http://stackoverflow.com/q/28261690
has comment: http://stackoverflow.com/comment/44901693
tagged with: angularjs-routing
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44881769
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44880516
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44880848
has comment: http://stackoverflow.com/comment/44880595
accepted answer: http://stackoverflow.com/a/28826153
has body: I would like to achieve a routing as you can see the example below, controllers are missing at the moment. I like it because the routes reflects how the partials are organized and how the system modules are exists. After a little search it seems angular route can't do this for me. How can I do this with angular? I would like to avoid using 3rd party stuff. At the moment I have to simplify it and it is not a problem, but it is not that 'beauty' how I like it. Do you have any information about when angular routing, out of the box, will be able to manage a routing like this? I came across a comment about that in the future this will be implemented, but version it wasn't mentioned. angular .module('app') .config(function ($routeProvider) { $routeProvider .when('/admin/usermanagement', { templateUrl: "app/dilib/partials/admin/user_management.html", }) .when('/admin/userrights', { templateUrl: "app/dilib/partials/admin/user_rights.html", }) .when('/dashboard', { templateUrl: 'app/dilib/partials/dashboard/dashboard.html' });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44880578
has title: Little bit complex routes in angular
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44880478
type: Question
has comment: http://stackoverflow.com/comment/44887463
has answer: http://stackoverflow.com/a/28826153

http://stackoverflow.com/q/28145397
has answer: http://stackoverflow.com/a/30571024
tagged with: javascript
has body: I'm trying to inject a variable into each module within my webpack bundle in order to have debugging information for JS errors per file. I've enabled node: { __filename: true } Current file path in webpack in my webpack.config, but I would like to inject something like var filename = 'My filename is: ' + __filename; into each module before compilation. I've seen the Banner Plugin with the raw option but it seems this would only inject the banner outside of the webpack closure rather than my desired result of injecting script into each module.
has title: Injecting variables into webpack
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 13
tagged with: requirejs
has answer: http://stackoverflow.com/a/29858423
upvote count: 13
linked to: http://stackoverflow.com/q/25553868
linked to: http://stackoverflow.com/q/29850802
type: Question
tagged with: commonjs
answer count: 2
tagged with: webpack

http://stackoverflow.com/comment/44886860
type: Comment
comment on: http://stackoverflow.com/a/28265009
score: 0
type: AnswerComment
has text: The downvote wasn't my doing. Or if it was, it was made in error. I haven't even tested your code in my project yet. One moment.

http://stackoverflow.com/q/28172968
tagged with: jquery
has comment: http://stackoverflow.com/comment/44716599
has body: I am using Jquery Plugin to validate an Edit form.The validation works fine with the Create Form but it does not work with the Edit form. My HTML is Edit Provider Details: FIRST NAME: Enter the first name CONTACT NUMBER: Enter the Contact Number EMAIL ADDRESS: Enter the Email Address Update Reset The JavaScript is $(document).ready(function () { jQuery.validator.addMethod("AcceptEmail", function (value, element) { return this.optional(element) || /^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})| ([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d] {2})?)$/.test(value); }); $("#EditProviderDetailsForm").validate({ onfocusout: function (element, event) { this.element(element); }, onkeyup: function (element, event) { if (event.which === 9 && this.elementValue(element) === '') { return; } else if (element.name in this.submitted) { this.element(element); } }, rules: { FirstName: { required: true, minlength: 2, maxlength: 20 }, ContactNumber: { required: true, minlength: 10, maxlength: 10 }, ContactEmail: { required: true, AcceptEmail: true } }, messages: { FirstName: { required: "Please enter your first name", minlength: "Minimum 2 characters required", maxlength: "Maximum 20 characters allowed" }, ContactNumber: { required: "Please enter your Contact Number", minlength: "Enter a 10 digit contact number", maxlength: "Enter a 10 digit contact number" }, ContactEmail: { required: "Please enter your Email Address", AcceptEmail: "Please enter a valid email ID" } } }); var Provider = { SpecializationArray: ko.observableArray(Specialities), ProviderID: ko.observable(Edit_data.ProviderID), FirstName: ko.observable(Edit_data.FirstName), ContactNumber: ko.observable(Edit_data.ContactNumber), ContactEmail: ko.observable(Edit_data.ContactEmail) } ko.applyBindings(Provider); }); My Scripts are getting loaded in _Layout page in the Shared folder of MVC. @ViewBag.Title @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") I am at a loss here.Please guide me in the right …
has comment: http://stackoverflow.com/comment/44717297
has title: Jquery Plugin not validating a form
has comment: http://stackoverflow.com/comment/44716752
tagged with: validation
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44715089
favorite count: 0
has comment: http://stackoverflow.com/comment/44718749
has answer: http://stackoverflow.com/a/28175126
upvote count: 1
accepted answer: http://stackoverflow.com/a/28175126
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44720175
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44715256

http://stackoverflow.com/q/28184653
upvote count: 1
tagged with: pebble-watch
answer count: 1
has title: Pebble Watchface send message to Android App
has comment: http://stackoverflow.com/comment/46910180
tagged with: pebble-sdk
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
favorite count: 0
has body: I'm trying to send a message from my Pebble Watchface (Not a pebble Watch app) to an Android application. I have a js file as part of my Watchface that receives the messages no problem, but my android application is not receiving the message. Is there a special way to target the Android application? Do I need to forward the message from the JS file to my Android application somehow? I've received messages in my Android application from other watchfaces, so I'm not sure how they are doing it and I can't seem to find any documentation on how to target and Android application from a Watchface. Thank you in Advance
type: Question
tagged with: android
has answer: http://stackoverflow.com/a/28196758
tagged with: java

http://stackoverflow.com/q/28215369
has answer: http://stackoverflow.com/a/28215531
linked to: http://stackoverflow.com/q/10180391
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Do while loops have to be infinite to crash?
tagged with: loops
has body: Are there other reasons? What if they are too long? Will that make the browser crash, if so how long is too long? Could a long looping crashing problem be solved with a setTimout 0 loop so code is executed every next tick and if this is the case, would it also be possible to loop infinitely in this manner and never crash? I am not coding something this stupid sounding, I have just always wondered. I would have thought it is different on each browser, so for the sake of the question lets say it is a reasonably well known and used browser - Chrome. EDIT: The garbage collector and objects not being destroyed has been mentioned, does someone have an example of this?
type: Question
tagged with: browser
answer count: 2
has answer: http://stackoverflow.com/a/28215485
has comment: http://stackoverflow.com/comment/44794051
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28215531
possible better answer: http://stackoverflow.com/a/28215485
upvote count: 1
favorite count: 0

http://stackoverflow.com/a/33215816
has body: You can use css "element+element" selector (direct adjacent combinator). Let's say you need to insert element "second" right after element "first": d3.select('body') .insert('div', '#first + *') .attr('id', 'second');
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/70600286
answers question: http://stackoverflow.com/q/28249941
score: 21
upvote count: 21

http://stackoverflow.com/a/28259547
type: Answer
answers question: http://stackoverflow.com/q/28259528
score: 0
has body: These are your options: newelement.question or myarray[0].question newelement.answer or myarray[0].answer If you want to avoid the numeric index, you could loop over the array, or just use newelement.question / newelement.answer.

http://stackoverflow.com/q/28131303
tagged with: mustache
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28131315
type: Question
has title: jQuery on function not firing in mustache?
tagged with: javascript
tagged with: jquery
score: 0
has body: I am using $(Mustache.to_html to render a template on my webpage - if I check the actual html rendered on the page it is as below: The problem I am having is that I want to trigger a function when the title dropdown is changed. In doc ready I added the below: $(document).ready(function () { $('#titlesDropDown').on('change', function () { alert('Dropdown change fired'); }); }); Is there something else which I need to do to wire the change event up to a mustache rendered template?
has answer: http://stackoverflow.com/a/28131315
answer count: 1

http://stackoverflow.com/a/28199204
score: 2
has body: Don't do it. Trusting (multiple) clients to come up with unique values is not going to work. Even if each client is guaranteed to generate unique values, you could have two clients generate the same value. Since most pseudo-random number generators are seeded with the current time, that becomes more likely as you get more users. If you're creating database records, your database should provide some functionality like this. Most or all SQL databases have an auto-increment concept, and many NoSQL databases have an equivalent (Mongo certainly does for IDs). Allowing the database to handle this can be good for performance (it can set up indexes and allocate space to handle the IDs well) and the DB has the final say on the data, so it can guarantee that IDs are unique. Failing that, you can have your server-side generated some unique identifier (like a UUID) and use that. Having the server do it and using a known-good algorithm, like a type 4 UUID, guarantees sufficient randomness that conflicts should never occur. Note that using UUIDs, unless your database has a type for them, will have very different index performance than sequential IDs.
has comment: http://stackoverflow.com/comment/44764882
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/44764963
has comment: http://stackoverflow.com/comment/44766456
has comment: http://stackoverflow.com/comment/44767363
answers question: http://stackoverflow.com/q/28199100
has comment: http://stackoverflow.com/comment/44764925
has comment: http://stackoverflow.com/comment/44764804
type: Answer

http://stackoverflow.com/q/28231605
has answer: http://stackoverflow.com/a/28231793
score: 1
accepted answer: http://stackoverflow.com/a/28231793
has comment: http://stackoverflow.com/comment/44828894
has comment: http://stackoverflow.com/comment/44825686
type: Question
has answer: http://stackoverflow.com/a/28231744
has body: I am trying to implement a jquery Drag and drop. I would like to know which is the most customizable plugin? Consider after the implementation of the drag and drop, i want to make the design responsive. For eg. The canvas area is 100 X 100 px. i place a square of size 25 X 25px in between. So its top and left would be 25 px. Now consider this design needs to enlarge itself on a full screen mode to fit the complete screen. The we would use width: 100% for the canvas but the top and left of the div added is 25px. How can we make sure it fits all screen sizes? What are the steps i need to take while storing these parameters on a drag and drop? (store the top, left in percentages or px) or is there a better way with media-queries etc? Thanks.
tagged with: javascript
upvote count: 2
answer count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/44825499
tagged with: jquery
linked to: http://stackoverflow.com/q/20424477
favorite count: 0
possible better answer: http://stackoverflow.com/a/28231744
has title: Drag and drop and make that element responsive
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
tagged with: responsive-design

http://stackoverflow.com/comment/44677363
has text: `var supportsCanvas = "getContext" in document.createElement('canvas')`
type: QuestionComment
comment on: http://stackoverflow.com/q/28153005
type: Comment
score: 0

http://stackoverflow.com/q/28265925
answer count: 2
has answer: http://stackoverflow.com/a/28266148
downvote count: 0
has body: I have a factory, which goes into a controller, and I am trying to get data from that display on an HTML page. I am having trouble specifying an Object's pathway however. My Factory: app.factory('APIMethodService', function() { var Head = "api.example.com"; return { apis: [{ accounts: [ { v1: [ { uri: Head+"/v1/accounts/", item1: "AccountNumber", item2: "MoneyInAccount" }], v2: [ { uri: Head+"/v2/accounts/", item1: "AccountNumber", item2: "MoneyInAccount" }] } ], customers: [ { v1: [ { uri: Head+"/v1/customers/", item1: "CustomerName", item2: "CustomerID", item3: "CustomerEmail" }] } ] }] }; }); My Controller: app.controller('APIController', function($scope, APIMethodService) { $scope.title = "API"; $scope.apiList = APIMethodService; $scope.accountList = $scope.apiList.accounts.v1; $scope.accountList2 = $scope.apiList[0][0]; }); My HTML {{title}} Page! {{api.uri}} {{api.item1}} {{api.item2}} The errors I get are in regards to the Controller trying to parse out the individual objects I wish to grab, like accounts or customers, and then any version v#, they may have. So it will say something such as TypeError: Cannot read property 'v1' of undefined I just need some help specifying the proper pathways into my factory service.
tagged with: javascript
has title: AngularJS Nested Object Array Pathway
accepted answer: http://stackoverflow.com/a/28266061
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44888406
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28266148
has answer: http://stackoverflow.com/a/28266061

http://stackoverflow.com/a/28212711
score: 1
answers question: http://stackoverflow.com/q/28212322
upvote count: 1
has body: If it is from an ajax request your content type should be application/json to make that code work if not parse it var json = JSON.parse(data); console.log(json.comment_id);
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44624447
has text: ok my fault, `var checked = document.querySelector('input:checked'); var id = checked?checked.id:'bla'`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28125266
type: AnswerComment

http://stackoverflow.com/a/28226721
downvote count: 0
has body: A textarea can not render HTML inside.
has comment: http://stackoverflow.com/comment/44842812
type: Answer
has comment: http://stackoverflow.com/comment/44816680
accepted answer of: http://stackoverflow.com/q/28226691
has comment: http://stackoverflow.com/comment/44842946
has comment: http://stackoverflow.com/comment/44842923
answers question: http://stackoverflow.com/q/28226691
upvote count: 1
has comment: http://stackoverflow.com/comment/44844085
score: 1
has comment: http://stackoverflow.com/comment/44843302
has comment: http://stackoverflow.com/comment/44843317
type: AcceptedAnswer

http://stackoverflow.com/comment/44780137
has text: Yes I tried. Did not work. It printed undefined.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28207520
type: QuestionComment

http://stackoverflow.com/comment/44830584
type: QuestionComment
type: Comment
has text: See if this is better: http://jsonselect.org/#tryit
comment on: http://stackoverflow.com/q/28234347
score: 0

http://stackoverflow.com/q/28260547
tagged with: events
score: 2
type: AnsweredQuestion
has title: Backbone subview events not firing
type: Question
tagged with: javascript
upvote count: 2
downvote count: 0
answer count: 1
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/44882240
has comment: http://stackoverflow.com/comment/44880659
has answer: http://stackoverflow.com/a/28276366
accepted answer: http://stackoverflow.com/a/28276366
has body: For some reason my view events are not firing and I don't know what is wrong... Here is the code: TasksView = ****.Views.BaseView.extend({ id: 'log-container', className: 'row-fluid', initialize : function(){ this.task_selection_view = new TaskSelectionView(); }, remove : function(){ this.task_selection_view.remove(); Backbone.View.prototype.remove.call(this); }, render : function(){ $(this.el).html(Templates['log/log']); $('#selection',this.el).append(this.task_selection_view.render().el); return this; } }); TaskSelectionView = ****.Views.BaseView.extend({ className : 'row-fluid', events : { 'click #fire' : 'fire' }, render: function(){ $(this.el).html(Templates['log/task_selection']); return this; }, fire : function(event){ event.preventDefault(); console.log('fire'); } }); log template: task_selection template: fire I tried a lot of things but could not understand what the problem is...

http://stackoverflow.com/comment/44752309
comment on: http://stackoverflow.com/q/28192234
score: 0
type: Comment
type: QuestionComment
has text: I´ve done an overlay extension, with a window in XUL. Then i just started creating a new extension with SDK from scratch, i´ve followed the guide from MDN, i´ve created a button in the panel, and all i can open is a tab or browser window, but i don´t need the tabs bar, the panel and address bar. And I wonder if there is any way to do the same window with SDK, and I don´t know if it´s a good practice to use a XUL window in SDK extension.

http://stackoverflow.com/a/28238745
has comment: http://stackoverflow.com/comment/44843796
type: Answer
has comment: http://stackoverflow.com/comment/44857527
upvote count: 2
answers question: http://stackoverflow.com/q/28238672
has comment: http://stackoverflow.com/comment/44858889
has body: Don’t use submit. I.e., don’t use . Instead, make two separate buttons and call different functions onclick. Mind you that you can still get the form values. I.e., Use return, and now you can use the function. If you want to return to the form back without going to the next page then just return false in the JavaScript code.
has comment: http://stackoverflow.com/comment/44856845
score: 2
accepted answer of: http://stackoverflow.com/q/28238672
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44844802
has comment: http://stackoverflow.com/comment/44842455
has comment: http://stackoverflow.com/comment/44857489

http://stackoverflow.com/comment/44664973
comment on: http://stackoverflow.com/q/28146604
type: QuestionComment
has text: @RoryMcCrossan no errors in console or anywhere as far as I'm aware. I do believe `preventDefault()` IS being called because the other textboxes are being populated.
type: Comment
score: 0

http://stackoverflow.com/comment/44653100
has text: @tealou right, but you're using jQuery _anyway_, why reinvent the wheel?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28122948

http://stackoverflow.com/q/28138910
has comment: http://stackoverflow.com/comment/44649532
answer count: 1
score: 0
has title: vertical smooth scroll up and down
has answer: http://stackoverflow.com/a/28139168
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: Note: may be a duplicate I want a vertical slider but, for a group of boxs instead of image. I tried to use: window.location.href = "#feed_box"; scrollTo scrollTop All of them where working fine except scrollTop but, the problem with window.location.href was all the boxes have same id 'cause they all are echoed (php) from a while loop .So, it takes to the same box insted of the next. jQuery: var x= $(window).scrollTop(); $("#feed_up").click(function(){ $("html, body").animate({ scrollTop: x - 960 }, 550); }); $("#feed_down").click(function(){ $("html, body").animate({ scrollTop: x + 960 }, 550); });` The problem in this script is it skips one or two box(post). Briefly, i want this code to not skip a box or window.location.href to not to get the same box id.
has comment: http://stackoverflow.com/comment/44649593
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: css

http://stackoverflow.com/comment/70640720
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28166854
has text: You can find the new appended element when it has id. For example when you have `$('#myspecialselect').selectmenu();`, the new element is `$("#myspecialselect-menu")`

http://stackoverflow.com/comment/44638766
comment on: http://stackoverflow.com/q/28132939
score: 0
has text: It's not that tricky, you would just use angular-selectize in your directive instead of using a normal select. Without a directive it's much simpler but using a directive is recommended so that it can be re-used.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44686494
type: Comment
comment on: http://stackoverflow.com/q/28157550
type: QuestionComment
has text: Is the moving done using integers, or real numbers?
score: 0

http://stackoverflow.com/comment/44821698
has text: problem solved! I had the try/catch outside the loop, oops! now it works, thanks so much Alexis for all your help and help me open my eyes more :-)
comment on: http://stackoverflow.com/a/28228914
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/55989666
type: Answer
answers question: http://stackoverflow.com/q/28161670
score: 0
has body: Instead of using two HtmlServices separated with coma in return statement of your doGet(e) function (that has not worked for me - I got only one return value) you can put window.top.close(); in onClick event of your submit button like this: Replace: &lt;input type="submit" value="Submit"&gt; With: &lt;input type="submit" onclick="this.value='Magic ...'; google.script.run.withSuccessHandler(closeWindow); "&gt; and add somewhere in your html: &lt;script&gt; function closeWindow() { window.top.close(); } &lt;/script&gt; I hope this will be of some use to someone somewhere someday :) Cheers :)

http://stackoverflow.com/comment/44747041
has text: JSON response would be easier to manipulate. Either way, if you will decide to stay with XML, here is a little help: http://www.w3schools.com/ajax/ajax_xmlfile.asp
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28189372

http://stackoverflow.com/comment/44822842
score: 0
type: Comment
type: AnswerComment
has text: I ended up doing `currentUser: Ember.computed.alias('currentUser')` and it worked! Thanks! If I wanted to use the `currentUser` object inside a function, would I reference it using the `Ember.computed.alias('currentUser')` every time? And if so, when would I use `this.get('currentUser')` - it was my understanding that the whole point of the initializer and injecting the object was so that the object would be available globally in every route and controller.
comment on: http://stackoverflow.com/a/28230071

http://stackoverflow.com/comment/44883083
score: 0
type: Comment
has text: What do you mean by "must showed data from local storage"? I did not write that counddown is not working but I wrote that until-property is wrong.
type: AnswerComment
comment on: http://stackoverflow.com/a/28251952

http://stackoverflow.com/q/28254032
tagged with: javascript
has body: I've got the following script which swaps the source of an image. However currently this happens after the page loads so the user experiences a split second of seeing one picture before it switches to the correct image. &lt;script&gt; window.onload = function () { var winnerName = $("#leaderboard tr td:eq(1)").text().trim(); $("#pictureDiv img").attr("src", "/Content/Images/" + winnerName + ".jpg"); }; &lt;/script&gt; How can I get the image to switch before loading? Note I've also tried: &lt;script&gt; $(function() { var winnerName = $("#leaderboard tr td:eq(1)").text().trim(); $("#pictureDiv img").attr("src", "/Content/Images/" + winnerName + ".jpg"); }); &lt;/script&gt; but this results in the same thing occurring
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28255309
tagged with: jquery
has comment: http://stackoverflow.com/comment/44866749
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44866902
type: Question
has title: How to get JQuery to swap picture prior to page being displayed

http://stackoverflow.com/q/28208388
tagged with: ajax
linked to: http://stackoverflow.com/q/22007212
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28208636
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44782087
has title: Bootstrap Contact Form with jQuery Validation and AJAX
type: Question
has comment: http://stackoverflow.com/comment/44781814
tagged with: jquery-validate
score: 0
has body: I have a simple bootstrap contact form that I'm trying to implement with AJAX and jQuery validation. I feel like I'm pretty close but there are a few things that I can't get to work quite right. The forms validate according to input (ideally I'd like the phone number to be validated as digits; however, I'm new to contact form validation), but the contact form will still send even if the answers are not correct. In addition, the success box will always pop up after the form submits ... I'd like the form to not send if it is filled out incorrectly, and an error box to appear instead of the success. In addition, the email sends through the body of the message, but none of the variables get sent over. So the body of my message looks like: Name: Email: Phone: Message: With no variable appear after each. I know this may be something simple but I'm very new to form validation and I can't figure it out for the life of me. Here's the HTML for the form: Here's the PHP: $status = array( 'type' => 'success', 'message' => 'Email sent!' ); $val = $_POST['val']; $toemail = 'myemail@gmail.com'; $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $msg = $_POST['message']; $subject = 'Thelliotgroup Information Request'; $headers = "From: Thelliotgroup Website :: " . $email . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = "Name: " . $name . " "; $message .='Email: ' . $email . " "; $message .='Phone: ' . $phone . " "; $message .='Message: ' . $msg; $success = mail($toemail, $subject, $message, $headers); echo json_encode($status); die Here's the AJAX and jQuery: var form = $('.contact'); form.submit(function () { $this = $(this); $.post($(this).attr('action'), function (data) { $this.prev().text(data.message).fadeIn().delay(3000).fadeOut(); }, 'json'); return false; }); $.validator.setDefaults({ submitHandler: function (form) { $.ajax({ type: "POST", url: "email.php", data: {'val': $(".cont…
has answer: http://stackoverflow.com/a/28208636
answer count: 1
tagged with: javascript
tagged with: jquery

casperjs
tags question: http://stackoverflow.com/q/28202779
tags question: http://stackoverflow.com/q/28211954
tags question: http://stackoverflow.com/q/28179957
tags question: http://stackoverflow.com/q/28208276
tags question: http://stackoverflow.com/q/28134922
tags question: http://stackoverflow.com/q/28278584
tags question: http://stackoverflow.com/q/28255703
tags question: http://stackoverflow.com/q/28165420
tags question: http://stackoverflow.com/q/28231400
type: Tag
tags question: http://stackoverflow.com/q/28208432
tags question: http://stackoverflow.com/q/28261569
tags question: http://stackoverflow.com/q/28229206
tag name: casperjs

http://stackoverflow.com/a/28223205
type: Answer
accepted answer of: http://stackoverflow.com/q/28222548
has comment: http://stackoverflow.com/comment/81620593
has comment: http://stackoverflow.com/comment/81616780
answers question: http://stackoverflow.com/q/28222548
has comment: http://stackoverflow.com/comment/49097540
has comment: http://stackoverflow.com/comment/49094763
has comment: http://stackoverflow.com/comment/49097025
has comment: http://stackoverflow.com/comment/44811464
upvote count: 28
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/102027410
score: 28
has body: I assume you're displaying a plain http://... (or possibly https://... or file://...) Web page on your kiosk. If you're actually showing an app (i.e., chrome-extension://...), then this strategy will not work. A Chrome extension that injects window.addEventListener("contextmenu", function(e) { e.preventDefault(); }) into every browsing context would probably do the trick to block context menus on iframes. manifest.json: { "manifest_version": 2, "name": "Context Menu Blocker", "version": "1.0", "content_scripts": [ { "matches": ["&lt;all_urls&gt;"], "js": ["contextblocker.js"], "all_frames": true, "match_about_blank": true } ] } contextblocker.js: window.addEventListener("contextmenu", function(e) { e.preventDefault(); }) Simply create a folder and place the two files inside. Then, go to chrome://extensions/, check the Developer Mode box. Finally, click Load unpacked extension... and select the folder you just created. This should prevent the context menu from appearing in anywhere extension content scripts are allowed to run, include any page loaded inside of an iframe. There are few notable points where it fails: Extensions are not allowed to run on chrome:// or chrome-extension:// pages, or on Google's Web Store. If your kiosk is displaying an app, this whole strategy won't work, because this extension won't be able to access iframes inside of another app or extension (even if the source of the iframe is an origin that it would normally have permission to access). If you navigate directly to about:blank, the content script will not run and the context menu can appear. (If about:blank is loaded in an iframe, however, the block will work correctly.) If an iframe has a sandbox attribute that does not include the allow-scripts permission, then the extension cannot block context menus from that iframe. As long as none of those restrictions apply (and as long as a script on the page itself does not clear all event listeners on window), then it should work. I have used t…

http://stackoverflow.com/q/28127341
favorite count: 0
has answer: http://stackoverflow.com/a/28127628
possible better answer: http://stackoverflow.com/a/28127628
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/34422733
tagged with: local-storage
type: Question
tagged with: phantomjs
has body: I am using PhantomJS for testing purposes. I need PhantomJS to remove all the information related to the previous session after the following command, phantom.exit() Actually, it does that and it removes all the cookies, cache and the history in fact. But, It does not remove the saved information for localStorage command automatically. I need to go to the default path for saving this information and remove the file manually. I am wondering if there is any automatic way for removing this file. I tested following ways but none of them worked for me. first of all, I used the following command to set the new path for this information, but PhantomJS did not care about it and just used its previous saved information again. --local-storage-path = path second, I used the page.open part of PhantomJS to clear the path using following command which did not work either for me. localStorage.clear();
tagged with: javascript
accepted answer: http://stackoverflow.com/a/34422733
answer count: 2
downvote count: 0
has title: Removing localStorage file automatically in PhantomJS

http://stackoverflow.com/comment/44788479
type: Comment
has text: how these table id="x" are generated ? by script ? is the id somewhere in the model ? Because other will correct me if I'm wrong but I don't see something in angular to use the id of an element to add or not an ng-repeat
score: 0
comment on: http://stackoverflow.com/q/28212079
type: QuestionComment

http://stackoverflow.com/q/28155876
has body: I am trying to get a single form value from a posted form using HTML and Jquery could anyone tell me what I am doing wrong with the following script. "; I can only seem to return an object but I cant display this using alert or the console.log feature.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28155925
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: forms
has answer: http://stackoverflow.com/a/28155921
score: 0
answer count: 2
tagged with: jquery
favorite count: 0
has title: Obtain single field data Jquery

http://stackoverflow.com/q/28166607
tagged with: dom
answer count: 3
has comment: http://stackoverflow.com/comment/44711126
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28167629
possible better answer: http://stackoverflow.com/a/28167190
has answer: http://stackoverflow.com/a/28167190
tagged with: google-chrome-extension
score: 2
type: AnsweredQuestion
upvote count: 2
has title: Content script sees wrong Document element
type: Question
has answer: http://stackoverflow.com/a/28167629
linked to: http://stackoverflow.com/q/26010355
has comment: http://stackoverflow.com/comment/44711724
has body: I am currently working on a Chrome extension that tries to get the highlighted text from the page displayed in the current tab. It works for some simple pages, like Wikipedia for instance, but does not work for some complex pages, especially main media pages like http://www.nytimes.com/. When I debug my content script below, it seems that the document or window element is not corresponding to the page displayed in my Chrome tab. Here is my manifest.json : { "name": "Capitalize!t2", "version": "3.1.2", "manifest_version": 2, "minimum_chrome_version": "29", "browser_action": { "default_icon": "icon-small.png", "default_popup": "popup.html" }, "content_scripts": [ { "js": [ "selectionjfm.js","jquery-1.11.1.min.js","jquery-ui.min.js" ], "css":["jquery-ui.css"], "matches": [ "http://*/*", "https://*/*"], "all_frames":true }], "icons" : { "16": "icon-small.png", "48": "icon.png", "128": "icon-small.png" }, "key": "MXXXXXX", "permissions": [ "https://secure.flickr.com/","identity", "https://accounts.google.com/*", "https://www.googleapis.com/*","https://spreadsheets.google.com/*","tabs","storage","&lt;all_urls&gt;" ], "oauth2": { "client_id": "XXXXXX", "scopes": ["https://www.googleapis.com/auth/plus.login","https://spreadsheets.google.com/feeds"] } } Here is the intresting part of my popup.js function extractselection(id) { chrome.tabs.query({active:true, windowId: chrome.windows.WINDOW_ID_CURRENT}, function(tab) { chrome.tabs.sendMessage(tab[0].id, {method: "getSelection"}, function(response){ var text = document.getElementById(id); if(response!=null){ text.innerHTML = response.data; } }); }); } Here is then my content script (selectionjfm.cs), a bit messy I am sorry. chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { //console.log("grrroooooooove"+request.method); var toto=""; if (request.method == "getSelection"){ var frame= document.getElementsByTagName('iframe'); if(frame!=null &amp;&amp; frame.length&gt;0){ for(var i=0;i&lt;frame.length…
has answer: http://stackoverflow.com/a/28170914

http://stackoverflow.com/a/28288209
type: Answer
score: 0
has body: The consensus at work, and following from jfriend00, is that it should be written like this: function someFunc (requiredParam, callback) { if (!requiredParam) { callback("missing required param") return } someAsyncMethod(requiredParam, function(someValue) { callback(null, someValue) }) } js2-mode was right. My desire to write one-liners was making my code less clear.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28270894
answers question: http://stackoverflow.com/q/28270894

http://stackoverflow.com/q/28166610
tagged with: jquery
has body: I have a form that include text input for search. I want to submit the form when the users hits enter in the text input if its value is not null or equal to Search..., here is my code: &lt;form action="&lt;?php echo MAIN_URL."search"; ?&gt;" method="post" onkeydown="if (event.keyCode == 13 &amp;&amp; this.getElementByName('search').value!='') { this.submit(); }"&gt; &lt;input type="submit" name="" value=""&gt; &lt;input type="text" name="search" value="Search..." onclick="if(this.value=='Search...')this.value='';" onblur="if(this.value=='')this.value='Search...';" /&gt; &lt;/form&gt;
answer count: 1
has answer: http://stackoverflow.com/a/28166783
favorite count: 0
has title: How to submit a form on the key press and input value?
score: -3
type: AnsweredQuestion
downvote count: 3
tagged with: forms
type: Question
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28166783

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

http://stackoverflow.com/q/28182126
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44733625
has comment: http://stackoverflow.com/comment/44733576
has title: Displaying saved localstorage variables in a textfield - javascript
accepted answer: http://stackoverflow.com/a/28182348
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2010892
tagged with: local-storage
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44733624
has comment: http://stackoverflow.com/comment/44733753
score: -1
has comment: http://stackoverflow.com/comment/44733921
has answer: http://stackoverflow.com/a/28182348
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: i got some saved variables using localstorage, what i want to do is to put them into textfields automatically each time the page loads &lt;script language="javascript"&gt; function save() { var value1 = document.getElementById("email").value; var value2 = document.getElementById("password").value; localStorage.setItem("eaddress", value1); localStorage.setItem("pwd", value2); } &lt;/script&gt; i've got some textfields on the page namely email and password

http://stackoverflow.com/comment/44783162
score: 1
comment on: http://stackoverflow.com/q/28209227
type: Comment
type: QuestionComment
has text: seems working http://jsfiddle.net/qrkwmd2d/

http://stackoverflow.com/q/28147119
score: -4
linked to: http://stackoverflow.com/q/114543
has answer: http://stackoverflow.com/a/28147243
tagged with: css
has comment: http://stackoverflow.com/comment/44665901
has answer: http://stackoverflow.com/a/28147207
has comment: http://stackoverflow.com/comment/44665861
has title: Make a div inside Div - in the middle
type: Question
has answer: http://stackoverflow.com/a/28147220
has answer: http://stackoverflow.com/a/28147580
has answer: http://stackoverflow.com/a/28148025
downvote count: 5
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/28147305
upvote count: 1
has comment: http://stackoverflow.com/comment/44665997
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to make a div inside another one exactly in the middle. Is there any better way to do that? body, html { margin:0; height:100%; } #master_wrapper { width:100px; height:100px; background:#57a957; } #header { left:50%; width:50%; height:50%; background:red; } &lt;div id="master_wrapper"&gt; &lt;div id="header"&gt; Header &lt;/div&gt; http://jsfiddle.net/uba1wr52/
favorite count: 0
has comment: http://stackoverflow.com/comment/44666154
type: UnansweredQuestion

http://stackoverflow.com/comment/44856602
type: QuestionComment
comment on: http://stackoverflow.com/q/28248113
has text: Try this : `jQuery(document).ready(function() { jQuery('#menu-icon').click(function() { jQuery('#switchmenu').slideToggle("fast"); }); });`
type: Comment
score: 1

http://stackoverflow.com/comment/44777940
has text: Hi there, Thanks for the answer. I think I didn't express myself right - sorry, english is not my main language. I need the search box to search for example a avenue. That's not the problem - the searchbox is working fine. The problem is it would create a new marker. I didn't quite understood the position-property of the marker. Also, would var latt = location.lat(); and var lngg = location.lng(); for example work to separate the lat and lng, as they are in separate columns in the DB? Thanks for the attention!
type: Comment
comment on: http://stackoverflow.com/a/28206136
score: 0
type: AnswerComment

http://stackoverflow.com/a/28192391
has comment: http://stackoverflow.com/comment/44752360
upvote count: 2
type: AcceptedAnswer
has body: Your own self-closed tag should not be used The browser interprets if a tag is "self-closeable" or not. It doesn't know your tag as "self-closeable" (he knows only the HTML tags) and this is why it has a strange behavior. On www.w3.org you can find the Elements section: A void element is an element whose content model never allows it to have contents under any circumstances. The following is a complete list of the void elements in HTML: area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr A non-void element must have an end tag, unless the subsection for that element in the HTML elements section of this reference indicates that its end tag can be omitted.... So, the conclusion is: don't use the short form for your own tag. Interpreting your own self-closed tag in browser That strange behavior appears because the browser interprets a self-closed tag like a parent of all siblings that come after it. Let's ignore the AngularJS for the moment, and let's consider 3 new tags that are not in HTML: <x>, <y> and <z>. E.g.: <x></x> <y></y> <z></z> will appear in the source code (F12 in Chrome) as they are. But <x></x> <y/> <z></z> will look like: <x></x> <y> <z></z> </y> Now, they we have this information, let's come back to AngularJS: becomes and the "main" = parent is found and replaced by Hello, element! . => one output line => in this case you can also have some text or other tags after the 2nd line of code, because they will be wrapped in the parent and the result will be the same. But, on the other hand: will become that will be displayed 2 times.
type: Answer
accepted answer of: http://stackoverflow.com/q/28192210
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28192210

http://stackoverflow.com/q/28251227
accepted answer: http://stackoverflow.com/a/28253291
has comment: http://stackoverflow.com/comment/44861959
type: AnsweredQuestion
score: 2
upvote count: 2
has body: Most browsers, such as Firefox and Chrome, do Unicode normalization on URLs before requesting them. For example, when chrome or firefox want to open this link: http://fa.wikipedia.org/wiki/سید_محمد_خاتمی which contains persian Unicode characters, they automatically convert this string into: http://fa.wikipedia.org/wiki/%D8%B3%DB%8C%D8%AF_%D9%85%D8%AD%D9%85%D8%AF_%D8%AE%D8%A7%D8%AA%D9%85%DB%8C I want to modify the hyperlinks in my website in a way to prevent browsers from normalizing unicode characters, such that when a user clicks on a linke, its pure (original) URL is requested from the server. Is there any trick for that? E.g. a small javascript code in the source page that links to such URLs. UPDATE: When I request the url by a programming language, e.g. Java's HttpURLConnection, it requests the original URL and do not use any normalization (except that I explicitly call UrlNormalizer.normalize(url)). However, most browsers and Linux's GET command do the normalization.
type: Question
has comment: http://stackoverflow.com/comment/44861868
linked to: http://stackoverflow.com/q/1547899
tagged with: javascript
tagged with: browser
has answer: http://stackoverflow.com/a/28253291
has comment: http://stackoverflow.com/comment/44862652
answer count: 1
downvote count: 0
tagged with: url
has comment: http://stackoverflow.com/comment/44861938
has title: How to force browsers not to normalize a unicode URL?
tagged with: unicode
favorite count: 0

http://stackoverflow.com/comment/44840645
type: Comment
comment on: http://stackoverflow.com/a/28239723
has text: ok so if the variables are already declared in the document like this:
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44714548
comment on: http://stackoverflow.com/q/28172726
type: Comment
type: QuestionComment
has text: You can't know that (at runtime). You could statically analyze the code but that seems to be more effort than it's worth.
score: 2

http://stackoverflow.com/a/28229129
answers question: http://stackoverflow.com/q/28207384
upvote count: 1
downvote count: 0
type: Answer
has body: After trying for a while, I figured it out the code Alexander O'mara provided was correct but the one thing I was missing after that was instead of .innerHTML = fieldval; it just had to be .value = fieldval; apparently because it is an input it would like us to use .value instead .innerHTML Alexander O'mara correct code function openWin() { myWindow = window.open("https://customer/accountpage.php", "myWindow", "width=200, height=100"); myWindow.addEventListener('load', function() { fieldval = myWindow.document.getElementById("accountinfo").value; document.getElementById("formfield").value= fieldval; }); }
score: 1

http://stackoverflow.com/comment/44649620
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28138918
has text: @DanielA.White How can I do that? Just the way I've listed?

http://stackoverflow.com/a/28224893
type: Answer
downvote count: 1
upvote count: 0
score: -1
has body: then just pass-in the elements in elm and what set would be show or hide function MyToggle(elm,set){ if(set=="show"){ $(elm+' .sub-menu').show(); }else{//hide $(elm+' .sub-menu').hide(); } }
answers question: http://stackoverflow.com/q/28224676

http://stackoverflow.com/comment/44793589
comment on: http://stackoverflow.com/a/28207097
has text: I don't know, if this is really the problem, cause setting "console.log(response.tags)" to "console.log(response)" shows the right object as well in your as in my suggestion. For me it seems the syntax to be wrong, cause I am not able to access this document correctly.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28246734
upvote count: 1
has body: I've found out how to count (and display) them. function testAPI() { FB.api('/me/taggable_friends?limit=5000', function(response) { var friendsICT = response.data; var HMF = friendsICT.length; alert(HMF); }); } I've to add this pieace of code ?limit=5000 to reach all the 5000 friends. Now when I alert it, the lenght is correct! I've found out this ?limit thing searching in the notSoClear Facebook documentation. Hope this is/will be helpfull for someone! :)
answers question: http://stackoverflow.com/q/28244642
has comment: http://stackoverflow.com/comment/44862986
score: 1
accepted answer of: http://stackoverflow.com/q/28244642
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44854971
type: Answer

http://stackoverflow.com/q/28228075
upvote count: 2
answer count: 2
tagged with: forms
has title: Cannot read property 'Value'
has body: I just literally spent most of my day trying to fix this issue. A little background: I'm designing a mutli-step form, one of the steps is to choose between two options (both are radio buttons). So for example, step 1 is to choose the gender "male" or "female" and the second step is to enter something in the text input. The problem I have is that when I choose a gender, it doesn't go to the second step. I also had an issue where it did go to the second step but the value returned was "unidentified". $('#gpadding input:radio').addClass('input_hide'); $('label').click(function() { $(this).addClass('selected').siblings().removeClass('selected'); }); var gender, fname, lname; function _(x) { return document.getElementById(x); } function next1() { gender = _("gender").value; _("step1").style.display = "none"; _("step2").style.display = "block"; } function next2() { fname = _("firstname").value; lname = _("lastname").value; _("step2").style.display = "none"; _("show_all_data").style.display = "block"; _("display_gender").innerHTML = gender; _("display_fname").innerHTML = fname; _("display_lname").innerHTML = lname; } Gender MALE FEMALE Next Close Name Next Close Complete Register Close
has comment: http://stackoverflow.com/comment/44819963
has comment: http://stackoverflow.com/comment/44819224
possible better answer: http://stackoverflow.com/a/28228227
tagged with: javascript
has comment: http://stackoverflow.com/comment/44819502
has answer: http://stackoverflow.com/a/28228227
has comment: http://stackoverflow.com/comment/44819243
has comment: http://stackoverflow.com/comment/44819185
has comment: http://stackoverflow.com/comment/44819433
has comment: http://stackoverflow.com/comment/44819188
score: 2
tagged with: radio-button
has answer: http://stackoverflow.com/a/28228307
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44819232
has comment: http://stackoverflow.com/comment/44819319
downvote count: 0
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44819261
has comment: http://stackoverflow.com/comment/44819218
tagged with: multi-step
has comment: http://stackoverflow.com/comment/44819244
accepted answer: http://stackoverflow.com/a/28228307

http://stackoverflow.com/q/28243385
has comment: http://stackoverflow.com/comment/44847570
has answer: http://stackoverflow.com/a/28243754
has title: HTML5 - Check if autoplay is allowed
tagged with: audio
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28243754
downvote count: 0
tagged with: javascript
has body: My website plays background music with autoplay. I made it use my custom controls for play and pause. Now, I'd like to set the initial state according to what is going on. If the music is about to play for real, it should show pause icon, otherwise (e.g. on mobile) play icon. I would use audio.paused boolean value, but it's always false before the audio is loaded. I would use audio.autoplay value, but it's always true for me, even on devices that don't support it. Is there any clean way to know whether the audio will be played? I would like to keep it in sync with autoplay attribute, so if I decided to remove it, the state should always show play icon in the beginning.
has comment: http://stackoverflow.com/comment/44847631
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28178778
has answer: http://stackoverflow.com/a/28179193
has comment: http://stackoverflow.com/comment/44727880
has comment: http://stackoverflow.com/comment/44727218
has title: ReferenceError: onclick function is not defined
has comment: http://stackoverflow.com/comment/44727157
type: Question
tagged with: javascript
tagged with: jquery
has body: I've gotten a "ReferenceError: function is not defined on the saveRoute function". Everything seems right to me but i could not figure out the problem. Here is the related codes. and in the html Save
score: 0
has comment: http://stackoverflow.com/comment/44727041
has comment: http://stackoverflow.com/comment/44726793
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44726865
type: UnansweredQuestion

http://stackoverflow.com/q/28249507
tagged with: ruby-on-rails
type: Question
has body: Strange problem: I'm using jQuery UI with Rails 3.2, and some of the widgets are coming up with "ui-state-disabled", and there is nowhere in my code or CSS that I'm causing that to happen. For example, I create a slider widget as follows (coffeescript): el.slider min: parseFloat(el.attr("min")) max: parseFloat(el.attr("max")) value: parseFloat(el.attr("value")) step: 0.5 slide: (e, ui) -&gt; [ ...do stuff...] And here's what I get in the browser: &lt;div class="sliderDisplay ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all ui-slider-disabled ui-state-disabled" min="2.0" max="20.0" value="4.0" aria-disabled="false"&gt; I tried adding the option "disabled: false" to the call to slider(), but it didn't have any effect. Note that aria-disabled is "false", which seems strange - I would think that this attribute would be in agreement with the ui-state-disabled class. I have the same problem with the close button in the dialog titlebar. It is also ui-state-disabled and will not respond to clicks. Again, I'm opening it normally, and I haven't extended these widget classes in any way. Any ideas?
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/44865435
score: 0
has title: jQuery UI is disabling widgets - no idea why
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44866352
answer count: 0

http://stackoverflow.com/comment/44806769
type: AnswerComment
has text: @artmees not sure, It only calls the setter once in mine and 0 times the getter when I run "currentUser.user = { name: 'name', title: 'title', email: 'email' }" in the console.
comment on: http://stackoverflow.com/a/28220520
type: Comment
score: 0

configuration
tags question: http://stackoverflow.com/q/28237926
type: Tag
tag name: configuration
tags question: http://stackoverflow.com/q/28226632

http://stackoverflow.com/q/28251496
tagged with: get
score: 0
tagged with: gmail
type: UnansweredQuestion
has body: I'm really new to Google Appscript, so please forgive me if this question sounds stupid. I am trying to past variables from a PHP script into a Google App Script to utilise Gmail to send emails. I'm not quite sure if I am going about it the right way, but I'm trying to pass the variables to the appscript via a get request in the URL and access them that way. //get the variables from the url and send email function doGet(e){ var first_name = e.parameter.first_name; var last_name = e.parameter.last_name; var email = e.parameter.email; var phone = e.parameter.phone; GmailApp.sendEmail(first_name,last_name + email, phone); } doGet(); I tested it's ability to get the variables from the url via a get request by deploying it as a web app and passing some test variables in the URL: https://script.google.com/macros/s/AKfycbzk14ZKDdsofFqx0vU2_kFIXLTduAMvy_G_9MyuS_d046MZIGQb/exec?first_name=testname&amp;last_name=testname&amp;phone=testname&amp;email=testname However, I get the following error on the page: TypeError: Cannot read property "parameter" from undefined. (line 24, file "Code", project "email 6") Could you please tell me what I am doing wrong here or is there an even better way to solve this sort of problem. Thanks!
tagged with: php
has title: How to Pass Variables from an External php script to Google App script
type: Question
tagged with: google-apps-script
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28252224

http://stackoverflow.com/a/28142518
score: 1
accepted answer of: http://stackoverflow.com/q/28142469
answers question: http://stackoverflow.com/q/28142469
has body: Just split and filter, e.g.: text.split('\n').filter(function (s) { return s.match('name') })
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44851334
type: AnswerComment
has text: Not a very experienced programmer (hence poor descriptive skills) so if you still need clarification let me know.
type: Comment
comment on: http://stackoverflow.com/a/28244270
score: 0

http://stackoverflow.com/comment/44900665
comment on: http://stackoverflow.com/a/28235148
type: AnswerComment
has text: Thanks Nano, and if I had three or more accordions and If I wanted to compare "(window.location.href)" to the last part of the URL, what do I need to do then?
score: 0
type: Comment

http://stackoverflow.com/q/28212368
has comment: http://stackoverflow.com/comment/44788924
has body: i have this function: var isValidDate = function (date) { var regEx = /^\d{2}\\d{2}\\d{4}$/; return date.match(regEx) !== null; }; I want to validate my date with this form : 23/01/2015 My question is my REGEX it is good ..?
has answer: http://stackoverflow.com/a/28213182
type: Question
has comment: http://stackoverflow.com/comment/44789184
tagged with: javascript
has comment: http://stackoverflow.com/comment/44795097
has comment: http://stackoverflow.com/comment/44788965
linked to: http://stackoverflow.com/q/14755637
has comment: http://stackoverflow.com/comment/44789400
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44789248
has title: How do I validate a date in this format (dd\mm\yyyy)
has answer: http://stackoverflow.com/a/28212530
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44788902
has comment: http://stackoverflow.com/comment/44788878
has answer: http://stackoverflow.com/a/28212453
tagged with: regex
has comment: http://stackoverflow.com/comment/44794765

http://stackoverflow.com/q/28195785
has body: I'm making a html canvas game and I use requestAnimationFrame. My problem is that in fast computers it runs at full speed (60 fps) But in slower computers it runs slower like 10 fps, and then the game slowes down. I want to do it at the same speed just do it laggier. Like in minecraft, w.o.t. or l.o.l., the zombie comes to you at the same speed, just laggier if you use worse computer. Sorry for my English and Thanks for the answers! Code removed.
type: Question
tagged with: javascript
score: 0
tagged with: canvas
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/44758418
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44758248
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44758427
has title: Do the same interval just laggier in javascript
answer count: 0

http://stackoverflow.com/comment/44626701
type: AnswerComment
score: 0
type: Comment
has text: @Roamer-1888 well I meant "DOM" in the generic sense; *a* Document Object Model, not necessarily *the* Document Object Model. Basically an AST for parsed HTML/XML.
comment on: http://stackoverflow.com/a/28126800

http://stackoverflow.com/a/28149268
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44731509
answers question: http://stackoverflow.com/q/28138498
accepted answer of: http://stackoverflow.com/q/28138498
has comment: http://stackoverflow.com/comment/44749167
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44770437
has body: You can add middleware in your server route. app.route('/api/follows') .post(notification.firstFunction, follows.secondFunction); And now add 2 methods in your contollers. First makes the call to db and add's some result's data to request object which will be forwarded to second method. exports.firstFunction= function(req, res, next) { Notification.doSometing({ }).exec(function(err, result) { if (err) return next(err); req.yourValueToPassForward = result next(); // &lt;-- important }); }; exports.secondFunction= function(req, res) { //... }; Or you can make few database calls in one api method, joining this calls with promises. Example: var promise = Meetups.find({ tags: 'javascript' }).select('_id').exec(); promise.then(function (meetups) { var ids = meetups.map(function (m) { return m._id; }); return People.find({ meetups: { $in: ids }).exec(); }).then(function (people) { if (people.length &amp;lt; 10000) { throw new Error('Too few people!!!'); } else { throw new Error('Still need more people!!!'); } }).then(null, function (err) { assert.ok(err instanceof Error); });

customvalidator
tags question: http://stackoverflow.com/q/28135705
tag name: customvalidator
type: Tag

http://stackoverflow.com/comment/44763632
type: Comment
type: QuestionComment
has text: Give the teacher an apple and ask them
comment on: http://stackoverflow.com/q/28198490
score: 0

http://stackoverflow.com/q/28170314
tagged with: javascript
has body: I am having a list of values inside a loop. I need to turn all those values into exact 5 star rating. I have searched a lot, but i cant get the exact answer what i need. I have tried this: Turn a number into star rating display using jQuery and CSS But it is working only for single value. Consider my code is like this: <?php $a=0; while($a<5) { echo " "; //need to display star rating here $a=$a+1.2; } ?> its just for an example. I want to convert all the values in the textbox into a star rating. In my original code i am taking a loop of values from DB. Please help me to do this. this code is working fine for single value. 2.4618164 but i dont know how to do this for loop of values.
tagged with: jquery
has answer: http://stackoverflow.com/a/60505541
favorite count: 0
has answer: http://stackoverflow.com/a/28174854
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/44712443
has title: Converting values into star rating using JQuery
has comment: http://stackoverflow.com/comment/44710001
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44709977
has answer: http://stackoverflow.com/a/29151841
has comment: http://stackoverflow.com/comment/44713917
downvote count: 0
tagged with: jquery-ui
score: 1
tagged with: rating
linked to: http://stackoverflow.com/q/1987524
has comment: http://stackoverflow.com/comment/44709939
has answer: http://stackoverflow.com/a/60505676
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/44710160

http://stackoverflow.com/q/28150469
accepted answer: http://stackoverflow.com/a/29039919
type: Question
answer count: 3
has body: I am trying to figure out, how i can convert a unix timestamp to a readable date using javascript. For an example, i want to convert this unix: 1422360000, to a date format like this (or something simular): Tue, 27 Jan 2015 12:00:00 GMT Solution: var timestamp = 1422360000; var date = new Date(timestamp * 1000);
has title: Convert UNIX to readable date in javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/29039919
has answer: http://stackoverflow.com/a/28152186
score: 0
tagged with: unix
has answer: http://stackoverflow.com/a/28150486
linked to: http://stackoverflow.com/q/15674093
has comment: http://stackoverflow.com/comment/44672065
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28150486

http://stackoverflow.com/q/28264660
tagged with: javascript
tagged with: angular-ui-bootstrap
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28265905
tagged with: angularjs
has title: AngularJS Modal Singleton in Service Not Updating View
has body: I am trying to create a singleton 'LoadingDialog' service, but when closing an existing dialog, there is no update in the view. ModalDialog service: angular.module('app') .service('modalDialog', function ($modal) { this.create = function (templateUrl, data, size) { return $modal.open({ templateUrl: templateUrl, controller: 'ModalDialogCtrl', size: size, backdrop: 'static', keyboard: false, resolve: { data: function () { return data; } } }); }; this.destroy = function (modalInstance) { modalInstance.close(); }; }); LoadingDialog service: angular.module('app') .service('loadingDialog', function (modalDialog) { this.instance = null; this.show = function (text) { if (this.instance !== null) { this.hide(); } this.instance = modalDialog.create('views/loading-dialog.html', {text: text}); }; this.hide = function () { modalDialog.destroy(this.instance); }; }); You can see that I am storing the instance variable to ensure that only 1 loading dialog is shown at a time. This does not happen. For example, in the Controller, the following code is executed: loadingDialog.show('dialog 1'); loadingDialog.show('dialog 2'); loadingDialog.hide(); Now what I would expect, is for the first dialog to be created, then replaced by the second. When the hide method is invoked, there are no loading dialogs open. Now what actually happens, is that the 2 dialogs are created on top of each other, and when the hide method is invoked, dialog2 is closed but dialog 1 is still open. Only when the loadingDialog service's hide method is explicitly called from a controller does it seem to actually make a change to the view. If called from the service, nothing happens. It seems to me that calling the hide method within the service itself is not updating the view, but I don't know how to fix this.
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28265905

http://stackoverflow.com/q/28222480
has comment: http://stackoverflow.com/comment/44808491
has comment: http://stackoverflow.com/comment/44808668
has comment: http://stackoverflow.com/comment/44812754
has body: I have a requirement where I need to enter 3 values in a jsp form. Production Order number , Operation and Quantity. When I enter these values and click on submit , the background logic is that , For a given "prod order number" and "Operation" , it should update the "Quantity" value into the database. The "Quantity" value can only be either 0 or 1 in the database. Now my requirement is as follows : For example , first time the user enters prod number=20000 , Operation=25, Quantity = 1 . Now again , when user enters the same values for second time , ie., prod number=20000 , Operation = 25 , Quantity = 1 It should not again go to the database and update the the table ( overwriting the existing value which is one ). Instead it should give an alert message like "Operation already completed".
has comment: http://stackoverflow.com/comment/44808157
has comment: http://stackoverflow.com/comment/44808567
has comment: http://stackoverflow.com/comment/44808818
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44808926
has answer: http://stackoverflow.com/a/28238341
has comment: http://stackoverflow.com/comment/44809247
has comment: http://stackoverflow.com/comment/44808572
tagged with: java
tagged with: database
has comment: http://stackoverflow.com/comment/44808894
type: Question
has comment: http://stackoverflow.com/comment/44808717
answer count: 1
tagged with: jsp
has comment: http://stackoverflow.com/comment/44823206
tagged with: javascript
has title: JSP - Need to check for the value in the database with user given value before updating database
score: 0
has comment: http://stackoverflow.com/comment/44808630

http://stackoverflow.com/a/28152071
has comment: http://stackoverflow.com/comment/44675415
has comment: http://stackoverflow.com/comment/44675738
type: Answer
has body: You forget to exit from function. Also you should probably update node's text after checking total. if (value &gt;= total) { return clearInterval(interval); } elem.text(value.toFixed(1) + '$'); fiddle http://jsfiddle.net/Lqxsh39q/ To solve second problem you can pre-calculate duration of each interval before it setup. And use it like second argument in setInterval. Something like duration = 1000 / (total * 10); or any formula that you want. fiddle: http://jsfiddle.net/Lqxsh39q/1/
has comment: http://stackoverflow.com/comment/44675462
has comment: http://stackoverflow.com/comment/44675536
score: 5
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/28152004

http://stackoverflow.com/q/28174663
possible better answer: http://stackoverflow.com/a/28174916
type: Question
has body: I am unable to add 2 numbers taking from inputs. &lt;script&gt; x = document.getElementById('input1').value; y = document.getElementById('input2').value; z = Number(x)+ Number(y); document.getElementById('submit1').addEventListener("click",alpha); function alpha(){document.getElementById('div1').innerHTML="The answer is" + z;} &lt;/script&gt; I need to do this with help of javaSCript only.
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28174713
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28174916
favorite count: 0
has answer: http://stackoverflow.com/a/28174713
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44718438
type: AnsweredQuestion
upvote count: 0
has title: JavaScript Calculating Value of Addition

http://stackoverflow.com/comment/44813944
score: 0
type: Comment
has text: Not sure this will do anything, but you're using a div as a button. Why not switch the trigger to a button? You could also add `role="dialog"` to your `.modal` which sometimes helps.
type: QuestionComment
comment on: http://stackoverflow.com/q/28224571

http://stackoverflow.com/comment/110403303
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/43830980
type: Comment
has text: @AturSams You check that MessageEvent.origin, MessageEvent.source or MessageEvent.ports are what you want. As always the documentation is the best place to start: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent

http://stackoverflow.com/q/28183505
has answer: http://stackoverflow.com/a/55681525
linked to: http://stackoverflow.com/q/2246631
type: UnansweredQuestion
has title: Disable ckeditor context menu in version 4.4.6
upvote count: 5
linked to: http://stackoverflow.com/q/25023478
type: Question
score: 5
tagged with: ruby-on-rails-4
has answer: http://stackoverflow.com/a/28190742
downvote count: 0
tagged with: javascript
tagged with: ckeditor
has answer: http://stackoverflow.com/a/44516884
has body: I am using ckeditor in a Rails4 project. I have tried both the ckeditor gem and the ckeditor_rails gem to provide the ckeditor libraries. There are multiple posts here by people wanting to remove the ckeditor context menu so that the native browser context menu can be displayed. This is usually to enable the browser spellchecker to be used rather than the ckeditor paid / advertised spellchecker. how-to-remove-contextmenu-in-ckeditor-4-3 ckeditor-3-6-3-enable-browser-spellcheck-and-disable-context-menu how-to-disable-ckeditor-context-menu/20229730#20229730 The third link has the most replies but none of them are universally accepted. Generally the reply is to remove the contextmenu plugin by placing the following in the ckeditor config.js config.removePlugins = 'contextmenu'; There is also the suggestion that contextmenu is a dependency on other plugins and different people add a multitude of other plugins to be removed as well. One helpful post suggests running the following code in the console to establish the dependencies. $.each(CKEDITOR.plugins, function(k, v){ v.requires &amp;&amp; console.log("Plugin '" + k + "' requires: " + v.requires) }) This seems to work well and suggests that tabletools and liststyle plugin is dependent on contextmenu. So we end up with config.removePlugins = 'liststyle,tabletools,contextmenu'; Unfortunately this does not disable the context menu in the version of ckeditor that I am using (4.4.6 established by adding alert(CKEDITOR.version) in the config.js) Finally there is a suggestion to use the following code in config.js CKEDITOR.on('instanceReady', function(ev) { ev.editor.editable().addClass('cke_enable_context_menu') }); There is no suggestion as to how this is meant to disable the context menu but in any case it makes no difference for me. For me this is a showstopper as the ckeditor context menu hides the browser spelling suggestions and the cut and paste options it contains do not actually work but just bring up the browser di…
has answer: http://stackoverflow.com/a/76772882
linked to: http://stackoverflow.com/q/11549038
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/46803667

http://stackoverflow.com/q/28223278
has answer: http://stackoverflow.com/a/28223541
favorite count: 0
has title: Trouble with printing in JavaScript Code School "Closures" task
has answer: http://stackoverflow.com/a/28223371
tagged with: string-formatting
accepted answer: http://stackoverflow.com/a/28223541
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28223371
score: 1
type: Question
answer count: 2
has body: New to Stack Overflow and posting. Just started getting into JavaScript and I'm stuck on a CodeSchool closure problem. The problem is: Now that the alerts are effectively counted for a particular obstacle, the Dev Girls need you to store the reported obstacle locations so that a list of danger zones for each obstacle can be reported with each new warning (they are working on the remote-controlled laser beam sharks and are really pressed for time). Employing closure in your warning maker, find a way to store each new location in an array called zones and then report the entire list of current danger zones in every warning that goes out for that particular obstacle. Your new alert message should be as follows: Beware! There have been obstacle sightings in the Cove today!number obstacle(s) spotted at the location! This is Alert #count today for obstacle danger. Current danger zones are: zone1 zone2 zone3 I'm having trouble getting the zones printed out on new lines. My code that won't work: function warningMaker( obstacle ){ var count = 0; var zones = []; return function ( number, location ) { count++; zones.push(location + "/n"); alert("Beware! There have been "+obstacle+" sightings in the Cove today!\n" + number+" "+obstacle+"(s) spotted at the "+location+"!\n" + "This is Alert #"+count+" today for "+obstacle+" danger.\n" + "Current danger zones are:\n" + zones); }; } Any help would be great!
has comment: http://stackoverflow.com/comment/44812706
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44809767

http://stackoverflow.com/q/28240622
answer count: 2
upvote count: 1
tagged with: windows-phone-8
has comment: http://stackoverflow.com/comment/44922871
tagged with: javascript
has title: Cordova problems with windows phone 8
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28820910
downvote count: 0
score: 1
favorite count: 0
tagged with: cordova
accepted answer: http://stackoverflow.com/a/28820910
type: Question
possible better answer: http://stackoverflow.com/a/28787808
has answer: http://stackoverflow.com/a/28787808
has body: I am having 2 issues that I can't seem to find a working solution for while using cordova in visual studio 2013. In the config.xml I specified that the orientation should be in portrait mode with this code: &lt;preference name="Orientation" value="portrait" /&gt; When I run the app on android it obeys this preference just fine and the app does not rotate nor use landscape mode. However on windows phone 8 it still rotates to landscape mode ignoring the setting. The other issue is that I can't get navigation to work correctly under windows phone 8. My javascript file has this code: (function () { "use strict"; document.addEventListener('deviceready', onDeviceReady.bind(this), false); function onDeviceReady() { // Handle the Cordova pause and resume events document.addEventListener('pause', onPause.bind(this), false); document.addEventListener('resume', onResume.bind(this), false); document.addEventListener("backbutton", onBackKeyDown, false); }; function onPause() { // TODO: This application has been suspended. Save application state here. }; function onResume() { // TODO: This application has been reactivated. Restore application state here. }; function onBackKeyDown() { history.go(-1); navigator.app.backHistory(); }; })(); Again it runs perfectly on Android, however on windows phone 8 the backbutton event does not seem to be called at all. Nothing I put in the function seems to run. So it seems to be ignoring the listener or not using it. Any ideas on how to get this code working correctly for windows phone 8 using cordova?

http://stackoverflow.com/a/28254444
has comment: http://stackoverflow.com/comment/44868853
type: Answer
answers question: http://stackoverflow.com/q/28254026
downvote count: 0
has comment: http://stackoverflow.com/comment/44867754
score: 1
has body: You are not passing the state of the timer into the callback properly, so this code always no-ops VisualTimer.prototype.timerUpdated = function(timerData) { if (typeof(timerData) == "object") { if (timerData.state == Timer.stateRunning) { // THIS IS ALWAYS FALSE // Update the timer's display elements with new values this.updateDisplayElements(timerData.hours, timerData.minutes, timerData.seconds); } else if (timerData.state == Timer.statePaused) { // Make sure the correct values are displayed this.updateDisplayElements(timerData.hours, timerData.minutes, timerData.seconds); window.alert("The timer has been paused!"); } else if (timerData.state == Timer.stateStopped) { // Reset the timer's input and display elements this.updateDisplayElements(); this.updateInputElements(); window.alert("The timer has been stopped!"); } } }; because there is in fact no state property on timerData. Here is where you set the state. At this point the this object is the Timer object itself // Set the current state to running this.state = Timer.stateRunning; Then when you call the above noop code, you do: if (fireCallback &amp;&amp; this.updateCallback != null) this.updateCallback.call(this.callbackObject, this.getCurrentValues()); Which sets this to this.callbackObject which does not have a state property. The callbacks are getting called, just not properly.
upvote count: 1
has comment: http://stackoverflow.com/comment/44867664
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28254026

http://stackoverflow.com/a/28277953
answers question: http://stackoverflow.com/q/28277854
has body: You now only have one target, "Map" Also I assume selectedId and windowCountare set somewhere else, right? Try var windowCount = 0; var selectedId = "some string"; var mapForm; . . . mapForm = document.createElement("form"); var tgt = "Map" + (windowCount++); // define the target here mapForm.target = tgt; mapForm.method = "POST"; // or "post" if appropriate mapForm.action = "http://www.zensolutions.co.nz/dev/httpdump"; var mapInput = document.createElement("input"); mapInput.type = "hidden"; mapInput.name = "selectedId"; mapInput.value = selectedId + tgt; // is this set somewhere? mapForm.appendChild(mapInput); document.body.appendChild(mapForm); map = window.open("", tgt,"height=600,width=800,scrollbars"); // reuse target here if (map) { setTimeout(function() { // give IE time to respond mapForm.submit(); }, 10); } else { alert('You must allow popups for this map to work.'); } PS: If you are using jQuery it is quite easy to show a div and replace the content of the div with the result of a post.
accepted answer of: http://stackoverflow.com/q/28277854
has comment: http://stackoverflow.com/comment/44912440
has comment: http://stackoverflow.com/comment/44912374
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28239208
has comment: http://stackoverflow.com/comment/44861296
has body: EDIT: i created a mini earning money game. it doesnt handle negatives yet (like you can buy and have negative money). it also doesnt handle decimals. but this should get you started on what you wanted for the purposes of the question and modified scope in the comments. i only have 2 elements, but you can make an array, and loop through the array for addition income makers. $(document).ready(function() { var totalMoney = 0; var storeCount = 0; var hotelCount = 0; $('.addMoney').on('click', function(e) { e.preventDefault(); totalMoney = checkTotalMoney(); totalMoney++; $('.money').html(totalMoney); }); $('.addStore').on('click', function(e) { e.preventDefault(); var currentTotal = checkTotalMoney(); $('.money').html(currentTotal - 10); // subtract $10 storeCount++; }); $('.addHotel').on('click', function(e) { e.preventDefault(); var currentTotal = checkTotalMoney(); $('.money').html(currentTotal - 50); // subtract $10 hotelCount++; }); setInterval(function(){ var currentTotal = checkTotalMoney(); var totalStoreIncome = 0; var totalHotelIncome = 0; if (storeCount > 0) { totalStoreIncome = 1 * storeCount; // rate of 1/second } if (hotelCount > 0) { totalHotelIncome = 6 * hotelCount; // rate of 6/second } currentTotal = currentTotal + totalStoreIncome + totalHotelIncome; $('.money').html(currentTotal); if (currentTotal >= 50) //show different buying options { $('.hotel').show(); $('.store').show(); } else if (currentTotal >= 10) { $('.hotel').hide(); $('.store').show(); } else { $('.hotel').hide(); $('.store').hide(); } updateCounts(storeCount, totalStoreIncome, hotelCount, totalHotelIncome); }, 1000); }); function checkTotalMoney() { return parseInt($('.money').html()); } function updateCounts(storeCount, totalStoreIncome, hotelCount, totalHotelIncome) { $('.storeIncome .count').html(storeCount); $('.storeIncome .profitRate').html(totalStoreIncome); $('.hotelIncome .count').html(hotelCount); $('.hotelIncome .profitRate').html(totalHotelIncome); $('.totalProfit').html(pa…
has comment: http://stackoverflow.com/comment/44843396
answers question: http://stackoverflow.com/q/28238854
has comment: http://stackoverflow.com/comment/44845911
score: 0
type: Answer

http://stackoverflow.com/comment/44637287
has text: the mistake could be the getElementById or the loop on just 1 element.. who knows :) he's not specifying that he wants to iterate on a set of select elements..
type: AnswerComment
comment on: http://stackoverflow.com/a/28132355
type: Comment
score: 0

http://stackoverflow.com/a/57806952
has comment: http://stackoverflow.com/comment/103576647
has body: If you already have the target object, so you don't want to create it anew (like if updating an array) you must copy the properties. If have done it this way: Object.keys(source).forEach((key) =&gt; { copy[key] = source[key] }) Praise is due. (look at headline "version 2")
score: -2
upvote count: 0
answers question: http://stackoverflow.com/q/28150967
type: Answer
downvote count: 2

http://stackoverflow.com/q/28157914
linked to: http://stackoverflow.com/q/13154295
has body: Is it possible to have intermediate (2.5, 3.5, 4.5, etc.) zoom levels on a Leaflet map that is using Stamen Toner-lite tiles? This is the code I have so far that calculates the zoom level: leafletmap.on('zoomstart', function (d){ targetZoom = leafletmap.getZoom(); //Grabs whatever current zoom level is targetZoom = targetZoom +.5; //Adds .5 leafletmap.setZoom(targetZoom); //Sets new value to zoom level console.log(targetZoom); //Consoles out new value }); I tried just adding .5 to the code, but I get a too much recursion error, so I'm guessing it's not that simple. Any help or direction is greatly appreciated!
favorite count: 0
has answer: http://stackoverflow.com/a/28158631
score: 6
tagged with: maps
upvote count: 6
accepted answer: http://stackoverflow.com/a/28158631
type: AnsweredQuestion
tagged with: leaflet
possible better answer: http://stackoverflow.com/a/57962876
has answer: http://stackoverflow.com/a/57962876
type: Question
tagged with: javascript
has title: Leaflet: Are custom zoom levels possible?
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/44851661
has text: Sure, just replace it with a function that's called like `attr(this, what)` etc
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28245487

http://stackoverflow.com/comment/44828585
type: QuestionComment
comment on: http://stackoverflow.com/q/28194086
has text: Yup, I would need the full $(this) in the QualityChange method, but it is a different scope, this is the viewAction, but I wanna access the same this I have in the anonym method (the firs click line in my sample)
score: 0
type: Comment

http://stackoverflow.com/q/28145660
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44664224
score: 0
has title: How to show dates in x-axis using d3.js
has comment: http://stackoverflow.com/comment/44663917
tagged with: d3.js
type: UnansweredQuestion
answer count: 0
has body: I have to draw a line graph but 2 problems arise: My x-axis shows dates with leading zero 01,02,...,31 but only shows them without: 1,2,3,...,31 Repeats 01 at the end, like 01,02,03,...,31,01 var x = d3.time.scale().range([0, width]); var y = d3.scale.linear().range([height, 0]); var formatTime1 = d3.time.format("%d"); x.domain([xMin,xMax]).nice(s1.length-1) y.domain(d3.extent(s1, function(d) { return Math.max(d.value); })); var xMin = d3.min(s1, function(d) { return d.key; }); var xMax = d3.max(s1, function (d) { return d.key; }); var xAxis=d3.svg.axis().scale(x) .orient("bottom") //.ticks(31) .ticks(d3.time.days,1) .tickFormat(formatTime1) var yAxis=d3.svg.axis().scale(y) .orient("left") .ticks(10); The only problem is that on the x-axis dates the last one will print 01. How to remove this last 01?
has comment: http://stackoverflow.com/comment/44665848

http://stackoverflow.com/q/28183683
has comment: http://stackoverflow.com/comment/44736570
has comment: http://stackoverflow.com/comment/44736523
has comment: http://stackoverflow.com/comment/44736745
has comment: http://stackoverflow.com/comment/44736521
has title: String comparison not as expected
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44736806
tagged with: jsx
has answer: http://stackoverflow.com/a/28184046
score: 0
accepted answer: http://stackoverflow.com/a/28184046
has comment: http://stackoverflow.com/comment/44736569
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44741556
has answer: http://stackoverflow.com/a/28183869
has comment: http://stackoverflow.com/comment/44736547
has body: I have written the following code looking for a string token in an array. var parseCSVLines = function(lines) { var valueObj = {}; var delim = ','; var isLayer = false; var isGroup = false; for(var i = 0; i &lt; lines.length; i++){ //skips CR/CF lines if(!lines[i]) continue; //only data lines reach this loop var data = lines[i].split(delim); /*********looks for tag*************/ if(data[0] == '#L' || data[0] == '#l'){ //on occasions, data[0] is '#L' or '#G' still execution reaches here isLayer = true; }else if(data[0] == '#G' || data[0] == '#g'){ isGroup = true; }else{ if(isLayer){ valueObj[data[0]] = { layerInfo: data[1] == 'on' ? true : false }; } else if(isGroup){ valueObj[data[0]] = { GroupInfo: data[1] == 'on' ? true : false }; } } } return valueObj; }; I loop through lines and mark next line to get data. Weirdly when data[0] is '#L' and '#G', first if statement is executed. What have I done wrong?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28183869

http://stackoverflow.com/a/28277075
score: 12
has comment: http://stackoverflow.com/comment/67383395
upvote count: 12
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28276972
answers question: http://stackoverflow.com/q/28276972
type: Answer
has body: The code that you have disables Ctrl+enter. To disable Ctrl+click, you would use the click event: $('a').click(function (e){ if (e.ctrlKey) { return false; } }); Demo: http://jsfiddle.net/WYxUE/45/ Note: Actually disabling ctrl+click would normally not be a good idea, and not very effective. In windows it's used to open the page in a new tab, and if that is disabled you can just use shift+click to open it in a new window instead, or right click and choose Open link in new tab.

http://stackoverflow.com/a/28265931
has body: You should exit; after redirect with headers, because the script will go on executing otherwise which can lead to unintended side effects. but got a notfound error. URL seems wrong, echo the output and see if it matches your expected location.
has comment: http://stackoverflow.com/comment/44888265
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28265899
upvote count: 1
has comment: http://stackoverflow.com/comment/44888489
score: 1

http://stackoverflow.com/comment/44656072
score: 0
type: AnswerComment
type: Comment
has text: gotcha, slipped my mind. (i have four kids, so that happens). On your code: i did change the location of enableFunction(completeBtn); i put it in the function updateItemStatus(). That way the completeBtn booleon will toggle just like the removeBtn. which is doing exactly what i wanted it to. awesome.
comment on: http://stackoverflow.com/a/28131238

http://stackoverflow.com/comment/63014686
has text: Notice that this pattern is already detailed in the [*Mutable contextual state* answer](http://stackoverflow.com/a/28250700/1048572)
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/37771394

http://stackoverflow.com/comment/123509067
type: Comment
comment on: http://stackoverflow.com/q/28165606
type: QuestionComment
score: 0
has text: Duplicate of [Why is my window.setInterval function overlapping itself in the DOM when called multiple times?](/q/53856593/4642212).

http://stackoverflow.com/a/28278674
type: Answer
has body: Maybe your code is not eval. Try put your code in body tag with function wrap like this $(function(){ //document ready function $("#hide_filter").on("click",function(){ console.log('message'); }); });
score: 0
answers question: http://stackoverflow.com/q/28278291

http://stackoverflow.com/q/28186880
has comment: http://stackoverflow.com/comment/44742301
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44742182
has answer: http://stackoverflow.com/a/28197938
favorite count: 0
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44745696
downvote count: 1
has comment: http://stackoverflow.com/comment/44742293
has comment: http://stackoverflow.com/comment/44742256
has answer: http://stackoverflow.com/a/28186949
score: 1
has title: How to store functions into an array and loop through each in javascript
has answer: http://stackoverflow.com/a/69202569
type: Question
has body: function canvasApp() { if (!canvasSupport()) { return; } function drawScreen() { context.font ="13px sans"; context.fillStyle = "#000"; context.beginPath(); context.arc(p1.x,p1.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("1",p1.x-2,p1.y+2); context.fillStyle = "#000"; context.beginPath(); context.arc(p2.x,p2.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("2",p2.x-2, p2.y+2); context.fillStyle = "#000"; context.beginPath(); context.arc(p3.x,p3.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("3",p3.x-2, p3.y+2); context.fillStyle = "#000"; context.beginPath(); context.arc(p4.x,p4.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("4",p4.x-2, p4.y+2); } function drawScreen2() { //draw the points context.font ="13px sans"; context.fillStyle = "#000"; context.beginPath(); context.arc(p9.x,p9.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("9",p9.x-2,p9.y+2); context.fillStyle = "#000"; context.beginPath(); context.arc(p10.x,p10.y,9,0,Math.PI*2,true); context.closePath(); context.fill(); context.fillStyle = "#FFFFFF"; context.fillText("10",p10.x-2, p10.y+2); } var p1 = {x:668, y:220}; var p2 = {x:610, y:370}; var p3 = {x:565, y:490}; var p4 = {x:696, y:220}; var p5 = {x:750, y:370}; var p6 = {x:800, y:490}; var p7 = {x:635, y:415}; var p8 = {x:725, y:415}; var p9 = {x:635, y:415}; var p10 = {x:725, y:415}; theCanvas = document.getElementById('canvasOne'); context = theCanvas.getContext('2d'); setInterval(drawScreen, 513); setInterval(drawScreen2, 765); } in the above code i want to store drawscreen() and drawsscreen2() functions into an array and loop through to display points of each function seperately for an action.. how do i do this can anyone help me with this? jsfiddle.…
tagged with: function
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28187166
upvote count: 2
has answer: http://stackoverflow.com/a/28187180

http://stackoverflow.com/comment/44896864
score: 0
comment on: http://stackoverflow.com/a/28270630
has text: didn't even notice the space was part of the syntax. thanks for answering my variable question as well!
type: AnswerComment
type: Comment

http://stackoverflow.com/a/51039432
has comment: http://stackoverflow.com/comment/101483995
score: 1
has body: (function () { var svg = document.createElementNS("http://www.w3.org/2000/svg","svg"); if(typeof svg["innerHTML"] !== "undefined") { return; } var node = $('&lt;script type="text/svg_template"&gt;&lt;/script&gt;'); Object.defineProperty(SVGElement.prototype, 'innerHTML', { get: function() { try { var childNode = this.firstChild; while (childNode) { node.append($.clone(childNode)); childNode = childNode.nextSibling; } return node.html(); } finally { node.empty(); } } }) })(); set html use: $(svg).html() test on IE11
downvote count: 0
answers question: http://stackoverflow.com/q/28129956
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44672766
type: AnswerComment
type: Comment
has text: possibly using the jQuery Mask Plugin: http://plugins.jquery.com/mask/ I've used this before but it's been a while. Should do the trick though!
comment on: http://stackoverflow.com/a/28133755
score: 0

http://stackoverflow.com/q/28242783
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44918021
has comment: http://stackoverflow.com/comment/44846546
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44946523
has comment: http://stackoverflow.com/comment/44935233
type: Question
has body: I'm using the datatables plugin and it's working fine for me. However, I'm making multiple calls to populate multiple tables, when I know I could make one AJAX call and store the results in a variable and have each table function use that variable for its data, but I can't get it to work. I'm using something like to to get the data I need. var all_data; $.ajax({ async : false, url: 'all_data.php', type: 'GET', success: function(data) { all_data = data; console.log(all_data); } }) The idea is to pass all_data variable into my table function (I have several on this one page) without having to make multiple calls. Doing the following returns one column with the letter "a", which isn't right. The data that comes back is JSON coded. I've used the below code, but with the AJAX function as part of the table function: $("#my_table").DataTable({ "data":all_data , "paging": true, "sDom": '&lt;"top"&gt;t&lt;"bottom"&gt;&lt;"clear"&gt;', "pageLength": 50, "order": 4, "desc" , "aoColumns": [ { "bSortable": true, "width": "0%", "sClass": "lang_body_2", "sTitle": "","visible":false }, { "bSortable": true, "searchable": false, "width": "10%", "sClass": "lang_body_2 table_names", "sTitle": "" }, { "bSortable": true, "searchable": false,"width": "20%", "sClass": "lang_body_2", "sTitle": "Database","visible":false}, { "bSortable": true, "searchable": false ,"width": "20%","sClass": "lang_body_2","sTitle": "National Average","visible":false }, { "bSortable": true, "searchable": false ,"width": "50%","sClass": "lang_body_2 index_num table_index","sTitle": "" }, ], "columns": [ { "searchable": true }, { "searchable": false }, { "searchable": false }, { "searchable": false }, { "searchable": false }, ], "search": { "search": "gen" }, "columns": [ { "width": "20%" }, null, null, null, { "width": "80%" }, ], "initComplete": function(settings, json) { colorIndex();} }); }); What am I doing wrong here? I'm suspecting I have to prepare all_data somehow, but I'm not sure what that might be…
answer count: 1
has title: Push AJAX retrieved JSON into Datatables
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44931963
tagged with: ajax
score: 0
tagged with: datatables
has comment: http://stackoverflow.com/comment/44846623
has answer: http://stackoverflow.com/a/36223781
has comment: http://stackoverflow.com/comment/44848724

http://stackoverflow.com/comment/44975721
type: AnswerComment
comment on: http://stackoverflow.com/a/28273430
score: 0
type: Comment
has text: Actually, the answer to the question "could it be done using a browser plug-in" is no. Plugins can't just arbitrarily rewrite pages. Without something (an extension) adding code to the page, the plugin wouldn't be instantiated at all.

http://stackoverflow.com/q/28219474
has comment: http://stackoverflow.com/comment/44802306
has answer: http://stackoverflow.com/a/28219978
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28219978
tagged with: jquery
has body: i am using the jquery to restrict the language by using the below code and i am unable to show warning message on when we enter other than English language.can anybody help on this issue... &lt;apex:page controller="testcontroller"&gt; &lt;head&gt; &lt;apex:includeScript value="{!URLFOR($Resource.Jquery)}" /&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#Demo').bind('keyup blur', function() { $(this).val($(this).val().replace(/[^A-Za-z $]/g, '')) var regex = new RegExp("[^a-zA-Z]+$"); if(!$(this).value().match(regex)){ alert('Invalid Character usage. Please Use English characters only.'); return false; } }); }); &lt;/script&gt; &lt;/head&gt; &lt;apex:form lang="en"&gt; &lt;input Type="Text" id="Demo"/&gt; &lt;/apex:form&gt;
score: 0
linked to: http://stackoverflow.com/q/1413118
has comment: http://stackoverflow.com/comment/44803385
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28219545
type: Question
possible better answer: http://stackoverflow.com/a/28219545
answer count: 2
has title: How to restrict the data input language for applications to ENGLISH (or Latin alphabet).?

http://stackoverflow.com/q/28210487
possible better answer: http://stackoverflow.com/a/28210509
downvote count: 3
has answer: http://stackoverflow.com/a/28210509
has title: How to run script behind alert box in javascript?
has answer: http://stackoverflow.com/a/28210521
upvote count: 5
tagged with: javascript
type: AnsweredQuestion
score: 2
has body: I want to run alert("hi") in 3 seconds after alert("hello") without clicking on OK of "hello" alert. This is my code: $(function(){ alert("hello"); setTimeout(function(){ alert("hi"); },3000) })
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/28210521
answer count: 2
tagged with: alert

http://stackoverflow.com/q/28238074
has answer: http://stackoverflow.com/a/42659901
downvote count: 0
has answer: http://stackoverflow.com/a/28238414
type: Question
has answer: http://stackoverflow.com/a/38379180
has title: Stubbing a promisified function with sinon and bluebird
tagged with: javascript
upvote count: 13
has body: In the file I would like to test, I have the following code: var httpGet = Promise.promisify(require("request").get); httpGet(endpoint, { auth: {bearer: req.body.access_token}, json: true }) .then(...) Now, in my tests, I want to make sure that httpGet was called once, and make sure the parameters are valid. Before being promisified, my test looked like this: beforeEach(function () { request.get = sinon.stub() .yields(null, null, {error: "test error", error_description: "fake google error."}); }); afterEach(function () { expect(request.get).to.have.been.calledOnce(); var requestArgs = request.get.args[0]; var uri = requestArgs[0]; expect(uri).to.equal(endpoint); //... }); Unfortunately this no longer works when request.get is promisified. I tried stubbing request.getAsync instead (since bluebird appends "Async" to promisified functions), but that does not work either. Any ideas?
tagged with: sinon
favorite count: 0
tagged with: promise
possible better answer: http://stackoverflow.com/a/53526154
has answer: http://stackoverflow.com/a/53526154
score: 13
accepted answer: http://stackoverflow.com/a/28238414
tagged with: node.js
answer count: 4
type: AnsweredQuestion
tagged with: bluebird

class
tags question: http://stackoverflow.com/q/28232190
tags question: http://stackoverflow.com/q/28140597
tags question: http://stackoverflow.com/q/28171234
tags question: http://stackoverflow.com/q/28222276
tags question: http://stackoverflow.com/q/28136437
type: Tag
tags question: http://stackoverflow.com/q/28244204
tags question: http://stackoverflow.com/q/28226570
tags question: http://stackoverflow.com/q/28237641
tags question: http://stackoverflow.com/q/28189931
tag name: class
tags question: http://stackoverflow.com/q/28123151
tags question: http://stackoverflow.com/q/28238387
tags question: http://stackoverflow.com/q/28122588
tags question: http://stackoverflow.com/q/28258353

http://stackoverflow.com/q/28183716
possible better answer: http://stackoverflow.com/a/28183725
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28183731
has answer: http://stackoverflow.com/a/28183725
tagged with: arrays
downvote count: 0
favorite count: 0
type: Question
tagged with: php
has title: How to get from a string array?
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
answer count: 3
has answer: http://stackoverflow.com/a/28183741
tagged with: javascript
has answer: http://stackoverflow.com/a/28183731
has body: an array of server: Array ( [28.01.2015] => Array ( [03] => 2 [02] => 4 ) ) was converted into a string using the json_encode. The result was a string: {"28.01.2015":{"03":2,"02":4}} How to use Javascript to convert this string into an array ?
linked to: http://stackoverflow.com/q/20881213

http://stackoverflow.com/q/28170143
has comment: http://stackoverflow.com/comment/44710666
linked to: http://stackoverflow.com/q/6584635
answer count: 0
has comment: http://stackoverflow.com/comment/44709780
has comment: http://stackoverflow.com/comment/44711198
tagged with: autoit
type: Question
tagged with: arrays
has body: I've run into a bit of a snag. When I return object references like getElementsByTagName, getElementsByClassName, or querySelectorAll directly and return them to AutoIt, I have no issue enuming through the indexes and using the returned objects, but if I try to store the object references from the DOM into an array via array push, I get back the right object.length but the array is null. I thought this might be a local variable issue, so I stored the data globally and still ran into the same issue. From the example below, is there a way to return the object references as if I were calling getElementsByTagName, getElementsByClassName, or querySelectorAll directly, but only the items I want? I'm afraid my javascript knowledge is left wanting. //http://stackoverflow.com/a/25054465/4312966 //Thanks kapa function IEExAutClassGetCollectionFunc() { var autDIV = document.createElement('div'); autDIV.setAttribute('id', 'IEExAutClassGetCollectionId'); document.body.appendChild(autDIV); var autVariable = document.getElementById("IEExAutClassGetCollectionId"); autVariable.IEExAutClassGetCollection = function (oElm, sClass) { var sPattern, oElements, i, aresults = [];//, oRet; if (typeof sClass == 'undefined') {return 1;} oElm = (typeof oElm == 'undefined') ? document : oElm; /* if (oElm.getElementsByClassName) { // IE8+ oRet = oElm.getElementsByClassName(sClass); if (!oRet.length) {return 2;} return oRet } if (oElm.querySelectorAll) { // IE8+ oRet = oElm.querySelectorAll("." + sClass); if (!oRet.length) {return 3;} return oRet } */ // Pushing the array objects is not working // I get the object array back, but the objects are missing // object.length matches on both sides, here object.tagName matches // on the AutoIt side nothing in the .items(n) if (oElm.evaluate) { // IE6, IE7 sPattern = ".//*[contains(concat(' ', @class, ' '), ' " + sClass + " ')]"; oElements = oElm.evaluate(sPattern, oElm, null, 0, null); while ((i = oElements.iterateNext())) { aresults.push(i); } } else { …
tagged with: javascript
has title: Javascript array vs Object references
score: 0
has comment: http://stackoverflow.com/comment/44712244
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44710328
has comment: http://stackoverflow.com/comment/44710522

http://stackoverflow.com/q/28227389
type: UnansweredQuestion
has title: Javascript timer won't countdown to set time
has comment: http://stackoverflow.com/comment/44818065
answer count: 0
type: Question
has body: I'm having an issue with a timer i'm working on, what should happen is that the counter should countdown to a specific time which is defined by me. However for some reason the time i have defined is just ignored and it counts down to the next hour. What i am essentially trying to do is set a timer that will count down the time left to a number of specific times, so far i cannot even get it to work for one single defined time. I've attached a JsFiddle which contains all relevant code. Also would it possible to store the times in an array and have the timer count down to each defined time? Thanks in advance! var definedTime = new Date('Jan 31, 2015 05:00'); // military time to countdown TO function ShowTimes() { var now = new Date(); var hrs = definedTime.getHours() - now.getHours() - 1; if (hrs < 0) { hrs += 24; } var mins = 59 - now.getMinutes(); var secs = 59 - now.getSeconds(); var str = ''; str = now.toString(); str += ' Time until 05:00'; str += ' '+hrs+' hours ' + mins + ' minutes ' + secs + ' seconds'; document.getElementById('timer').innerHTML = str; } var _cntDown; function StopTimes() { clearInterval(_cntDown); } Stop
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44818058
score: 0
has comment: http://stackoverflow.com/comment/44818181
tagged with: timer
has comment: http://stackoverflow.com/comment/44817976

http://stackoverflow.com/a/28149517
has comment: http://stackoverflow.com/comment/44671218
answers question: http://stackoverflow.com/q/28149462
type: Answer
has body: console.log(JSON.stringify(data)) will do what you need. I'm assuming that you're using jQuery based on your code. If you're wanting those two particular values, you can just access those and pass them to log. console.log(data.input_data['quantity-row_122']); console.log(data.input_data['price-row_122']);
has comment: http://stackoverflow.com/comment/128880194
downvote count: 2
score: 99
upvote count: 101
has comment: http://stackoverflow.com/comment/128269124
has comment: http://stackoverflow.com/comment/44671443

http://stackoverflow.com/comment/44854492
type: Comment
type: QuestionComment
score: 0
has text: Look into the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
comment on: http://stackoverflow.com/q/28246907

http://stackoverflow.com/comment/44783630
score: 1
comment on: http://stackoverflow.com/q/28209398
type: Comment
type: QuestionComment
has text: If it's a third party website then you're probably going to get your IP banned if you request it that much.

http://stackoverflow.com/comment/44857254
comment on: http://stackoverflow.com/a/28248294
type: Comment
score: 1
has text: you just need to add validation in the function changeURL. to check if it is a valid data. if not return false. to prevent from any hacks.
type: AnswerComment

http://stackoverflow.com/a/28265800
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28265620
type: Answer
answers question: http://stackoverflow.com/q/28265620
score: 2
type: AcceptedAnswer
has body: Anti-forgery token is a method of preventing Cross-Site Request forgery attacks. When using default MVC methods it has 2 parts to it: Anti-forgery token in your view. It usually is used by using html helper Html.AntiForgeryToken. This causes hidden input field __RequestVerificationToken to be created on a form Attribute ValidateAntiForgeryToken applied to your controller or action methods. In your case error indicates that you have ValidateAntiForgeryToken on your method, but the form method did not submit the second part - field __RequestVerificationToken. In order to fix that you should add a second parameter to your post method: var params = "&amp;agency_id=" + id; params += params + "&amp;__RequestVerificationToken=" + $('input[name=__RequestVerificationToken]').val(); $.ajax({ url: funcs, type: "POST", data: params, }) You can read more about anti forgery token in this blog post
downvote count: 0

http://stackoverflow.com/comment/44856807
type: Comment
score: 0
has text: I have updated the code in my original question to include the logic to switch the span to an input. That wasn't the issue. Go to my fiddle and click on the "some text" span. Notice how the alert message is "missed the read node. clicked the document." The click causes the input to blur, turning it into a span, making it smaller, which moves the original /clicked/ span over to the left, away from where the mouse pointer is. Because it has moved, the click event on the original span doesn't register. I want it to register that click without having to keep the new "stuff" span fixed width.
type: AnswerComment
comment on: http://stackoverflow.com/a/28239242

http://stackoverflow.com/a/28186669
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28186319
has body: onClientClick= '&lt;%# String.Format("return someMethod(&amp;#39;{0}&amp;#39;);", Eval("someVariable")) %&gt;' where someVariable is a string; The 'duplicate answer' that is linked to at the top works fine when someVariable is numeric. When it's a string, \' does not work to escape the single quotation mark, but &#39; will work in this case.
answers question: http://stackoverflow.com/q/28186319
score: 0

http://stackoverflow.com/a/28195954
type: Answer
has body: This line has a misspelled function name, (duplicate): ss.dupliacteActiveSheet(); Should be: ss.duplicateActiveSheet(); In the VIEW menu of the code editor, check the EXECUTION TRANSCRIPT. There will probably be an error msg there.
score: 0
answers question: http://stackoverflow.com/q/28185218

http://stackoverflow.com/q/28188088
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13191015
tagged with: css
has comment: http://stackoverflow.com/comment/44783825
answer count: 0
has title: Send layout of the page through mail with javascript
has comment: http://stackoverflow.com/comment/44745945
type: UnansweredQuestion
has body: My requirement is to send the content of the page through mail on click of a button.when the user will click on the the send mail button then entire content of the page within the form tag should be sent to the mail mentioned by me. I am trying the following but didnt work: function fnSendMail() { var link = "mailto:me@example.com" + "?cc=myCCaddress@example.com" + "&amp;subject=" + encodeURIComponent("This is my subject") + "&amp;body=" + encodeURIComponent(document.getElementById("colMain").innerHTML); //alert(link); window.location.href = link; } ColMain is the id of the main div withing which content will be there. The above code is breaking at the last line. Can any one please help me out for teh same. Thanks in advance!!
has comment: http://stackoverflow.com/comment/44746594
has comment: http://stackoverflow.com/comment/44746829
tagged with: javascript
type: Question
score: 0
linked to: http://stackoverflow.com/q/5620324
has comment: http://stackoverflow.com/comment/44782086

http://stackoverflow.com/q/28236838
upvote count: 3
type: Question
downvote count: 0
tagged with: javascript
has body: I'm developing an AngularJS application and ran into (maybe) a quite basic problem. Multiple controllers are involved which talk to each other via $broadcast and $on. The Application is using websockets and should start to do it's things after the websocket has been opened. So now the question remains, who should open the websocket because all controllers have to be loaded at the time to listen for broadcasts. So there is a service responsible for handling the websocket which does the following: this.websocket = new WebSocket(webSocketUrl()); this.websocket.onopen = function() { $timeout(function() { $rootScope.$broadcast("websocket_opened"); }); }; Now the 'main' controller of the application reacts to this broadcast and sends out a few request. $scope.$on("websocket_opened", function() { // some requests }); Soon after the answer from the server will be in and the aforementioned websocket service will broadcast the arrival of a packet. this.websocket.onmessage = function(data) { $rootScope.$broadcast("packet received", data); }; The problem is, the answers to those requests often reach the client before the 'sub-controllers' have been loaded by AngularJS and so they 'miss' the broadcasts and therefore the data. Is there a way to ensure that all controllers have been loaded and are therefore listening to broadcasts? Am I doing something fundamentally wrong?
tagged with: websocket
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS: Ensure that all Controllers are loaded before broadcasting/emitting events
score: 3
answer count: 0

http://stackoverflow.com/comment/44750263
has text: Not quite sure why you are using d3..but I'd probably just store them in a Raph set and then iterative over the set and remove them (or hide them and reuse later), something like http://codepen.io/anon/pen/ogezEW as an example. Just extra unrelated thought. It also seems a bit slow, so it would be worth looking at something like velocity.js (the glow possibly also slows it a bit, so may be alternatives as well).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28179214
score: 1

http://stackoverflow.com/comment/44759177
has text: *"Can I do that?"* No. The new array is returned by `map`, there is no way to access it during the process.
score: 1
comment on: http://stackoverflow.com/q/28196289
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28213327
downvote count: 0
has body: Your code has a bug here: var daling = 1 - daling; Which should be: var daling = 1 - daling1;
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28213269
answers question: http://stackoverflow.com/q/28213269
type: Answer
score: 2

http://stackoverflow.com/a/28183205
downvote count: 0
type: Answer
has body: The button inside the form is triggering it to be submitted. You are then adding an additional onclick event to the button (onSSFUp(6)). Remove the onclick event and you will see the form still gets submitted when you click the button.
score: 1
accepted answer of: http://stackoverflow.com/q/28183013
upvote count: 1
answers question: http://stackoverflow.com/q/28183013
has comment: http://stackoverflow.com/comment/44735690
type: AcceptedAnswer

http://stackoverflow.com/a/28224305
has comment: http://stackoverflow.com/comment/44813121
has comment: http://stackoverflow.com/comment/44812654
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44812988
downvote count: 0
answers question: http://stackoverflow.com/q/28224122
type: Answer
has body: If your pulling in images using ajax you can test to see if the data is available prior to creating a new image element and simply skip it. That way you don't load up your page with hidden elements. Every element you add to a page uses more memory. If your loading many image tags in the page that fail and your simply hiding them the page is going to get big depending on how big this loop is. When you get a response back check the data and if you get a 404 skip it and go to the next load request and don't add it to the page. also google bots don't like 404 messages. So loading bad image tags into your page will not be valid or clean and google will drop your SEO score. Another thing you should consider is sending a request to the server have the server respond with a list of what files it has so your only sending load requests for what is on the server rather then guessing. [UPDATE] <?php if(file_exists($_GET["photo"])): ?> <?php echo $photo->get_title(); ?> <?php echo $photo->get_time();?> <?php echo $photo->get_views(); ?> <?php endif; ?> this is outside the if statement and will be displayed even if the if statement is false If file_exists() returns false then none of this is displayed. so you don't have to hide it with css as it will not be on the page. There is no point in displaying the divs if there is no data to display. The solution is not css or JavaScript you should simply not show the content if the file is not there. also this part of your code is not your problem. The problem is your giving the user the option to select images that do not exist. If your only giving the user the option to select images where you have the file then file_exists() will return true every time and you will never need to deal with a 404 error. based on your questions and how you wright your PHP, I highly recommend getting a book on PHP. You should refresh on operators and if statements. Once you have reviewed the section on if statements check out formatting of inline php stat…
has comment: http://stackoverflow.com/comment/44812790
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28224122
has comment: http://stackoverflow.com/comment/44813176
has comment: http://stackoverflow.com/comment/44812688

http://stackoverflow.com/comment/73076539
comment on: http://stackoverflow.com/a/28175524
type: Comment
has text: But if I have a twoway PHP encrytion class for generating CSRF there's no problem. If visible or not, must be not edited. If not, when validate SESSION CSRF and INPUT CSRF will fail. Am I wrong?
type: AnswerComment
score: 0

meteor
tags question: http://stackoverflow.com/q/28128540
tags question: http://stackoverflow.com/q/28234857
tags question: http://stackoverflow.com/q/28183153
tags question: http://stackoverflow.com/q/28203366
tags question: http://stackoverflow.com/q/28156543
tags question: http://stackoverflow.com/q/28145063
tags question: http://stackoverflow.com/q/28249381
tags question: http://stackoverflow.com/q/28145621
tags question: http://stackoverflow.com/q/28139102
tags question: http://stackoverflow.com/q/28174210
tags question: http://stackoverflow.com/q/28269972
tags question: http://stackoverflow.com/q/28172446
tags question: http://stackoverflow.com/q/28223107
tags question: http://stackoverflow.com/q/28205869
tags question: http://stackoverflow.com/q/28258978
tags question: http://stackoverflow.com/q/28253283
tags question: http://stackoverflow.com/q/28131909
tags question: http://stackoverflow.com/q/28185856
tags question: http://stackoverflow.com/q/28183458
tags question: http://stackoverflow.com/q/28256484
tags question: http://stackoverflow.com/q/28129602
tags question: http://stackoverflow.com/q/28132404
tags question: http://stackoverflow.com/q/28260850
tags question: http://stackoverflow.com/q/28256234
tags question: http://stackoverflow.com/q/28219561
tags question: http://stackoverflow.com/q/28210534
tags question: http://stackoverflow.com/q/28245792
tags question: http://stackoverflow.com/q/28269399
tags question: http://stackoverflow.com/q/28122091
tags question: http://stackoverflow.com/q/28253125
tags question: http://stackoverflow.com/q/28221441
tags question: http://stackoverflow.com/q/28185010
type: Tag
tags question: http://stackoverflow.com/q/28184016
tags question: http://stackoverflow.com/q/28191677
tags question: http://stackoverflow.com/q/28246879
tags question: http://stackoverflow.com/q/28159288
tags question: http://stackoverflow.com/q/28164429
tags question: http://stackoverflow.com/q/28278338
tags question: http://stackoverflow.com/q/28216044
tags question: http://stackoverflow.com/q/28162136
tags question: http://stackoverflow.com/q/28161155
tags question: http://stackoverflow.com/q/28158624
tags question: http://stackoverflow.com/q/28122252
tags question: http://stackoverflow.com/q/28183652
tags question: http://stackoverflow.com/q/28135409
tags question: http://stackoverflow.com/q/28267042
tags question: http://stackoverflow.com/q/28220531
tags question: http://stackoverflow.com/q/28124985
tags question: http://stackoverflow.com/q/28168471
tags question: http://stackoverflow.com/q/28236145
tags question: http://stackoverflow.com/q/28135919
tags question: http://stackoverflow.com/q/28268538
tag name: meteor
tags question: http://stackoverflow.com/q/28155298
tags question: http://stackoverflow.com/q/28195801
tags question: http://stackoverflow.com/q/28247448
tags question: http://stackoverflow.com/q/28239202
tags question: http://stackoverflow.com/q/28243106
tags question: http://stackoverflow.com/q/28230214
tags question: http://stackoverflow.com/q/28164657
tags question: http://stackoverflow.com/q/28243763
tags question: http://stackoverflow.com/q/28262012

http://stackoverflow.com/a/28210586
score: 0
has body: It probably won't help too much if i just tell you how to do it all, you're probably best to spend some time getting familiar with HTML, PHP and Javascript, it seems like you might be missing a few key concepts. For now, i'd say ignore the javascript part and just focus on the form submission and validation on the server. TL;DR I suggest starting with a video like this: Build a PHP contact form, that should cover some of the basics of form submission and error checking (validation). Then start looking at how to combine javascript and PHP with something like this: Submitting a form with AJAX Hope that helps!
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28191287
accepted answer of: http://stackoverflow.com/q/28191287

http://stackoverflow.com/comment/44686768
has text: I assumed the id is entered by the user, but if it is not, you are right. In any case, the whole question just seems off. Just ditch the whole thing and use ssl
comment on: http://stackoverflow.com/a/28140237
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28240715
has title: How to call for object keys in javascript (codecademy)
accepted answer: http://stackoverflow.com/a/28241280
has body: I'm following an online course in Javascript from Codecademy but i'm stuck in an assignment. I'm trying to list the firstName key from my "friends list". I have to do this with a "for in" statement in a function. The firstName key is within the object "Steve", which in in an object "Friends". This is the code that i have at the moment: var friends = { steve: { firstName: 'Steve', lastName: 'Jobs', number: '1', address: ['Fregataan','65','8546','RG','Amsterdam','The Netherlands'], }, bill: { firstName: 'Bill', lastName: 'Gates', number: '2', address: ['Fregataan','665','8546','RG','Amsterdam','The Netherlands'], }, }; function list(friends){ for (var firstName in friends){ console.log(friends.keys(firstName)) } } list(friends.keys); This is the assignment I get from the course: 1. Create a function list that takes a single parameter. 2. In the body of the function, write a for/in loop. 3. In the loop, use console.log to print out the key. (For example, if you only have bill and steve as entries, list should just print out "bill" and "steve".) The object "friends" was already written in a previous assignment. The function has to be written in this assignment. Can someone please find my mistake and tell me what i did wrong? Greetings, Luuk
downvote count: 0
possible better answer: http://stackoverflow.com/a/28240927
has answer: http://stackoverflow.com/a/28240927
favorite count: 0
upvote count: 2
tagged with: object
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28241280
tagged with: javascript
tagged with: key

http://stackoverflow.com/a/28279655
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28279621
has comment: http://stackoverflow.com/comment/44913628
has body: &lt;p id="demo" onclick="goRed()"&gt; Click me to change my text color.&lt;/p&gt; &lt;script&gt; function goRed() { document.getElementById("demo").style.color = "red"; this.onclick = goBlue; } function goBlue() { document.getElementById("demo").style.color = "blue"; this.onclick = goRed; } &lt;/script&gt; This will do it. But it's not nice. So we can update that: First let us use an event handler. They are the standard. Try to avoid inline event handlers. document.getElementById("demo").addEventListener("click", goRed, false); function goRed(e) { this.style.color = "red"; //this refers to the element. this.removeEventListener("click", goRed, false); //remove the event listener this.addEventListener("click", goBlue, false); //add the blue one. } function goBlue(e) { this.style.color = "blue"; this.removeEventListener("click", goBlue, false); //remove the event listener this.addEventListener("click", goRed, false); //add the Red one. } &lt;p id="demo" &gt; Click me to change my text color.&lt;/p&gt; I've chosen not to implement one function for the color changing, since I wanted to make this answer more general. This is the correct way to change the event handler of an element within a function to another function. The color changing is just an example. One could imagine other cases where the function reference of a link or button needs to be changed after a function is executed.
score: 0
upvote count: 1

http://stackoverflow.com/comment/44625923
has text: @Drown. I agree, the logic here is off. As long as the reponse is of type 200OK, it is all good. Sorry for the confusion.
comment on: http://stackoverflow.com/a/28126096
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28182328
has body: You can select all the tables that don't have a child table element $("table:not(:has(table))")
score: 3
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/28182235
type: Answer
has comment: http://stackoverflow.com/comment/44734415

http://stackoverflow.com/q/28243473
type: AnsweredQuestion
score: 1
has body: I have an HTA for which I've made a .chm help file. I want a JavaScript or a VBScript function to open a .chm file from the HTA to be able to make a help button like this: Help How do I do this?
upvote count: 1
tagged with: vbscript
type: Question
tagged with: hta
has answer: http://stackoverflow.com/a/28244384
tagged with: javascript
has comment: http://stackoverflow.com/comment/44848364
has title: Open a .chm from a hta
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44848090
tagged with: chm
favorite count: 0
accepted answer: http://stackoverflow.com/a/28244384

http://stackoverflow.com/comment/44799959
type: Comment
comment on: http://stackoverflow.com/a/28218230
score: 0
type: AnswerComment
has text: I'm hardcoding the `sEcho` should I not? and also I have tried with adding ` ` inside the table but still the same.

http://stackoverflow.com/q/28231515
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28231636
has answer: http://stackoverflow.com/a/28231659
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28231568
has comment: http://stackoverflow.com/comment/44825213
downvote count: 2
has answer: http://stackoverflow.com/a/28231539
type: Question
has answer: http://stackoverflow.com/a/28231791
tagged with: javascript
answer count: 6
score: -1
has answer: http://stackoverflow.com/a/28231570
upvote count: 1
has title: How to get all value from a list li
has body: I have a sample code: Class 1 Class 2 Class 3 Class 4 Get my javascript: function getList() { classAdder = document.getElementById('classList'); ... } => How to get all data-attr have class are visibleLayer

http://stackoverflow.com/comment/44852510
type: Comment
comment on: http://stackoverflow.com/a/28245692
has text: Bingo! Thanks rdubya! :)
score: 0
type: AnswerComment

http://stackoverflow.com/q/28263418
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/44883804
has body: I'm using Charts.js Doughnut chart that displays dynamic data which arrives on time intervals. When I cancel the time intervals calls or reload the page! it looks fine: When I refresh that with time intervals and go over with mouse it seems that it draw another layer on each call. I already tried to draw it once and to remove and set the new data, but it still goes crazy on mouse over. var canvas = document.getElementById('modular-doughnut'); var context = canvas.getContext('2d'); context.clearRect ( 0 , 0 , canvas.width, canvas.height ); var moduleDoughnut = new Chart(context).Doughnut(chart_data, config); EDIT: Thanks to @Koogle I can say that the problem is in tooltips. How to solve that?
has comment: http://stackoverflow.com/comment/44883890
score: 1
has comment: http://stackoverflow.com/comment/44883792
has comment: http://stackoverflow.com/comment/44883840
favorite count: 0
type: Question
upvote count: 1
has title: Charts.js doughnut
answer count: 1
tagged with: chart.js
has comment: http://stackoverflow.com/comment/44883978
has answer: http://stackoverflow.com/a/45945902
has comment: http://stackoverflow.com/comment/44884225
has comment: http://stackoverflow.com/comment/44883761
has comment: http://stackoverflow.com/comment/44883931
linked to: http://stackoverflow.com/q/25661197

http://stackoverflow.com/q/28219256
has answer: http://stackoverflow.com/a/28219839
has body: I am fairly new to JS and i thought i understood the order in which the components of the page are loaded but this puzzles me. I'm working with foundation 5 and i am using an accordion component. In my js script i load data and put it into an accordion which then becomes the inner html of the mainContainer div. function iniciarPg() { $(document).foundation({ accordion: { toggleable: true } }); loadData(); } The part i cannot comprehend is that although all the inner HTML of the mainContainer gets replaced, if i delete from my html, then when the JS loads, the page does no display the accordeon correctly, it does not expand when clicked.
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Foundation Accordion not loading if not declared in HTML
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44801804
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28219839
upvote count: 1
has comment: http://stackoverflow.com/comment/44802773
tagged with: zurb-foundation
answer count: 1

http://stackoverflow.com/comment/44719677
comment on: http://stackoverflow.com/a/28148558
type: AnswerComment
score: 0
type: Comment
has text: Sorry, I wasn't thinking about javascript type syntax. Changed int to var, and it should work. I've edited the answer for you.

http://stackoverflow.com/comment/44734654
type: Comment
comment on: http://stackoverflow.com/a/28182374
score: 0
type: AnswerComment
has text: I imagine this is because each document operates in a single thread, and the execution of JavaScript prevents the document from actually updating while a script is running. This is why you can lockup the UI for a web page with a long running script. All clicks stop responding, scrolling is blocked, the whole page is locked down.

http://stackoverflow.com/comment/44861840
has text: I edited the code with more information, hope that helps.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28240226

http://stackoverflow.com/comment/44653117
score: 1
has text: JSON is for data interchange. It will never support functions. You can write your own code to post-process your parsed objects. *edit* There's also the `reviver` parameter, which basically just makes post-processing a little simpler (sometimes).
comment on: http://stackoverflow.com/q/28140728
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44620330
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28123055
has text: sounds like you are sending more data than expected. You get a child scope created for every row of `ng-repeat`

http://stackoverflow.com/comment/44873027
score: 0
type: Comment
type: QuestionComment
has text: I simplified the code to it's basic elements Sumurai8
comment on: http://stackoverflow.com/q/28257332

http://stackoverflow.com/comment/44911694
type: Comment
comment on: http://stackoverflow.com/a/28277631
type: AnswerComment
score: 0
has text: @dorthrithil, true, if you are loading dynamically, it complicates things. For simplicity, your solution might be better, which is why I suggested that you posted it as an answer.

http://stackoverflow.com/comment/44695634
comment on: http://stackoverflow.com/q/28162171
type: Comment
type: QuestionComment
has text: I would have to think it's just laziness - typing out the array requires a lot of special characters and holding shift for all the quotes. I can probably type the first version more than twice as fast as the second one.
score: 3

http://stackoverflow.com/q/28248627
has body: I have a Drop Down menu that I want to use as a navigational menu. The drop down is coded with js and css to give it the style look and feel that I want. Values are set to numbers to show the links in order and the class is used to load an image beside the Text inside of the drop down menu. What I am using is this code to load links inside this certain div (apDiv2) AJAX LOADER $('.menu_nav').click(function() { var href = $(this).attr('href'); // loading gif// $('#apDiv2').empty().append($(' ')); $.ajax({ method: 'GET', url: href, success: function(content) { $('#apDiv2').html (content); } }); return false; }); I want to be able to use this Ajax Code to load innerHTML pages of my website into the Div 2. I also Use a modenizer.js for functioning of this drop down menu. Is there any way I can Get this menu to load a page into this appointed div without rearranging my style and look of this dropdown menu? Here is the Menu's js? DropDown Menu Js ;( function( $, window, undefined ) { 'use strict'; $.DropDown = function( options, element ) { this.$el = $( element ); this._init( options ); }; // the options $.DropDown.defaults = { speed : 300, easing : 'ease', gutter : 0, // initial stack effect stack : true, // delay between each option animation delay : 0, // random angle and positions for the options random : false, // rotated [right||left||false] : the options will be rotated to thr right side or left side. // make sure to tune the transform origin in the stylesheet rotated : false, // effect to slide in the options. value is the margin to start with slidingIn : false, onOptionSelect : function(opt) { return false; } }; $.DropDown.prototype = { _init : function( options ) { // options this.options = $.extend( true, {}, $.DropDown.defaults, options ); this._layout(); this._initEvents(); }, _layout : function() { var self = this; this.minZIndex = 1000; var value = this._transformSelect(); this.opts = this.listopts.children( 'li' ); this.optsCount = this.opts.length; this.…
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/44857562
answer count: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28248877
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44857655
has comment: http://stackoverflow.com/comment/44857574
upvote count: 0
has title: ajax load inner html into div from drop down menu select
has comment: http://stackoverflow.com/comment/44857684
has comment: http://stackoverflow.com/comment/44857680
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44857457

http://stackoverflow.com/a/28259097
has comment: http://stackoverflow.com/comment/44896402
has comment: http://stackoverflow.com/comment/62775596
has comment: http://stackoverflow.com/comment/47495514
has comment: http://stackoverflow.com/comment/49111113
has comment: http://stackoverflow.com/comment/53568976
score: 53
type: Answer
upvote count: 54
answers question: http://stackoverflow.com/q/28258106
downvote count: 1
has comment: http://stackoverflow.com/comment/85296901
has comment: http://stackoverflow.com/comment/53567285
has body: The design of select functionality in materialize CSS is, in my opinion, a pretty good reason not to use it. You have to initialize the select element with material_select(), as @littleguy23 mentions. If you don't, the select box is not even displayed! In an old-fashioned jQuery app, I can initialize it in the document ready function. Guess what, neither I nor many other people are using jQuery these days, nor do we initialize our apps in the document ready hook. Dynamically created selects. What if I am creating selects dynamically, such as happens in a framework like Ember which generates views on the fly? I have to add logic in each view to initialize the select box every time a view is generated, or write a view mixin to handle that for me. And it's worse than that: when the view is generated, and in Ember terms didInsertElement is called, the binding to the list of options for the select box may not have been resolved yet, so I need special logic observing the option list to wait until it's populated before making the call to the material_select. If the options change, as they easily might, material_select has no idea about that and does not update the dropdown. I can call material_select again when the options change, but it appears that that does nothing (is ignored). In other words, it appears that the design assumption behind materialize CSS's select boxes is that they are all there at page load, and their values never change. Implementation. From an aesthetic point of view, I am also not in favor of the way materialize CSS implements its dropdowns, which is to create a parallel, shadow set of elements somewhere else in the DOM. Granted, alternatives such as select2 do the same thing, and there may be no other way to achieve some of the visual effects (really?). To me, though, when I inspect an element, I want to see the element, not some shadow version somewhere else that somebody magically created. When Ember tears down the view, I am not sure that materi…
has comment: http://stackoverflow.com/comment/48928351

http://stackoverflow.com/a/28279542
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28274768
has body: You could use this within the functions, but you would have to make sure to properly bind the event handlers: var elm = document.getElementById("x"); elm.onmousedown = PositionXY.detectBasePosition.bind(PositionXY); elm.onmousemove = PositionXY.startPositionAdjustment.bind(PositionXY); elm.onmouseup = PositionXY.stopPositionAdjustment.bind(PositionXY); However, the only advantage you gain here by using this is the ability to re-alias PositionXY to some other variable while changing the initial value of PositionXY, which will probably never occur. Using an IIFE, you can also overcome that issue while keeping your initial design's simplicity: var YourObject = (function () { var YourObject = { someProperty: 'test', someFunction: function () { console.log(YourObject.someProperty); } }; return YourObject; })();
has comment: http://stackoverflow.com/comment/44919427
type: Answer
has comment: http://stackoverflow.com/comment/44914381
has comment: http://stackoverflow.com/comment/44913688
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44913833
accepted answer of: http://stackoverflow.com/q/28274768
has comment: http://stackoverflow.com/comment/44913585

http://stackoverflow.com/comment/44763567
has text: Strange yes, but nothing wrong with it. This answer doesn't really change anything, since JavaScript automatically adds the format of `js` on anything that has `remote: true` on it. I think he wants a way to allow a direct link (from the browser) to have a format of `js` and this is the only way I know.
comment on: http://stackoverflow.com/a/28198471
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44728348
score: 0
type: Comment
has text: Doug, this looks awesome. Again, more homework for me. I don't see how this couldn't work, but let me get back to you on it. I really appreciate it.
comment on: http://stackoverflow.com/a/28179572
type: AnswerComment

http://stackoverflow.com/comment/44829762
has text: If you **upload** multiple images to your backend, you usaly dont mix pictures if you want to do different things with them (if thats the reason why the order is important).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28233715
score: 0

http://stackoverflow.com/a/28127063
has body: Sometimes the solution is so simple, but you need to think outside of the box. Move the event callback block into a function and just run it when the controller loads, after the event binding. See this: function handlePeople() { $scope.people = contacts.people; } $scope.$on('contacts-changed', handlePeople); handlePeople(); You can also keep the original code and do a trigger manually.
answers question: http://stackoverflow.com/q/28127040
score: 0
has comment: http://stackoverflow.com/comment/44628505
has comment: http://stackoverflow.com/comment/44627448
has comment: http://stackoverflow.com/comment/44627420
type: Answer
has comment: http://stackoverflow.com/comment/44627393
has comment: http://stackoverflow.com/comment/44627262

http://stackoverflow.com/q/28152306
type: Question
tagged with: debugging
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44676061
tagged with: ajax
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44675871
has comment: http://stackoverflow.com/comment/44675837
tagged with: php
has title: Unable to set ajax with php to upload images
answer count: 0
has body: &lt;form id="imageform" method="post" enctype="multipart/form-data" action='../ajaxImageUpload.php?snid=&lt;?php echo $storeC; ?&gt;' style="clear:both;"&gt; &lt;div id='imageloadstatus' style='display:none'&gt; &lt;img alt="" src="../images/loader.gif"/&gt; &lt;/div&gt; &lt;div id='imageloadbutton'&gt; &lt;input type="file" name="photos[]" id="photoimg" accept="image/*" multiple /&gt; &lt;/div&gt; &lt;/form&gt; $('#photoimg').die('click').live('change', function() { //$("#preview").html(''); $("#imageform").ajaxForm({target: '#preview', beforeSubmit: function() { console.log('ttest'); $("#imageloadstatus").show(); $("#imageloadbutton").hide(); }, success: function(){ console.log('test'); $("#imageloadstatus").hide(); $("#imageloadbutton").show(); }, error: function(){ console.log('xtest'); $("#imageloadstatus").hide(); $("#imageloadbutton").show(); } }).submit(); }); I want to pass on the snid parameter to that ajaxupload file. The code works perfectly on localhost but not on my hosted server. On the console it says this: [jquery.form] state = complete POST http://everythingo.com/ajaxImageUpload.php?snid=proshopy 500 (Internal Server Error) [jquery.form] isXml=false All I get is an empty alert box every time &amp; even echoing the snid from php shows nothing on alert box.
has comment: http://stackoverflow.com/comment/44676013

http://stackoverflow.com/comment/45021549
type: AnswerComment
score: 0
has text: I finished this project already :), I used some other plugin it had option for half pie chart , But I am accepting your answer Thanks
type: Comment
comment on: http://stackoverflow.com/a/28314474

http://stackoverflow.com/comment/44686697
has text: @Shoaibkhanz I ran it both ways. I can create the title above and below the SVG by moving the code block above or below the SVG creation. Where do you actually want the title? Do you want it to be an actual part of the graph or outside of the SVG context?
comment on: http://stackoverflow.com/q/28156873
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44770983
has text: @KevinB Ok. Like the answer below? Will my converted array still have the exact same values though?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28202249
score: 0

http://stackoverflow.com/a/28241174
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28241109
upvote count: 1
downvote count: 0
has body: $(document).ready(function(){ $('.details_btn').click(function(){ if($(this).text() == 'Open'){ $(this).html('Close'); }else{ $(this).html('Open'); } }); });

http://stackoverflow.com/comment/44667874
type: QuestionComment
comment on: http://stackoverflow.com/q/28148196
has text: The String objects in JavaScript are immutable. So you cannot change them.
score: 7
type: Comment

http://stackoverflow.com/comment/44731144
comment on: http://stackoverflow.com/a/28180914
type: AnswerComment
has text: So anywhere you were referring the div instead reference the Label. So if you were grabbing the div like this $("#result").text() instead just grab the label like this $("#uploadedInfo").text().
type: Comment
score: 1

http://stackoverflow.com/q/28133766
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44640145
has comment: http://stackoverflow.com/comment/44640030
has answer: http://stackoverflow.com/a/28134072
tagged with: indexof
has comment: http://stackoverflow.com/comment/44640063
has comment: http://stackoverflow.com/comment/44640004
tagged with: substring
type: Question
score: 0
tagged with: find
has comment: http://stackoverflow.com/comment/44640017
has comment: http://stackoverflow.com/comment/44639979
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44640054
has body: I need to extract a sub string, particularly "Sweet Heart" Package (SPA02) from this string: Find String I have tried this to find the beginning of the string: str.indexOf('class="odd views-row-first views-row-last"> '); but it doesn't return a valid integer position, it in fact doesn't return anything... and I'm wondering what I'm doing wrong and how i'd best go about this. Thanks!
accepted answer: http://stackoverflow.com/a/28134072
has title: How can I extract a substring in javascript

http://stackoverflow.com/comment/44770827
has text: @KevinB No I actually already have saved an "a" into my `soldListingArray` (I saved it as an array) and when I call it, it displays the "a" but nothing else. Am I missing something though?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28202249
score: 0

http://stackoverflow.com/comment/44811067
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28223886
has text: Interesting idea, I'll have a play with it. Although this might make upgrading leaflet more difficult in the future.

http://stackoverflow.com/q/28248863
tagged with: coldfusion
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/21736067
has comment: http://stackoverflow.com/comment/44857846
upvote count: 1
downvote count: 1
tagged with: session
has comment: http://stackoverflow.com/comment/44929036
type: Question
has body: Suppose I log into an application, and open the same application in another tab. If the user logs out from one tab, the other tab persists to be log in. I have used this to clear the session: &lt;cfset StructClear(SESSION)&gt; &lt;cflogout&gt; Can anyone provide a solution to log out from all tabs if user logs out from a single tab.
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44857785
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Ending ColdFusion user session among all tabs if user logs out from one tab

http://stackoverflow.com/q/28222648
has comment: http://stackoverflow.com/comment/44812029
type: Question
tagged with: javascript
has body: I'm getting crazy to create a list separated by year and month name... I would like to have something like: Events in 2015 January - event 1 - event 2 - event 3 February - event 1 - event 2 ...ecc... Events in 2016 ...ecc... I don't think I have to create a repeater for each Year and Month, right? I think there is a filter or a rule to achieve this. &lt;div ng-app ng-controller="Main"&gt; &lt;div ng-repeat="event in events | what here?"&gt; // how to create separators here? {{event.title}} &lt;/div&gt; &lt;/div&gt; $scope.events = [ {id: 1, title: "Title 1", date: 283764873126}, {id: 2, title: "Title 2", date: 283764873126}, {id: 3, title: "Title 3", date: 283764873126}, {id: 4, title: "Title 4", date: 283764873126} ];
downvote count: 0
has title: how to separate ng-repeat by date
favorite count: 0
linked to: http://stackoverflow.com/q/23493063
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44808291
answer count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/44670059
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28149327
score: 2
has text: Your manifest lists `"views/content.html.ejs"` while your script tries to load `chrome.extension.getURL('content.html.ejs')` without the `views` part. Voting to close as typo.

http://stackoverflow.com/q/28255704
score: 2
has body: Title is confusing but let me write this JavaScript code out: var array = [0,0]; var x = array; array[0] = 1; alert(x); The alert message then shows [1,0]. I wanted x = [0,0], I didn't want it to change when the values in the array changed. How do I go about doing that?
type: Question
has title: How do I set a variable to the value of an array at that given moment and not whatever the array will be?
downvote count: 0
has answer: http://stackoverflow.com/a/28255713
tagged with: javascript
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/44843836
type: Comment
type: QuestionComment
has text: Ok, thanks. I'm a bit confused though. You load your app by loading the `init.js` file (` data-main="/resources/js/init"`). Your `init.js` file refers to your main module as `app` but after the build its name is `app.min.js`. Yet, there is nothing in `init.js` that tells RequireJS that `app` is `app.min`.
comment on: http://stackoverflow.com/q/28172896
score: 0

http://stackoverflow.com/q/28167980
has comment: http://stackoverflow.com/comment/44705845
answer count: 0
type: UnansweredQuestion
has title: Using jquery ajax post throws "500 Internal Server Error" in aspx
has comment: http://stackoverflow.com/comment/44706094
has comment: http://stackoverflow.com/comment/44706077
tagged with: c#
type: Question
has comment: http://stackoverflow.com/comment/44706454
has comment: http://stackoverflow.com/comment/44706020
has comment: http://stackoverflow.com/comment/44705931
has body: Using jquery ajax i am calling a method "Dispatch_Job" and passing parameters to it which does insertion but in here it throws error. Establishment_Controller.aspx code: function SendData(distance) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Establishment_Controller.aspx/Dispatch_job", dataType: "json", data: "{'tbName': '" + $("#&lt;%=TextBoxName.ClientID%&gt;").val() + "','tbFatherName': '" + $("#&lt;%=TextBoxFatherName.ClientID%&gt;").val() + "','tbAddress':'" + $("#&lt;%=TextBoxAddress.ClientID%&gt;").val() + "','tbPhNo':'" + $("#&lt;%=TextBoxPhNumber.ClientID%&gt;").val() + "','tbDistance':'" + distance + "'}", async: true, success: function (data) { alert('1 ' + data.d); }, error: function (result) { alert("Error! " + result.status + ', ' + result.statusText); } }); } &lt;asp:TextBox ID="TextBoxName" CssClass="time" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="TextBoxPicFatherName" CssClass="time" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="TextBoxAddress" CssClass="time" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="TextBoxPhNo" onblur="SendData(0);" CssClass="time" runat="server"&gt;&lt;/asp:TextBox&gt; .cs code: [WebMethod] public static string Dispatch_job(string tbName, string tbFatherName, string tbAddress, string tbPhNo, string tbdistance) { using (Estb_cntxtDataContext context = new Estb_cntxtDataContext()) { Info j = new Info(); j.name = tbName; j.fathername = tbFatherName; j.address = tbAddress; j.phoneNo = tbPhNo; j.distance = tbDistance; context.Info.InsertOnSubmit(j); context.SubmitChanges(); return "Saved"; } } when the code is executed and all the textboxes are filled and when the onblur property is called on textboxPhNo it shows "500 Internal Server Error".
tagged with: javascript
has comment: http://stackoverflow.com/comment/44705941
tagged with: jquery
linked to: http://stackoverflow.com/q/5756147
tagged with: asp.net
tagged with: ajax
has comment: http://stackoverflow.com/comment/44706367
score: 0
has comment: http://stackoverflow.com/comment/44706098

http://stackoverflow.com/q/28192954
has title: Regex for one string or a pattern
score: 1
has comment: http://stackoverflow.com/comment/44752964
has answer: http://stackoverflow.com/a/28193105
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44752862
has comment: http://stackoverflow.com/comment/44753043
favorite count: 0
has body: i am trying to write a regent for a line in this format: Integer;characters etc;decimal number;decimal number;decimal number;characters etc For example: 989898;ABCD - eft;9809.98078;9878.876;8768.654;ABCD For this, I have writen this which is working fine : /[0-9]*;(.)*;[0-9\.]*;[0-9\.]*;[0-9\.]*;(.)/gi Now, this problem is, there can be N.A. in the place of decimal number for which I am unable to get the refer right.
tagged with: regex
tagged with: pattern-matching
type: UnansweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/q/28247242
has title: Radio buttons don't toggle properly
has body: I'm working on a page that has a pair of radio buttons for Yes & No. If Yes is clicked I want to display a particular div (class="green") and if No is clicked, display a different div (class="blue"). It's a Coldfusion page using Jquery and Twitter bootstrap. The page is at http://dev.taxtalent.com/employers/post-a-tax-job-new?adtype=Basic. The radio buttons in question are near the bottom of the page (Are you a current member? ). The excerpt of the code in question is; Are you a current member? Yes No
score: 0
has answer: http://stackoverflow.com/a/28247712
tagged with: jquery
has answer: http://stackoverflow.com/a/28247404
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28247845
answer count: 4
has comment: http://stackoverflow.com/comment/44857396
has comment: http://stackoverflow.com/comment/44858770
has answer: http://stackoverflow.com/a/28247393
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44875453
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/3115982/how-to-check-javascript-array-equals
comment on: http://stackoverflow.com/q/28258760
score: 0

http://stackoverflow.com/a/28153355
has comment: http://stackoverflow.com/comment/44678147
upvote count: 1
answers question: http://stackoverflow.com/q/28152830
has body: If you are after a pure js version you can use this method: function check() { var items = document.getElementsByName('shipping_method'); var v = null; for (var i = 0; i &lt; items.length; i++) { if (items[i].checked) { v = items[i].value; break; } } var required = (v == "tablerate_bestway"); document.getElementById("deliv-hold").style.display = required ? "block" : "none"; if (required) { document.getElementById("shipping_arrival_comments").setAttribute("required", true); } else { document.getElementById("shipping_arrival_comments").removeAttribute("required"); } } http://jsfiddle.net/gv7xh4cg/9/ Basically, iterate over items of the same name and see if they are selected, if they are grab the value from it and use that to show or hide the comments div. Cheers, Ian
has comment: http://stackoverflow.com/comment/44678908
has comment: http://stackoverflow.com/comment/44678390
has comment: http://stackoverflow.com/comment/44678780
has comment: http://stackoverflow.com/comment/44679107
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44680734
type: Answer
has comment: http://stackoverflow.com/comment/44678967
accepted answer of: http://stackoverflow.com/q/28152830
score: 1
has comment: http://stackoverflow.com/comment/44681154

http://stackoverflow.com/comment/44731323
type: Comment
has text: Thanks for the clarification. As you can see Im quite novice at this, so if you could slightly elaborate more that would be helpful. One minor concern is that on page load Item to be uploaded would be displayed initially, that value gets changed once the user retrieves a file from google drive, and that value gets change to its initial state once they hit delete.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28180742

http://stackoverflow.com/comment/44693213
score: 0
comment on: http://stackoverflow.com/a/28160602
type: Comment
has text: It meant to be assigned variable. It's really late, time to go sleep:)
type: AnswerComment

http://stackoverflow.com/q/28185892
score: 0
tagged with: codeigniter
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
has answer: http://stackoverflow.com/a/28186630
has answer: http://stackoverflow.com/a/28185925
has title: How to pass form values from jquery ajax to codeigniter controller?
type: Question
answer count: 2
tagged with: php
has body: I am trying to create a contact form that send email. I am using jquery ajax. My question is how can I pass the form values from jquery ajax to codeigniter function? This is my html form: This is my jquery ajax script: And finally my controller: public function test($view){ switch($view){ case 'contact1': $this->load->view('ph-contact1'); break; case 'contact2': $this->load->view('ph-contact2'); break; case 'contact3': $this->load->view('ph-contact3'); break; default: $this->load->view('ph-contact1'); break; } if($this->input->post('ajax') == '1'){ echo " "; } } I am not sure if the ajax is working and I don't have form validation.

http://stackoverflow.com/q/28169251
type: AnsweredQuestion
tagged with: nofollow
has answer: http://stackoverflow.com/a/28169293
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44709821
type: Question
has body: I'm producing an event registration website. When someone click on a link: Reserve id=10 event The system is doing a "lock" on this event for ten minutes for this visitor. In that case no one else can reserve this event in next ten minutes. If the payment is done in that time, everything is OK, else the event is unlocked again. I hope the idea is clear. PROBLEM: When bot (google bot, malicious bot, or angry customer script :P) visits this page, he see this link. Then he enters the page. Then the lock is done... Also if someone visit recursive: /reserve/1, /reserve/2, /reserve/3, ... He can lock all the events. I thought about creating a random md5 string for each event. In that case, every event has (next to id) unique code, for example: 1987fjskdfh938hfsdvpowefjosidjf8243 Next, I can translate libraries, to work like this: Reserve In that case I can prevent the "bruteforce" lock. But the link is still visible for bots. Then I thought about entering the captcha. And that is the solution. But captchas are... not so great in case of usability and user experience. I saw few websites with reservation engine working like this. Are they protected? Maybe there is a simple ajax / javascript solution to prevent the bots from reading this as a pure text? I thought about: Reserve But I'm not sure what shall I do there to prevent bots form calculating it. I mean stupid bots will not be able even to follow javascript or jquery stuff, but sometimes, someone wants to destroy something, and if the source is obvious, it can be broken in few lines of code. And whole database of events will be locked down with no reservation option for noone.
has comment: http://stackoverflow.com/comment/44708168
possible better answer: http://stackoverflow.com/a/28169980
tagged with: bots
accepted answer: http://stackoverflow.com/a/28169293
has answer: http://stackoverflow.com/a/28169980
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44708271
has comment: http://stackoverflow.com/comment/44708789
has title: How to block the link from malicious bot visitors?
tagged with: hyperlink
tagged with: javascript
tagged with: block

http://stackoverflow.com/comment/44789548
comment on: http://stackoverflow.com/a/28211182
has text: Make you sure that include cookie jquery file. for example https://raw.githubusercontent.com/carhartl/jquery-cookie/master/src/jquery.cookie.js
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28177761
has comment: http://stackoverflow.com/comment/44725476
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28177650
has body: ng-app needs to be there, if you have any module then you can give ng-app="modulename" or you can just use ng-app to auto-bootstrap. it tells browser that you are bootstrapping an angular.js application Update: With angular 1.3 you can no longer use global controller declaration on the global scope. you have to use controller declaration as angular.module('myapp', []).controller('HelloWorldCtrl', function(){ $scope.helloMessage = "Hello Mohammad"; }); Working Demo: {{helloMessage}}
type: Answer
accepted answer of: http://stackoverflow.com/q/28177650
score: 4
has comment: http://stackoverflow.com/comment/44725433
has comment: http://stackoverflow.com/comment/44725573
has comment: http://stackoverflow.com/comment/44725308
has comment: http://stackoverflow.com/comment/44725354
has comment: http://stackoverflow.com/comment/44725486
has comment: http://stackoverflow.com/comment/44725320
upvote count: 4

http://stackoverflow.com/a/28280109
has body: Not sure this is the source of the problem but $("a").on('click', '.tag_user_btn', function(event) { //WRONG This is wrong. jQuery documentation for .on() Correct syntax $(parentSelector).on('click', 'childSelector', function() Instead use (for ajax event handling) $(document).on('click', 'a.tag_user_btn', function(event) { or for non-ajax event handling $('a.tag_user_btn').click(function(event) which is a shorthand for $('a.tag_user_btn').on('click', function(event))
score: 1
answers question: http://stackoverflow.com/q/28279956
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/28231559
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28231663
tagged with: jquery
has comment: http://stackoverflow.com/comment/44828940
favorite count: 0
has comment: http://stackoverflow.com/comment/44825350
has comment: http://stackoverflow.com/comment/44825418
has comment: http://stackoverflow.com/comment/44829442
has title: Multiple Versions of jQuery, linking with google no help and neither is noConflict
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44825401
downvote count: 1
has body: I need to have a jquery countdown, carousal and responsive menu on my site, but can't get all of them to work together.. I have tried using the google libraries but then one, two or all of the scripts stop working all together. Here is the code without the noconflict as it was not working... Any suggestions?
score: -1
tagged with: jquery-plugins
type: Question
upvote count: 0

http://stackoverflow.com/q/28242418
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/31771306
type: UnansweredQuestion
has title: Webmethod is not fired by jsTree
tagged with: jstree-search
has body: I m trying to call web method from jsTree but unable to call it. can someone please help me out to get this resolved. my jsTree function is:- $('#tree').jstree({ "json_data": { "ajax": { "type": "POST", "dataType": "json", "async": true, "contentType": "application/json;", "opts": { "method": "POST", "url": "../../SurveyReport/Metrics.aspx/GetAllNodes11" }, "url": "../../SurveyReport/Metrics.aspx/GetAllNodes11", "data": function (node) { if (node == -1) { return '{ "operation" : "get_children", "id" : -1 }'; } else { //get the children for this node return '{ "operation" : "get_children", "id" : ' + $(node).attr("id") + ' }'; } }, "success": function (retval) { alert('Success') return retval.d; }, "error": function (r) { alert(r.attr); alert('error'); } } }, "plugins": ["themes", "json_data"] }); And web method and data file is:- [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static List&lt;G_JSTree&gt; GetAllNodes11(string id) { if (id != "-1") //-1 means initial load else async loading of children { if (id == "10") //Add 3 children to parent node with id=10. return AddChildNodes(10, 3, "xxxx"); else return new List&lt;G_JSTree&gt;(); } List&lt;G_JSTree&gt; G_JSTreeArray = new List&lt;G_JSTree&gt;(); //Creating the JsTree data //In live scenarios this will come from db or Web Service //Add 5 root nodes G_JSTreeArray.AddRange(AddChildNodes(0, 5, "")); //Add 4 children to 3rd root node //The third node has id=30 //The child nodes will have ids like 301,302,303,304 G_JSTreeArray[3].children = (AddChildNodes(30, 4, G_JSTreeArray[3].data)).ToArray(); //Add 5 children to level1 Node at id=302 G_JSTreeArray[3].children[1].children = (AddChildNodes(302, 4, G_JSTreeArray[3].children[1].data)).ToArray(); return G_JSTreeArray; } private static List&lt;G_JSTree&gt; AddChildNodes(int _ParentID, int NumOfChildren, string ParentName) { List&lt;G_JSTree&gt; G_JSTreeArray = new List&lt;G_JSTree&gt;(); int n = 10; for (int i = 0; i &lt; NumOfChildren; i++) {…
has comment: http://stackoverflow.com/comment/44846010
type: Question
tagged with: jstree
tagged with: javascript
has comment: http://stackoverflow.com/comment/44910181

http://stackoverflow.com/comment/44817293
score: 0
comment on: http://stackoverflow.com/q/28227036
has text: For future reference, your whole code should be contained in the question. SO offers an on-site fiddle tool, there's no need to use external sites.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28268575
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28792061
score: 3
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 Video: Displaying two different subtitles simultaneously
has body: I am using the standard HTML5 video subtitle functions to display subtitles (provided in srt and vtt) in the builtin HTML5 video player. Your browser does not support HTML5 video Now I need to have two different subtitles to be display simultaneously, so the second subtitle is displayed on top of the first subtitle. (Unexpectedly) I can't find any helpful information on the web for displaying more than just one subtitle within HTML5 video. I'm pretty sure I am gonna need a custom hack for that purpose. I am looking for advice and/or references how to implement this feature (without using nonfree/windows-only libs and player like DivX).
upvote count: 3
tagged with: subtitle
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/71689039
has answer: http://stackoverflow.com/a/71689039
has answer: http://stackoverflow.com/a/28792061
type: Question
answer count: 2

prototype
tags question: http://stackoverflow.com/q/28140597
tags question: http://stackoverflow.com/q/28166706
tags question: http://stackoverflow.com/q/28141267
tags question: http://stackoverflow.com/q/28237641
tags question: http://stackoverflow.com/q/28172271
tag name: prototype
tags question: http://stackoverflow.com/q/28240931
tags question: http://stackoverflow.com/q/28261625
tags question: http://stackoverflow.com/q/28201162
tags question: http://stackoverflow.com/q/28149866
tags question: http://stackoverflow.com/q/28176334
tags question: http://stackoverflow.com/q/28260777
tags question: http://stackoverflow.com/q/28255957
type: Tag
tags question: http://stackoverflow.com/q/28148196

http://stackoverflow.com/q/28131249
answer count: 1
has body: I'm trying to edit the tooltip so that I can have unique names for each point on a figure. I'm trying the below code, but it wont work. Here is the fiddle: http://jsfiddle.net/57mqsv6g/1/ tooltip: { formatter: function() { return 'The value for &lt;b&gt;' + this.x + '&lt;/b&gt; is &lt;b&gt;' + this.y + '&lt;/b&gt;, in series '+ this.series.name; } }
has answer: http://stackoverflow.com/a/28131338
type: AnsweredQuestion
has title: how do I edit/customize tooltip
score: 0
accepted answer: http://stackoverflow.com/a/28131338
type: Question
has comment: http://stackoverflow.com/comment/44635265
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/44635730

http://stackoverflow.com/a/28139576
upvote count: 2
type: Answer
score: 2
has body: When the templateUrl function runs, the scope is not available and the attribute values are still not interpolated. So, if you have something like: &lt;foo param="{{a}}"&gt;&lt;/foo&gt; then in templateUrl you will get the string "{{a}}" for attrs.param - not the value of $scope.a. Instead, you'd need to accept the template url as a variable (ideally via isolated scope) to the directive. Inside the directive you could cheaply use ng-include bound to that value. .directive("appModal", function() { return { restrict: "E", replace: true, scope: { modal: "=modalBody", }, template: '&lt;div ng-include="modal.templateUrl"&gt;&lt;/div&gt;' }; }); The usage is as you suggest: &lt;app-modal modal-body="confirmDelete"&gt;&lt;/app-modal&gt; And in the controller: $scope.confirmDelete = { // other properties, templateUrl: "path/to/template.html" }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28139250
answers question: http://stackoverflow.com/q/28139250

http://stackoverflow.com/comment/44815159
has text: Yeah thanks for this solution aswell. At the moment I am struggling with assigning the right quantity. It throws me "undefined in the alert for this: `var quantity = $(this).closest('.quantity').val();`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225291
type: AnswerComment

filesystemobject
type: Tag
tag name: filesystemobject
tags question: http://stackoverflow.com/q/28226615

http://stackoverflow.com/a/28275695
has comment: http://stackoverflow.com/comment/44906367
accepted answer of: http://stackoverflow.com/q/28275371
answers question: http://stackoverflow.com/q/28275371
type: Answer
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44906137
score: 0
has body: try it with: $data = file_get_contents("php://input"); see https://stackoverflow.com/a/12997460/2460773 sometimes $_POST global will be empty, depending on the type of data sent. in that case you could use file_get_contents to get the raw POST data.

kendo-grid
tags question: http://stackoverflow.com/q/28147838
tags question: http://stackoverflow.com/q/28205772
tag name: kendo-grid
tags question: http://stackoverflow.com/q/28188730
tags question: http://stackoverflow.com/q/28272743
tags question: http://stackoverflow.com/q/28238923
tags question: http://stackoverflow.com/q/28200940
tags question: http://stackoverflow.com/q/28232575
tags question: http://stackoverflow.com/q/28159289
tags question: http://stackoverflow.com/q/28166111
type: Tag
tags question: http://stackoverflow.com/q/28198488
tags question: http://stackoverflow.com/q/28140320

http://stackoverflow.com/a/28219934
has comment: http://stackoverflow.com/comment/44825768
score: 0
answers question: http://stackoverflow.com/q/28219711
has comment: http://stackoverflow.com/comment/44803427
has body: I'm not really sure but, I think you forget a "action" with your form. have you tryed something like that ?
has comment: http://stackoverflow.com/comment/44803924
type: Answer
has comment: http://stackoverflow.com/comment/44803364

navigation
tags question: http://stackoverflow.com/q/28139230
tags question: http://stackoverflow.com/q/28252933
tags question: http://stackoverflow.com/q/28239089
type: Tag
tag name: navigation
tags question: http://stackoverflow.com/q/28147266

http://stackoverflow.com/q/28170506
downvote count: 0
has title: Transparent frame buffers in webgl
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44747451
favorite count: 0
has comment: http://stackoverflow.com/comment/44712935
score: 2
has body: I'm working on creating an color-trail effect in webgl. Basically I'd like to be able to select a range of colors from a texture and have them trail after the texture as its animated across the screen. My strategy was to both draw the texture to the canvas as well as to a framebuffer, using the additionsl buffer to select and fade out the selected colors, resulting in a trail after the image. I've had some success setting preserveAlphaBuffer to true and having the trail appear in the framebuffer but I can't seem to be able to get the framebuffer to blend with the backbuffer. All I get is the framebuffer with a solid background. I'm beginning to feel its not possible as I've tried just about every combination on blendFunc and blendFuncSeparate. Hopefully there's someone who can help me realize this effect? var sketch; function init() { sketch = new Sketch(); document.body.appendChild(sketch); sketch.width = window.innerWidth; sketch.height = window.innerHeight; loop(); } function loop() { requestAnimationFrame(loop); sketch.draw(); } var Sketch = function () { var _canvas = document.createElement("canvas"); var _gl; var _image; var _program, _fboProgram; var _loaded = false; var _fbo, _fboTexture,_texture; var pos = { x: 0, y: 0 }; var speed = { x: 10, y: 10 } function init() { //start preloading image _image = new Image(); _image.onload = function () { setTimeout(function () { render(); }, 1); } _image.src = "img/texture.png"; } function render() { _gl = _canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true});//setupWebGL(canvas, {preserveDrawingBuffer: true});//getWebGLContext(_canvas); initCanvas(); initFbo(); _loaded = true; } function initCanvas() { _program = initShaders(_gl, "vertex-shader", "fragment-shader"); _gl.useProgram(_program); initVertexShaderLocations(_program); _gl.clearColor(1, 1, 1, 0); // red _gl.clear(_gl.COLOR_BUFFER_BIT); _texture = initTexture(_gl, _image); _gl.enable(_gl.BLEND); _gl.disable(_gl.DEPTH_TEST); _gl.colorMask(1, …
upvote count: 2
type: UnansweredQuestion
tagged with: fbo
type: Question
has comment: http://stackoverflow.com/comment/44713816
tagged with: webgl
has answer: http://stackoverflow.com/a/28193996
tagged with: canvas

http://stackoverflow.com/comment/44753209
type: AnswerComment
comment on: http://stackoverflow.com/a/28176394
type: Comment
has text: Well, I'm glad to have helped, if only in a small and incomplete manner.
score: 0

http://stackoverflow.com/q/28215703
has comment: http://stackoverflow.com/comment/44795199
has answer: http://stackoverflow.com/a/28216128
downvote count: 2
possible better answer: http://stackoverflow.com/a/28216219
has answer: http://stackoverflow.com/a/28216302
has comment: http://stackoverflow.com/comment/44794893
has answer: http://stackoverflow.com/a/28216219
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28216212
has comment: http://stackoverflow.com/comment/44794705
has answer: http://stackoverflow.com/a/28215943
has title: Check if textbox contains text, if it does then send
has comment: http://stackoverflow.com/comment/44796332
type: Question
accepted answer: http://stackoverflow.com/a/28216128
has body: I have this email form, with "Sender, "Subject" and "Message". But i haven't linked it to make sure they have written something, so if someone press the "Send" button without typing anyting, i get a blank email. So i want it to abort the email sending if the textbox is empty, and send it if it contains any text. code for the send button: &lt;input type="submit" name="submit" value="Submit" class="submit-button" /&gt; ID for the textbox is: textbox_text
upvote count: 0
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44794777
has comment: http://stackoverflow.com/comment/44795010
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28224571
linked to: http://stackoverflow.com/q/6232244
has comment: http://stackoverflow.com/comment/44813944
linked to: http://stackoverflow.com/q/14873109
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has title: Bootstrap Modal Toggle event happening twice
type: Question
has body: I have an asp:DataList. Each item in the list has a Delete button that will pop up a confirmation modal. &lt;asp:DataList ID="dlKeywords" runat="server" RepeatLayout="Table" CssClass="table table-striped"&gt; &lt;ItemTemplate&gt; ... &lt;div class="btn btn-default glyphicon glyphicon-trash" data-toggle="modal" data-target="#modalDeleteWarning" data-keyword-id="&lt;%# Eval("keywordId") %&gt;" data-keyword-name="&lt;%# Eval("keyword") %&gt;"&gt; &lt;/div&gt; ... &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; &lt;div id="modalDeleteWarning" class="modal fade"&gt; ... &lt;/div&gt; For some reason the event fires twice, so it toggles on and off again immediately. I tried looking at $._data(btn_object_reference, "events") to see if the click event handler was attached twice, but that returns undefined. Not surprisingly, it works just fine in jsfiddle. I looked at this stackoverflow question, but none of the parent elements are position: absolute. This question suggests that AJAX might be the issue, and I do have this DataList in an UpdatePanel, but removing the UpdatePanel does not fix the issue. I also tried removing the DataList, and just using a button on its own with contrived values, but I get the same behavior. I don't know how to debug further. Is there a way to see if the click event is being fired on multiple elements or something? I'm javascript-proficient, but not an expert by any means, so I'm sure there are a lot of things I haven't checked yet.
tagged with: modal-dialog
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44814368
has answer: http://stackoverflow.com/a/28352220
accepted answer: http://stackoverflow.com/a/28352220

http://stackoverflow.com/q/28134974
type: AnsweredQuestion
upvote count: 2
type: Question
has title: Catch async exception in correct context
has comment: http://stackoverflow.com/comment/44642372
downvote count: 0
has answer: http://stackoverflow.com/a/28134998
possible better answer: http://stackoverflow.com/a/28135017
tagged with: javascript
has answer: http://stackoverflow.com/a/28135001
tagged with: jquery
has answer: http://stackoverflow.com/a/28135017
has body: When throwing an an error in an async call, the error is thrown after the tryAjax() context is gone, therefore never reaching my catch clause. Is there a way to correctly catch a non synchronous exception? function tryAjax(){ try{ didItWork(); } catch(e){ // Do something else } } function didItWork(){ $.ajax({ url: url, success: function (res, status, xhr) { // Do something }, error: function (e) { throw new Error('Canvas video not loaded'); } }); }; }
answer count: 3
accepted answer: http://stackoverflow.com/a/28135001
tagged with: asynchronous
favorite count: 0
score: 2

http://stackoverflow.com/comment/44721382
comment on: http://stackoverflow.com/q/28176036
type: Comment
score: 4
has text: json serialization is the only thing that comes to my mind... And yes, it's an other instance with the same values
type: QuestionComment

http://stackoverflow.com/q/28241058
has answer: http://stackoverflow.com/a/33311008
downvote count: 0
has answer: http://stackoverflow.com/a/41432249
favorite count: 0
type: UnansweredQuestion
has title: PHP cURL download progress using jquery
tagged with: php
answer count: 4
tagged with: curl
has comment: http://stackoverflow.com/comment/69995136
type: Question
has comment: http://stackoverflow.com/comment/70008591
score: 5
has answer: http://stackoverflow.com/a/41423055
has answer: http://stackoverflow.com/a/41411859
upvote count: 5
linked to: http://stackoverflow.com/q/13958303
tagged with: javascript
tagged with: jquery
has body: I can't figure out how to push the progress out every time it updates using php. For the sake of clarity, I will write an example. jQuery: function uploadMovieDownload(link){ $.post("php/downloadmovie.php", { source:link }, function(json){ console.log(json); }); } uploadMovieDownload(url); PHP (php/downloadmovie.php): session_start(); ob_start(); date_default_timezone_set("Europe/Bucharest"); ini_set('display_errors',true); require_once(dirname(__FILE__)."/functions.php"); $url = $_POST['source']; $headers = getHeaders($url); $url = $headers['url']; $path = dirname(__FILE__)."/temp/test.mp4"; $fp = fopen ($path, 'w+'); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false ); curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progress' ); curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); curl_setopt( $ch, CURLOPT_BINARYTRANSFER, true ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 100 ); curl_setopt( $ch, CURLOPT_FILE, $fp ); curl_exec( $ch ); curl_close( $ch ); fclose( $fp ); function progress($resource,$download_size, $downloaded, $upload_size, $uploaded){ if($download_size &gt; 0) echo $downloaded / $download_size * 100; ob_flush(); flush(); } echo "Done"; ob_flush(); flush(); The problem I have is that it returns the progress after it completes, it isn't pushing it while downloading. Thanks in advance if you have any sugestions.

http://stackoverflow.com/a/28183855
downvote count: 0
type: Answer
has body: another solution. A slight modification to your current function. basically, when we'll sum the cell's value on every rows and hide them if the value is 0. function toggleVis(btn){ var btn = document.forms['tcol'].elements[btn], cells = document.getElementsByName('t'+btn.name), nbCols = document.getElementById("myTable").rows[0].cells.length, i, j, v, val, table, row, col; mode = btn.checked ? showMode : 'none'; // Apply the style to the CSS display property for the cells for(j = 0; j &lt; cells.length; j++) cells[j].style.display = mode; table = document.getElementById("myTable"); for (i = 0, row; row = table.rows[i]; i += 1) { //iterate through rows // we'll sum every cell's value on the row //if the sum is null, we'll hide the row val = 0; // then iterate through columns on this row for (j = 1, col; col = row.cells[j]; j++) { // we don't want to count the value that are already hidden if ( col.style.display === 'none') { continue; } // don't forget the radix on parseInt ;-) // we sum the value v = parseInt(col.innerHTML, 10); if (!isNaN(v)) { val += v; } } if( val === 0) { row.style.display = 'none'; } else { if (row.style.display === 'none') { row.style.display = ''; } } } here's a jsfiddle for you to play with
has comment: http://stackoverflow.com/comment/44737273
has comment: http://stackoverflow.com/comment/44737185
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44737008
answers question: http://stackoverflow.com/q/28183216
has comment: http://stackoverflow.com/comment/44736946

http://stackoverflow.com/q/28222439
possible better answer: http://stackoverflow.com/a/28223454
upvote count: 4
downvote count: 0
has body: I want to guarantee a minimum delay on the resolution of a bluebird.js promise. As an example, let's say I'm making a request wrapped in a promise. The behaviour I want is that if the request takes less than 5 seconds, I want to artificially increase the delay of the promise resolution to 5 seconds. If the request were to take more than 5 seconds, I'd want no artificial delay added - so it's a little more complicated than just adding a static delay to every request. All of this should be completely hidden from the consumer of the promise - they should just see the promise being resolved in 5 seconds, or more. To demonstrate, I've got a simple mock implementation example which hardcodes the mocked request latency at 3 seconds. My first try went something like this - using a setTimeout to ensure the resolve callback isn't called before 5 seconds have passed. fiddle here function getTimestamp() { return new Date().getTime(); } function makeCallWith3SecondLatency(cb) { console.log('mocking a call with 3 second latency...'); var mockResult = 'the result'; setTimeout(function() { cb(mockResult); }, 3000); } function doSomethingAsync(minDelay) { return new Promise(function(resolve) { var calledAt = getTimestamp(); makeCallWith3SecondLatency(function(arg) { var actualDelay = getTimestamp() - calledAt; if(actualDelay &lt; minDelay) { var artificialDelay = minDelay - actualDelay; console.log('artificially delay another ' + artificialDelay + ' millis'); setTimeout(function() { resolve(arg); }, artificialDelay); } else { resolve(arg); } }); }); } function printResult(result) { console.log('result: ' + result) } var minDelay = 5000; doSomethingAsync(minDelay).then(printResult); A lot of boilerplate. I then discovered through this answer that I could use the Promise.join function to join the promise wrapping the request with a Promise.delay of the minimum 5 second delay to achieve the same thing: fiddle here function makeCallWith3SecondLatency(cb) { console.log('mocking a call wi…
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/25842500
has answer: http://stackoverflow.com/a/28223454
answer count: 4
type: AnsweredQuestion
tagged with: bluebird
has answer: http://stackoverflow.com/a/32937476
has answer: http://stackoverflow.com/a/69466576
has answer: http://stackoverflow.com/a/28222854
type: Question
accepted answer: http://stackoverflow.com/a/28222854
has title: Set minimum delay on bluebird.js promise resolution
tagged with: javascript
score: 4

http://stackoverflow.com/comment/44873542
type: Comment
comment on: http://stackoverflow.com/a/28257712
has text: I wasn't aware self-closing script tags even worked; what spec are you operating under?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44705593
comment on: http://stackoverflow.com/a/28167176
score: 0
type: Comment
has text: Thanks. I thought the download builder had superseded the highcharts-more file.
type: AnswerComment

http://stackoverflow.com/q/28135408
has answer: http://stackoverflow.com/a/28137109
has comment: http://stackoverflow.com/comment/44643194
has title: load div from remote html page and append it in current page
type: AnsweredQuestion
has body: i need to load a div from a remote html page to the current page based on user selected image. the process is when the user clicks any image in the sidebar in the current page, say, load_page.html it will load the required div from snippets.html and append it to the container div following is my html code for container div in load_page.html :- example heading this is an example paragraph. following is the code of the single image (which will be clicked by the users to load the required div): when the user clicks on the above image/div the data-snippet value is sent as request to load the div with same id in the snippets page following is the code in the snippets page: this is a snippet. i will be loaded when the user requests me following is the jquery code which should load the div: $(function(){ $('.load_snippet').on('click', function(){ var snippet = $(this).data('snippet'); $('#container').load('assets/snippets.html #'+snippet); }); }); it is not working perfectly it clears all the contents in the container div.i just want it to be appended in the container div. and in my snippets page there is only html divs. please help
tagged with: jquery
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/44643366
has comment: http://stackoverflow.com/comment/44643199
accepted answer: http://stackoverflow.com/a/28137109
has comment: http://stackoverflow.com/comment/44643374
has comment: http://stackoverflow.com/comment/44643137
has comment: http://stackoverflow.com/comment/44643268
score: 0
has comment: http://stackoverflow.com/comment/44642948
linked to: http://stackoverflow.com/q/7420908
has comment: http://stackoverflow.com/comment/44643047
answer count: 1
duplicate of: http://stackoverflow.com/q/7420908
tagged with: javascript

http://stackoverflow.com/q/28209326
has body: function initialize(markers) { var mapOptions = { zoom: 7, center: new google.maps.LatLng(40.4378271,-3.6795367) } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(markers[0],markers[1]), map: map, title: 'Hello World!' }); } function markers() { var marker = ["1","2","3","4"]; return marker; } google.maps.event.addDomListener(window, 'load', initialize(markers()); This should create a marker in lat 1 long 2, but it crashes miserably Some advices?
possible better answer: http://stackoverflow.com/a/30298729
downvote count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28209718
has comment: http://stackoverflow.com/comment/44783755
score: -1
duplicate of: http://stackoverflow.com/q/27791921
has comment: http://stackoverflow.com/comment/44783341
type: Question
answer count: 2
tagged with: function
tagged with: arrays
has answer: http://stackoverflow.com/a/28209718
tagged with: javascript
has answer: http://stackoverflow.com/a/30298729
tagged with: google-maps-api-3
upvote count: 3
has title: Passing array as parameter google maps
linked to: http://stackoverflow.com/q/27791921
favorite count: 0

http://stackoverflow.com/comment/57911151
score: 0
type: AnswerComment
has text: I'm not sure calling this "mutable state" is quite accurate, as the goal of promises in the first place (or at least a main one) is to allow async code to be written the way sync code would be, in which case we're talking about local variables. Certainly no-one considers assigning a value to a local variable to be violating the mutable state principal, do they?
type: Comment
comment on: http://stackoverflow.com/a/28250700

http://stackoverflow.com/comment/44892912
type: QuestionComment
score: 1
has text: Why would you "automatically" write stuff like that ?
comment on: http://stackoverflow.com/q/28268407
type: Comment

http://stackoverflow.com/a/28250131
has body: So the question is, can I generally replace == null with the negated expression if statements? Probably not universally, no, but perhaps in some places. If so, what are the pitfalls and exceptions where it wouldn't work? Does it work for general array items, strings, object properties? The !value check will be true for all of the falsey values, not just null and undefined. The full list is: null, undefined, 0, "", NaN, and of course, false. So if you have name = "" then if (!name) { // ... } ...will evaluate true and go into the block, where your previous if (name == null) { // ... } ...would not. So just doing it everywhere is likely to introduce problems. But for situations where you know that you do want to branch on any falsey value, the !value thing is very handy. For instance, if a variable is meant to be undefined (or null) or an object reference, I'll use if (!obj) to test that, because any falsey value is good enough for me there. If you want to keep using JSHint's === rule, you could give yourself a utility function: function isNullish(value) { return value === null || typeof value === "undefined"; } The overhead of a function call is nothing to be remotely worried about (more), and any decent JavaScript engine will inline it anyway if it's in a hotspot.
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28250090
score: 3
has comment: http://stackoverflow.com/comment/44860051
downvote count: 0

http://stackoverflow.com/a/29331955
type: Answer
answers question: http://stackoverflow.com/q/28260889
has body: I have run into the same issue implementing virtual scrolling. My solution is to detect numbers that are too large and use a multiplier. This means that the height of the overflowed content will be realHeight / multiplier. And when I'm trying to figure out what data to show, I just take the scrollTop * multiplier. This works fine to the user because the scrollbar has a minimum height. This will work if you have control over the effect. I'm not familiar with jqGrid, but the source code may have to be updated.
has comment: http://stackoverflow.com/comment/117664378
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/44808051
type: AnswerComment
type: Comment
has text: Everything is happening except the script is not running. :/
comment on: http://stackoverflow.com/a/28222463
score: 0

http://stackoverflow.com/q/28148719
has comment: http://stackoverflow.com/comment/44940622
has comment: http://stackoverflow.com/comment/44669548
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: How to show hidden part of an image which is inside a fixed height div, using just the CSS?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28294443
has answer: http://stackoverflow.com/a/28148852
tagged with: css
has answer: http://stackoverflow.com/a/28294382
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28148852
upvote count: 7
type: Question
has answer: http://stackoverflow.com/a/28294443
has body: I have a container div of size 150x150 which contains an image of size 150x180. The div has overflow: hidden css property enabled so a part of the image is hidden. Div size is fixed 150x150, image height may vary from image to image though. When I hover on the div or image, I want to vertically move the image so that the hidden part of the image could be shown to the viewer. To make this functionality work I've used jQuery. Here's what I'm doing (my css, html, jQuery code blocks): $("#container").mouseenter(function() { img_height = $(this).find('img').height(); $(this).find('img').animate({ 'top': 150 - img_height }, 300); }); $("#container").mouseleave(function() { $(this).find('img').animate({ 'top': 0 }, 300); }); #container { width: 150px; height: 150px; overflow: hidden; border: 1px solid; position: relative; } #container img { position: absolute; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="container"&gt; &lt;img class="fl" src="http://media.dcentertainment.com/sites/default/files/superman-150x180.jpg" width="150"/&gt; &lt;/div&gt; Is it possible to achieve the same functionality by using css transitions? If the answer is yes, then how?
score: -2
downvote count: 9
tagged with: javascript
tagged with: jquery

nodelist
type: Tag
tags question: http://stackoverflow.com/q/28163033
tag name: nodelist

http://stackoverflow.com/q/28226168
has answer: http://stackoverflow.com/a/28226263
type: Question
has title: jQuery - redirect immediately when session is expired or destroyed
has answer: http://stackoverflow.com/a/28226735
tagged with: javascript
tagged with: jquery
score: 0
has body: I have a simple question. How can i make an page immediately redirect to other page in example www.google.com when a specific session is expired or destroyed. Here is how i get an session in PHP: &lt;?PHP $Logged = $_SESSION['LoggedIn']; ?&gt; There are two important things that the jQuery script must do: Without any refresh/reload needed on the page where the script is listening to make a redirect when the session is destroyed for example from another tab in the browser/or the session was expired by a period of time. The script must do a check on every 5 seconds for example. I am new to jQuery so i'll be very thankfull to you if you can help me for the creation of this script. Thanks in advance!
has answer: http://stackoverflow.com/a/28226685
answer count: 4
has answer: http://stackoverflow.com/a/28226884
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/44822620
type: AnswerComment
has text: Is it showing any error on console? don't forget to include `jquery`
score: 0
comment on: http://stackoverflow.com/a/28229908
type: Comment

http://stackoverflow.com/q/28141168
score: 1
has body: I am trying see the actual html content before being rendered by the browser. So I am using selenium-webdriver in node.js. Here's my code and the error I'm getting: Code var webdriver = require('selenium-webdriver'); var driver = new webdriver.Builder(). usingServer('http://localhost:4444/wd/hub'). withCapabilities(webdriver.Capabilities.chrome()). build(); driver.get('http://www.example.com/example/abc'); driver.getPageSource().then(function(html) { console.log(html); return true; }); driver.quit(); Error /home/abhishek/node_modules/selenium-webdriver/lib/webdriver/promise.js:1761 throw error; ^ Error: ECONNREFUSED connect ECONNREFUSED at ClientRequest.&lt;anonymous&gt; (/home/abhishek/node_modules/selenium-webdriver/http/index.js:145:16) at ClientRequest.EventEmitter.emit (events.js:95:17) at Socket.socketErrorListener (http.js:1547:9) at Socket.EventEmitter.emit (events.js:95:17) at net.js:441:14 at process._tickCallback (node.js:415:13) ==== async task ==== WebDriver.createSession() at Function.webdriver.WebDriver.acquireSession_ (/home/abhishek/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22) at Function.webdriver.WebDriver.createSession (/home/abhishek/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30) at Builder.build (/home/abhishek/node_modules/selenium-webdriver/builder.js:294:22) at Object.&lt;anonymous&gt; (/home/abhishek/crawler_postman/crawler_selenium.js:15:14) 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)
linked to: http://stackoverflow.com/q/20055593
has title: ECONNREFUSED connect when running Selenium-webdriver
has answer: http://stackoverflow.com/a/32033065
accepted answer: http://stackoverflow.com/a/32033065
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: node.js
tagged with: selenium-webdriver
downvote count: 0
duplicate of: http://stackoverflow.com/q/20055593
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/129925044

http://stackoverflow.com/q/28131173
type: Question
answer count: 1
score: 0
has title: Javascript - How can I use hexadecimal values as array keys?
accepted answer: http://stackoverflow.com/a/28131261
tagged with: arrays
tagged with: javascript
has body: The Problem Only HEX values of 10 through ff work. I can not assign 00 through 0f as keys; they get dropped from it seems. My understanding is that these values would require quotes to work, but that doesn't seem to be the case. I even read this article and it didn't help. How can I assign these HEX values as array keys? Background What I am trying to do is create a substitution array that holds HEX values that will be used to substitute other HEX values. Confusing? Let me show you: This HEX string comes in (Text that was changed to HEX): 2a2b My goal is then to use the substitution array to change this into another hex string like so: 1fa9 The fastest way I can think to do this is to assign HEX values to the array keys this way I can look up the key that matches the hex value and substitute it right away for its value like so: // I'm working with chunks of 25 fyi for (var i = 0; i &lt; 25; i++) { dataChunck[i] = substitueArray[dataChunck[i]]; } The Rest of My Code This has been cut down to just what you need. hexValues is an array of HEX values 00 through ff. // Start at array index 1 because be defined and saved 0 already for (var x = 1; x &lt; 256; x++) { if (counter &gt; 255) { break; // We now have all 256 HEX values, stop } // We want to allow 256 as an option so go 1 higher (257) if (sub &gt; 0 &amp;&amp; sub &lt; 257) { // If the number (HEX value) is not already saved save it if (sboxValues.indexOf(hexValues[sub - 1]) &lt; 0) { // RIGHT HERE IS THE PROBLEM!!! // This assigns a HEX value as the key and saves sub to it // sub as you can see gets converted to HEX as its saved sboxValues[hexValues[x]] = hexValues[sub - 1]; counter++; } else { // Glitch: That number has been saved, redo this round // Keep x on track so we don't accidently reuse it x--; } sub += num; // Move on to new number } else { // Removed. You don't need to see this code // Keeps x on track so we don't accidently reuse it } }
type: AnsweredQuestion
tagged with: key
tagged with: hex
has answer: http://stackoverflow.com/a/28131261

http://stackoverflow.com/q/28157447
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
tagged with: c3
has answer: http://stackoverflow.com/a/28158362
favorite count: 0
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44686492
has body: We are using c3 as a wrapper around d3 javascript charting library. You can see even in their own demo when the data is updated the scroll bar flickers momentarily. This isn't a problem when there is already a scrollbar on the page as it is in their case. But if the page is smaller the addition and sudden removal or the scrollbar can be jarring. We aren't doing anything wildly different than they do in their examples. The mystery is why the scrollbars jump. Any ideas? If you want to look at my code it is blow: Data is getting passed to our AngularJS Directive using SignalR $scope.$watch('data', function () { normalizedData = normalize($scope.data); chart.load({ columns: getChartDataSet(normalizedData) }); }); After we take the normalized data it simply gets set into an array then passed to C3 var chart = c3.generate({ bindto: d3.select($element[0]), data: { type: 'donut', columns: [], colors: { '1¢': '#2D9A28', '5¢': '#00562D', '10¢': '#0078C7', '25¢': '#1D3967', '$1': '#8536C8', '$5': '#CA257E', '$10': '#EC3500', '$20': '#FF7D00', '$50': '#FBBE00', '$100': '#FFFC43' } }, tooltip: { show: true }, size: { height: 200, width: 200 }, legend: { show: true, item: { onmouseover: function (id) { showArcTotal(id); }, onmouseout: function (id) { hideArcTotal(); } } }, donut: { width: 20, title: $scope.label, label: { show: false, format: function(value, ratio, id) { return id; } } } });
has answer: http://stackoverflow.com/a/28400784
has title: c3 JS scroll bar jumping when loading new data
upvote count: 2
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/28158362
possible better answer: http://stackoverflow.com/a/28400784
type: Question
has comment: http://stackoverflow.com/comment/44686960
has comment: http://stackoverflow.com/comment/44686761

http://stackoverflow.com/comment/44869502
has text: And where is the button in relation to the modal ?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28255610

http://stackoverflow.com/comment/44893600
type: QuestionComment
has text: I want Angular to handle the dom manipulation / user interaction side of it as it's quite good at that stuff but I don't see the need for my entire application to be dependent on it. Removing that dependency means upgrading to Angular 2 should be easier if needed or replacing it with something like React or Ember becomes possible as it's just a small part of the overall app that would need replacing.
comment on: http://stackoverflow.com/q/28268245
score: 0
type: Comment

http://stackoverflow.com/a/28229147
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28228886
has body: Maybe you can use $q.all, the results will be returned in the same order they were called regardless of which one actually returns first. https://docs.angularjs.org/api/ng/service/$q
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28150760
has comment: http://stackoverflow.com/comment/44672689
has answer: http://stackoverflow.com/a/28150806
has title: repeating jquery function many times
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28150803
type: Question
upvote count: 2
has body: I need to improve my jquery code where I repeat my function 6 times!!! is there away to do a loop to shorten the code ? (function( jQuery ){ jQuery.fn.vesta = function(imgN){ var imgPath = "http://localhost:8080/mhost/media/magentohost/vesta/vesta" var currImg = imgPath + imgN + ".png"; var targetImg = jQuery('.img-browser img'); jQuery('.img-browser img').attr('src', currImg); } })( jQuery ); jQuery('.vesta1').on('click', function (e) { jQuery('.vesta1').vesta(1); }); jQuery('.vesta2').on('click', function (e) { jQuery('.vesta2').vesta(2); }); jQuery('.vesta3').on('click', function (e) { jQuery('.vesta3').vesta(3); }); jQuery('.vesta4').on('click', function (e) { jQuery('.vesta4').vesta(4); }); jQuery('.vesta5').on('click', function (e) { jQuery('.vesta5').vesta(5); }); jQuery('.vesta6').on('click', function (e) { jQuery('.vesta6').vesta(6); });
has comment: http://stackoverflow.com/comment/44672677
linked to: http://stackoverflow.com/q/750486
answer count: 6
has answer: http://stackoverflow.com/a/28150786
has answer: http://stackoverflow.com/a/28150828
downvote count: 1
has answer: http://stackoverflow.com/a/28150799
tagged with: function
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28150797

http://stackoverflow.com/q/28199038
type: Question
has comment: http://stackoverflow.com/comment/44764565
tagged with: javascript
has comment: http://stackoverflow.com/comment/44764623
score: 0
linked to: http://stackoverflow.com/q/2383401
answer count: 1
has body: After many days of searching and testing I cannot solve this mystery of why a simple mobile redirect is not redirecting. I have tested several variations from across the web with no avail. If anyone has a moment to look at what I have, please do. Thanks in advance. My goal: Redirect site to mobile site upon detection of user agent. My code is below. NOTE: if I change if(isMobile.any()) { to if(isMobile) { the desktop browser will redirect the site. &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;script&gt; var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } }; if(isMobile.any()) { { window.location = 'http://www.briggsmechanical.com/mobile/index.html'; } } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/44764458
has comment: http://stackoverflow.com/comment/44773942
has comment: http://stackoverflow.com/comment/44773691
tagged with: http-redirect
type: AnsweredQuestion
has title: jscript just not working
has answer: http://stackoverflow.com/a/28204258
accepted answer: http://stackoverflow.com/a/28204258

http://stackoverflow.com/a/28184028
type: Answer
answers question: http://stackoverflow.com/q/28184010
has body: Try below jQuery You can use .last() method constructs a new jQuery object from the last element in that set. $('#recipe-table td').last().width(); JSFIDDLE DEMO
has comment: http://stackoverflow.com/comment/44737383
score: 0

http://stackoverflow.com/comment/44690324
has text: Not sure what you trying to implement but is a good practice to break a big function to smaller functions like i suggest.
comment on: http://stackoverflow.com/a/28158912
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/28170371
tagged with: qml
score: 1
type: Question
has title: Qt 5.4/QML: How do I correctly implement a custom C++ class as a global QML singleton instance and implement code for its signals (in QML)?
accepted answer: http://stackoverflow.com/a/28170542
downvote count: 0
tagged with: javascript
has body: I have a little C++ class that I want to register with QML so I can access it from QML code and provide a safe API for the QML developer - while keeping the complex stuff "under the hood" and hidden from the perspective of QML. So far I have written my custom class like this: main.cpp static QObject *myapi_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) MyApi *apiInstance = new MyApi(); return apiInstance; } int main(int argc, char *argv[]) { QApplication app(argc, argv); qmlRegisterSingletonType&lt;MyApi&gt;("com.example.myapi", 1, 0, "MyApi", myapi_singletontype_provider); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("http://server.com/myqml.qml"))); return app.exec(); } MyApi.h #ifndef MyApi_H #define MyApi_H #include &lt;QObject&gt; #include &lt;QtNetwork&gt; #include &lt;QtCore/QDebug&gt; #include &lt;QtCore/QObjectList&gt; class MyApi : public QObject { Q_OBJECT public: explicit MyApi(QObject *parent = 0); ~MyApi(); signals: void downloadStarted(const QString &amp;uuid); void downloadFinished(const QString &amp;uuid); void downloadError(const QString &amp;uuid, const QString &amp;errorText); void downloadProgress(const QString &amp;uuid, const float progress); public slots: void downloadArchiveInBackground(const QString &amp;uuid); }; #endif // MyApi_H MyApi.cpp #include "MyApi.h" void MyApi::downloadArchiveInBackground(const QString &amp;uuid) { // I would like to connect these signals to JS methods in QML! emit downloadStarted(uuid); emit downloadProgress(uuid, 0.3); } QML (pseudo) MyApi { id: myapi onDownloadStarted: { console.log("OK STARTED") dialogDownload.open() } } Actually I have no idea how to implement this. I'm aware that I'm creating an instance here, and with Singletons that's not required since it's a singleton instance - but I need some pointers on how to implement the signal handlers in QML that I emit from C++.
answer count: 1
favorite count: 0
tagged with: c++
upvote count: 1
has answer: http://stackoverflow.com/a/28170542
tagged with: qt
type: AnsweredQuestion

http://stackoverflow.com/q/28220468
type: Question
linked to: http://stackoverflow.com/q/27862951
score: 1
tagged with: appendchild
tagged with: createtextnode
tagged with: concatenation
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28221210
has title: text+variable concatenation as string inside appendChild($variable) with pure javascript
accepted answer: http://stackoverflow.com/a/28221210
type: AnsweredQuestion
upvote count: 1
has body: I know zero javascript. I achieved most of my requirements by converting & combining little scripts. however at the point I described below I couldn't solve my requirement totally. I want to print the value of the hyperlink id before my constant text also. I don't use jquery. For example for the time being it's only writing "is being replied by the time being." However (assume hyperlink id = 6) it should write "6 is being replied by the time being." I've read this SO Q&A but I couldn't benefit from it. (JS: How to concatenate variables inside appendChild()?) DEMO FOR THE CURRENT STATE @JSFIDDLE JS in body tags function reply_comment (id) { var LinkId = document.getElementById('parent_id'); LinkId.value = id; var message = document.createTextNode(" is being replied by the time being."); document.getElementById('print_id').appendChild(message); document.getElementById("focus_id").focus(); } HTML reply comment filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words filling words Focus the cursor below Paste parent_id below

http://stackoverflow.com/comment/44865844
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28253191
has text: thanks! it works. Is this how tedious meteor is? :( I come from rails. In rails I just put js in assets and it works and loaded.
score: 0

http://stackoverflow.com/comment/44904986
type: QuestionComment
type: Comment
has text: Usually, the app assumes that it stays logged in after checking it once. If the session expires, you can reset that status in the error handling (every request will presumably fail with 400 Forbidden if that happens).
comment on: http://stackoverflow.com/q/28275062
score: 1

http://stackoverflow.com/comment/44737557
score: 0
type: Comment
has text: I don't wanna use id on images.
comment on: http://stackoverflow.com/a/28184005
type: AnswerComment

http://stackoverflow.com/a/28275655
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/44906549
has body: Looks like you forgot quotes around URL: $.ajax({ type: "POST", url: "&lt;?php echo $this-&gt;createUrl('AjaxController/actionDoThing'); ?&gt;", success: function(data, textStatus, jqXHR) { console.log(data); } });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28275478
answers question: http://stackoverflow.com/q/28275478

http://stackoverflow.com/a/28197074
score: 0
type: Answer
has body: Well you return from the confirmation method, but you do nothing with it where you call it. var Main = { addConfirmations: function() { var e = document.querySelectorAll(".bg-red"); for (var t = 0; t < e.length; t++) { e[t].addEventListener("click", function (event) { var title = this.getAttribute("title"); var check = Main.confirmation(title); if(!check) { event.preventDefault ? event.preventDefault() : event.returnValue = false; } }, true); } }, confirmation: function (message) { if (!message || !message.length) { message = "Are you sure you want to proceed?" } return window.confirm(message); } } window.onload = Main.addConfirmations asdf
has comment: http://stackoverflow.com/comment/44766746
answers question: http://stackoverflow.com/q/28196979

angular-amd
tag name: angular-amd
type: Tag
tags question: http://stackoverflow.com/q/28219222

http://stackoverflow.com/q/28192381
has comment: http://stackoverflow.com/comment/44788066
answer count: 1
tagged with: email
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44773284
has title: MailChimp - Optin via my website ( how do i add via the API)?
has body: I have a website that users subscribe into, How can i add them to a list in the API of mailchimp without sending (the redundant) opt-in email to them? The only field thier api (v2.0) is accepting is disable-double-opt-in which does not affect the welcome email)
has answer: http://stackoverflow.com/a/28203599
type: Question
tagged with: mailchimp
tagged with: javascript
score: 0

http://stackoverflow.com/a/28125793
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28125258
has body: If you require simple client side validation, you can use the "required" attribute or in your case @Html.TextBoxFor(model => model.CartridgeNumber, "", new { @id = "txtNumber", required = "required"}) As for the dropdown you can use the same required attribute but for it to work the first 'option' child element must have a blank string for value Please select an option
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28125258
has comment: http://stackoverflow.com/comment/44697455

http://stackoverflow.com/a/28184025
score: 0
has body: function showMenu(elem) { // Clear any currently open menu var openMenu = document.getElementById("activeMenu"); if (openMenu) { openMenu.removeAttribute("id"); // Stop if we're just closing the current menu if (openMenu === elem) { return; } } // Only apply it if the element actually has LI child nodes. // OPTIONAL: Will still work without if statement. if (elem.getElementsByTagName("ul").length &gt; 0) { elem.setAttribute("id", "activeMenu"); } } function showSubMenu(elem) { // Clear any currently open menu var openMenu = document.getElementById("activeMenu"); if (openMenu) openMenu.removeAttribute("id"); var openSubMenu = document.getElementById("activeSubMenu"); if (openSubMenu) { openSubMenu.removeAttribute("id"); // Stop if we're just closing the current menu } // Only apply it if the element actually has LI child nodes. // OPTIONAL: Will still work without if statement. if (elem.getElementsByTagName("ul").length &gt; 0) { elem.setAttribute("id", "activeSubMenu"); } } function showLastSubMenu(elem) { // Clear any currently open menu var openMenu = document.getElementById("activeMenu"); if (openMenu) openMenu.removeAttribute("id"); var openSubMenu = document.getElementById("activeSubMenu"); if (openSubMenu) openSubMenu.removeAttribute("id"); // Stop if we're just closing the current menu var openLastSubMenu = document.getElementById("activeSubMenu"); if (openLastSubMenu) { openLastSubMenu.removeAttribute("id"); } // Only apply it if the element actually has LI child nodes. // OPTIONAL: Will still work without if statement. if (elem.getElementsByTagName("ul").length &gt; 0) { elem.setAttribute("id", "activeLastSubMenu"); } } I post the full code, that with much help from @David resultet in a clickable menu solution, Thanks alot :) the css items #someMenu ul, #somemenu ul li, and #someMenu ul ul had to be changed to classes, so .someMenu ul etc. #activeMenu > ul { display: block; } #activeSubMenu &gt; ul { display: block; } #activeLastSubMenu &gt; ul { display: b…
type: Answer
answers question: http://stackoverflow.com/q/28167327

http://stackoverflow.com/q/28187959
has comment: http://stackoverflow.com/comment/44744482
accepted answer: http://stackoverflow.com/a/28188366
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/44744544
tagged with: javascript
answer count: 1
downvote count: 0
has title: Where to initialise data in Angular service?
has body: I'm finding my way with my first Angular app, and one of the services (used to generate SQL query strings) needs to be initialised with a schema declared in its constant block. At the moment the schema / configuration isn't finalised, so I'm doing a bit of processing, and the result is then made available to a private variable inside the service. I'd like a bit of guidance as to best practice when doing this. It looks like there are 3 options. 1) Expose a public init function on the factory and call it from elsewhere This is a possibility, but I don't want to have to fire up the factory from elsewhere (it will be the first thing that loads). 2) Use an IIFE in the body of the factory This may well be smelly but it actually works fine. angular.module('dataService', []) .constant('DB_CONFIG', { // ...data used to bootstrap the service }) .factory('sqlQueries', ['DB_CONFIG', function(){ var privateStuff_; (function(){ // do processing work on DB_CONFIG in here privateStuff_ = result; })(); return { // no init function needed! publicMethod1: publicMethod1 } } ]) 3) Use the run block I'm confused about Angular's run blocks to be honest. Presumably any variables declared in here will be available to ANY factory on that module? This isn't clear. I could move all code into a run block but can't really see the benefit. Can anyone could clarify the best practice here?
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28188366
score: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44745297

http://stackoverflow.com/a/28186456
has body: Here's a simplified working version of your code use split to generate your input array use if statements rather than switch arrayNum2[i] = 0 is assignment, not equality comparison (use === (strict equality) moved alerts outside the loop http://jsfiddle.net/hk6uger4/2/ var input = prompt("Enter an array of numbers (Separated by comma): "); var arr = input.split(','); var count; var countNeg = 0; var countPos = 0; var countZero = 0; var i = 0; for (i = 0; i &lt;= arr.length; i++) { if (arr[i] &lt; 0) { countNeg++; } if (arr[i] === 0) { countZero++; } if (arr[i] &gt; 0) { countPos++; } } alert("Negative elements = " + countNeg); alert("Zero elements = " + countZero); alert("Positive elements = " + countPos);
score: 0
answers question: http://stackoverflow.com/q/28186017
has comment: http://stackoverflow.com/comment/44742614
type: Answer

http://stackoverflow.com/a/28231289
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44824921
score: 1
has comment: http://stackoverflow.com/comment/44824935
has body: The problem is in your second condition. Since you're using ===, and comparing with 'undefined' which is a string, instead of undefined, it returns false. So, you need localStorage === undefined, as in if (localStorage.user_name === null || localStorage.user_name === undefined) Or, need to use typeof which returns String. But there's a better way if(!localStorage.user_name){ }
accepted answer of: http://stackoverflow.com/q/28231267
has comment: http://stackoverflow.com/comment/44824924
answers question: http://stackoverflow.com/q/28231267
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44824983

http://stackoverflow.com/comment/44958988
comment on: http://stackoverflow.com/q/28158298
has text: Thanks. But they are asking to replace the English file with another language file. That wont work here. My application serve both english and french users.ideally, jqGrid should automatically fetch the correct locale file based on browser language settings.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44883833
type: QuestionComment
score: 0
has text: I want to build a rich domain model. is there a better apporach ?
type: Comment
comment on: http://stackoverflow.com/q/28263368

http://stackoverflow.com/a/28246776
answers question: http://stackoverflow.com/q/28246765
type: Answer
has body: Easy. var result = input.replace(/\d([+-]?)/g,function(match,plus) { var s = plus ? "sup" : "sub"; return "&lt;"+s+"&gt;"+match+"&lt;/"+s+"&gt;"; }); Done.
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/44854210
accepted answer of: http://stackoverflow.com/q/28246765
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28169865
type: Question
tagged with: arrays
tagged with: javascript
has body: How do I make a dropdown list disable if it doesn't contain any value using foreach to get data in database? This is my current code: <?php $aFilters['AgentName']; echo " "; echo " Select Agent "; foreach($agentsName as $ar) { echo " id'>$ar->first_name$ar->last_name "; } echo " "; ?>
has answer: http://stackoverflow.com/a/28170179
has answer: http://stackoverflow.com/a/28169950
has title: disable dropdown list if not contain any value using php
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28170073
favorite count: 0
upvote count: 0
possible better answer: http://stackoverflow.com/a/28169950
score: -4
has answer: http://stackoverflow.com/a/28169987
tagged with: php
has answer: http://stackoverflow.com/a/28170073
answer count: 4
downvote count: 4
type: AnsweredQuestion

http://stackoverflow.com/q/28183393
tagged with: javascript
score: -1
tagged with: aptana
has comment: http://stackoverflow.com/comment/44766243
upvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/6727704
has comment: http://stackoverflow.com/comment/44736071
favorite count: 0
has comment: http://stackoverflow.com/comment/44767123
has comment: http://stackoverflow.com/comment/44765381
has comment: http://stackoverflow.com/comment/44765579
has answer: http://stackoverflow.com/a/28200606
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44766965
linked to: http://stackoverflow.com/q/8404806
downvote count: 1
type: Question
has body: I have a website hosted that I am using Aptana to connect to the server via SFTP and edit the files there. When I preview the html file, it seems to store a temp version of the file on my local drive: file:///C:/Users/username/AppData/Local/Temp/aptanavfs/aptanavfs2715860739108955789index.html instead of using the live version... and this seems to cause it to not load the CSS/JS (I guess it's not making a copy of these files to the temp path). What's going on? When I view the site live on the internet, everything is working fine.
accepted answer: http://stackoverflow.com/a/28200606
has title: Aptana Studio 3 - SFTP - Preview not displaying CSS/JS. What's wrong?

http://stackoverflow.com/comment/44763274
score: 0
type: AnswerComment
type: Comment
has text: Well, this is honestly not a very friendly approach sharing a link with `.js` in the end
comment on: http://stackoverflow.com/a/28197913

http://stackoverflow.com/comment/125943000
comment on: http://stackoverflow.com/q/28232312
score: 0
has text: `hid` is treated as a number but it's value is never converted or coerced into a number when it was retrieved from `#nextValue`, it's still a string. So the fastest way to fix to coerce `hid` into a number by `+hid`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44903076
type: AnswerComment
score: 0
type: Comment
has text: They should be coming in the right order of the layout at least
comment on: http://stackoverflow.com/a/28236116

http://stackoverflow.com/q/28268835
tagged with: events
favorite count: 0
possible better answer: http://stackoverflow.com/a/63255697
accepted answer: http://stackoverflow.com/a/28272148
has title: React onClick event on component
type: AnsweredQuestion
upvote count: 84
has answer: http://stackoverflow.com/a/28272148
has body: I have a React component called &lt;SensorList /&gt; that has many child &lt;SensorItem /&gt;s (another React component). I want to be able to declare an onClick event on each &lt;SensorItem /&gt; from within &lt;SensorList /&gt;. I have tried doing the following: sensorSelected: function(sensor) { console.log('Clicked!'); }, render: function() { var nodes = this.state.sensors.map(function(sensor) { return ( &lt;SensorItem onClick={ this.sensorSelected } /&gt; ); }.bind(this)); return ( &lt;div className="sensor-list"&gt; { nodes } &lt;/div&gt; ); } Needless to say, I do not get any "Clicked!" coming up in my console. The React inspector in Chrome indicates that an onClick event is registered, with the above function body as it should be. I conclude, therefore, that I can't register onClick events on the actual &lt;SensorItem /&gt; tags (I'm not sure why this is, however). How do I go about achieving this otherwise?
type: Question
has answer: http://stackoverflow.com/a/63255697
tagged with: reactjs
tagged with: javascript
answer count: 2
score: 84
downvote count: 0

asp.net
tags question: http://stackoverflow.com/q/28148516
tags question: http://stackoverflow.com/q/28155906
tags question: http://stackoverflow.com/q/28157676
tags question: http://stackoverflow.com/q/28156744
tags question: http://stackoverflow.com/q/28139351
tags question: http://stackoverflow.com/q/28204549
tags question: http://stackoverflow.com/q/28272399
tags question: http://stackoverflow.com/q/28130798
tags question: http://stackoverflow.com/q/28207463
tags question: http://stackoverflow.com/q/28162210
tags question: http://stackoverflow.com/q/28166936
tags question: http://stackoverflow.com/q/28147375
tags question: http://stackoverflow.com/q/28198062
tags question: http://stackoverflow.com/q/28148024
tags question: http://stackoverflow.com/q/28168268
tags question: http://stackoverflow.com/q/28174239
tags question: http://stackoverflow.com/q/28184267
tags question: http://stackoverflow.com/q/28153002
tags question: http://stackoverflow.com/q/28262345
tags question: http://stackoverflow.com/q/28202480
tags question: http://stackoverflow.com/q/28275139
tags question: http://stackoverflow.com/q/28128001
tags question: http://stackoverflow.com/q/28151145
tags question: http://stackoverflow.com/q/28269587
tags question: http://stackoverflow.com/q/28140099
tags question: http://stackoverflow.com/q/28224439
tags question: http://stackoverflow.com/q/28221696
tags question: http://stackoverflow.com/q/28149591
tags question: http://stackoverflow.com/q/28232495
tags question: http://stackoverflow.com/q/28215250
tags question: http://stackoverflow.com/q/28192072
tags question: http://stackoverflow.com/q/28189958
tags question: http://stackoverflow.com/q/28179545
tags question: http://stackoverflow.com/q/28275211
tags question: http://stackoverflow.com/q/28167980
tags question: http://stackoverflow.com/q/28169261
tags question: http://stackoverflow.com/q/28174509
tags question: http://stackoverflow.com/q/28167223
tags question: http://stackoverflow.com/q/28207558
tags question: http://stackoverflow.com/q/28214341
tags question: http://stackoverflow.com/q/28251501
tags question: http://stackoverflow.com/q/28229715
tags question: http://stackoverflow.com/q/28242393
tags question: http://stackoverflow.com/q/28140084
tags question: http://stackoverflow.com/q/28170562
tags question: http://stackoverflow.com/q/28265620
tags question: http://stackoverflow.com/q/28193501
tags question: http://stackoverflow.com/q/28256164
tags question: http://stackoverflow.com/q/28217130
tags question: http://stackoverflow.com/q/28186319
tags question: http://stackoverflow.com/q/28148011
tags question: http://stackoverflow.com/q/28278896
tags question: http://stackoverflow.com/q/28265349
tags question: http://stackoverflow.com/q/28181992
tags question: http://stackoverflow.com/q/28227790
type: Tag
tags question: http://stackoverflow.com/q/28151162
tags question: http://stackoverflow.com/q/28208432
tags question: http://stackoverflow.com/q/28166720
tags question: http://stackoverflow.com/q/28144354
tags question: http://stackoverflow.com/q/28264718
tags question: http://stackoverflow.com/q/28156835
tags question: http://stackoverflow.com/q/28143301
tags question: http://stackoverflow.com/q/28228725
tags question: http://stackoverflow.com/q/28275602
tags question: http://stackoverflow.com/q/28237338
tags question: http://stackoverflow.com/q/28229705
tags question: http://stackoverflow.com/q/28198884
tags question: http://stackoverflow.com/q/28268155
tags question: http://stackoverflow.com/q/28152225
tags question: http://stackoverflow.com/q/28247534
tags question: http://stackoverflow.com/q/28228178
tags question: http://stackoverflow.com/q/28215212
tags question: http://stackoverflow.com/q/28185035
tags question: http://stackoverflow.com/q/28239603
tags question: http://stackoverflow.com/q/28217928
tags question: http://stackoverflow.com/q/28126746
tag name: asp.net
tags question: http://stackoverflow.com/q/28226324
tags question: http://stackoverflow.com/q/28166048

http://stackoverflow.com/q/28271418
has body: Controller [HttpGet] public ActionResult VerifyUserEmail(string User_Email) { try { using (EmptyMVCApplicationEntities objConnection = new EmptyMVCApplicationEntities()) { ObjectParameter objIErrorCode = new ObjectParameter("ErrorCode", typeof(Int32)); ObjectParameter objBFlag = new ObjectParameter("bFlg", typeof(bool)); objConnection.Check_User_Exists(User_Email, objBFlag, objIErrorCode); if (Convert.ToBoolean(objBFlag.Value) != true) { return Json(new { Success = "false", Message = "Email exists" }, JsonRequestBehavior.AllowGet); } else { return Json(new { Success = "True", Message = "Email not exists" }, JsonRequestBehavior.AllowGet); } } } catch (Exception Ex) { } } Script $("#User_Email").blur(function () { if ($(this).val() != "") { $.ajax({ url: "/User/VerifyUserEmail?User_Email=" + $("#User_Email").val(), success: function (result) { try { var jsonIssueObj = $.parseJSON(result).Data; } catch (e) { alert(e); } if (!jsonIssueObj.Success) { var errorMsg = jsonIssueObj.Message; $('#msg').html(errorMsg); $('#msg').show(); } else { var errorMsg = null; $('#msg').html(errorMsg); $('#msg').hide(); } } }); } return false; }); I am getting below error: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data Also If I want Success and Message in an object, how to pass an object as json in controller actionresult.
accepted answer: http://stackoverflow.com/a/28271471
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28271471
has title: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: asp.net-mvc
tagged with: javascript

http://stackoverflow.com/q/28127040
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28127063
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44627513
has body: I'm using angular.js $scope.$on for listening for events from my service(event got triggered on service data change). I use the following code snippet: $scope.people = contacts.people; $scope.$on('contacts-changed', () =&gt; { $scope.people = contacts.people; }); Is there any way to extend angular to avoid the first line and trigger $scope.$on('contacts-changed') or similar by default on the time of event bind? I was looking in angular.js decorators but not sure how can I decorate $scope to add $scope.$bind or similar method Ideas?
has title: Angular.js $scope.$on initial value
tagged with: angularjs
has answer: http://stackoverflow.com/a/28127439

http://stackoverflow.com/a/28241301
has body: .state('user', { url: '/:slug', params: { id: { value: -1 } }, I have used the above so the ids where not passed in the url.
has comment: http://stackoverflow.com/comment/44917272
answers question: http://stackoverflow.com/q/28241187
has comment: http://stackoverflow.com/comment/44927526
accepted answer of: http://stackoverflow.com/q/28241187
has comment: http://stackoverflow.com/comment/73048798
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/67636990
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44885702
score: 2

http://stackoverflow.com/a/28163079
accepted answer of: http://stackoverflow.com/q/28162136
type: AcceptedAnswer
type: Answer
has body: Well after trying to solve it about like 30mins, i ended up doing this. inside the event Template.example.events({ Session.set('idExample',this._id); Meteor.setTimeout(function(){ Session.set('ready',true) },5000) }) And outside on some Tracker.autorun(function(){}) Tracker.autorun(function(){ if(Session.get('ready')){ Documents.update(Session.get('idExample'), {$set: {content: document}}, function(){ rangy.restoreSelection(savedSel) console.log('saved') }) } });
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44698611
has comment: http://stackoverflow.com/comment/44698574
has comment: http://stackoverflow.com/comment/44699036
has comment: http://stackoverflow.com/comment/44698857
has comment: http://stackoverflow.com/comment/44699005
answers question: http://stackoverflow.com/q/28162136
upvote count: 1

http://stackoverflow.com/a/28177714
type: AcceptedAnswer
has body: You can add an event listener to the element and pass value, etc. In your case of wanting to call a function server side try this. Code.gs function doGet() { return HtmlService.createHtmlOutputFromFile('index').setSandboxMode(HtmlService.SandboxMode.IFRAME) } function getStuff(foo){ Logger.log(foo) } index.html &lt;code&gt; &lt;div&gt; &lt;div id="mylabel"&gt;&lt;/div&gt; &lt;input id="test" value="testing" type="checkbox"&gt; &lt;script&gt; document.getElementById('test').addEventListener("change", changeit); function success(){document.getElementById('mylabel').innerHTML = 'success!'} function changeit(){ var v = document.getElementById('test').value; document.getElementById('mylabel').innerHTML = v; google.script.run.withSuccessHandler(success).getStuff("going IN") } &lt;/script&gt; &lt;/div&gt;
accepted answer of: http://stackoverflow.com/q/28174964
answers question: http://stackoverflow.com/q/28174964
type: Answer
score: 0

http://stackoverflow.com/a/28122283
downvote count: 0
has body: You can't reliably tell between an iPhone 4 or iPhone 4s, as the UA will only contain information such as iOS version. You could tell between 4 and 5 by checking the screen size, but there's no way to reliably tell between 4 and 4s or 5 and 5s, at least with pure Javascript. With ObjC you could tell with "hw.machine"
answers question: http://stackoverflow.com/q/28122187
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/64066800
type: Comment
comment on: http://stackoverflow.com/a/28125064
has text: event.stopPropagation(); is nice solution. Thanks @micha
score: 1
type: AnswerComment

web
tags question: http://stackoverflow.com/q/28133245
tags question: http://stackoverflow.com/q/28159248
tags question: http://stackoverflow.com/q/28129994
tags question: http://stackoverflow.com/q/28248263
tags question: http://stackoverflow.com/q/28195351
tags question: http://stackoverflow.com/q/28123643
tags question: http://stackoverflow.com/q/28277078
tags question: http://stackoverflow.com/q/28148545
type: Tag
tags question: http://stackoverflow.com/q/28127873
tags question: http://stackoverflow.com/q/28160803
tags question: http://stackoverflow.com/q/28151162
tags question: http://stackoverflow.com/q/28166981
tags question: http://stackoverflow.com/q/28156730
tags question: http://stackoverflow.com/q/28184972
tags question: http://stackoverflow.com/q/28231924
tags question: http://stackoverflow.com/q/28175733
tags question: http://stackoverflow.com/q/28133167
tag name: web
tags question: http://stackoverflow.com/q/28272659
tags question: http://stackoverflow.com/q/28232039
tags question: http://stackoverflow.com/q/28152248
tags question: http://stackoverflow.com/q/28187425

http://stackoverflow.com/q/28207916
has comment: http://stackoverflow.com/comment/44781069
has comment: http://stackoverflow.com/comment/44781334
has answer: http://stackoverflow.com/a/28207979
tagged with: wordpress
has comment: http://stackoverflow.com/comment/44781294
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28208156
linked to: http://stackoverflow.com/q/6171013
score: 0
has comment: http://stackoverflow.com/comment/44781119
has body: i am having a problem with my wordpress media uploader, i am selecting multiple images but the problem is that, i can't figure out how to concatenate all the object's keys to a single string to store into database, any help will be appreciated, thanks in advance... P.S. i have tried $.each but it returns an error, cannot use property of undefined. ONE MORE THING: i tried console.log on the variable "attachment.url" and this is the log: http://localhost/wp3/wp-content/uploads/2015/01/long-shadow-logo-example.jpg admin.js?ver=4.0.1:16 http://localhost/wp3/wp-content/uploads/2015/01/Firefox.png admin.js?ver=4.0.1:16 http://localhost/wp3/wp-content/uploads/2015/01/fish-logo-designs-32.png but when i try to add this value to a textbox, only a single url is returned. Here is my JS Code: jQuery(document).on("click", ".custom_media_upload", function(e) { e.preventDefault(); var custom_uploader = wp.media({ title: 'Select Images to Use', button: { text: 'Use Selected Images', }, multiple: true // Set this to true to allow multiple files to be selected }) custom_uploader.on('select', function() { var selection = custom_uploader.state().get('selection'); selection.map(function(attachment) { attachment = attachment.toJSON(); console.log(attachment.url); }); //custom_uploader.open(); }); custom_uploader.open(); });
has comment: http://stackoverflow.com/comment/44781214
has comment: http://stackoverflow.com/comment/44781270
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44781142
has title: js object key and values to a single string
tagged with: php

http://stackoverflow.com/q/28240796
linked to: http://stackoverflow.com/q/2182246
has comment: http://stackoverflow.com/comment/44843995
upvote count: 5
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/43943879
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has title: D3: "SVG4601: SVG Path data has incorrect format and could not be completely parsed."
type: Question
tagged with: d3.js
answer count: 2
has body: I am rendering a line chart and have it working fine on FF and Chrome. When I run the same code on IE 11, however, my lines do not appear and get several hundred errors appearing in the console, like this: SVG4601: SVG Path data has incorrect format and could not be completely parsed. Inspecting the element, I can see that the path data is completely missing: On Chrome, the same element looks as follows: Is anyone able to tell me what is happening in IE to cause this?
score: 5
has comment: http://stackoverflow.com/comment/44842699
has answer: http://stackoverflow.com/a/28245306
has answer: http://stackoverflow.com/a/58840045

http://stackoverflow.com/comment/44648719
comment on: http://stackoverflow.com/q/28138599
has text: I have tried to use the base tag, but that didn't do anything to help, which was suggested on another thread.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28269220
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44894822
has title: Nodes overlapping while drawing a binary tree in canvas
tagged with: canvas
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28269620
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
accepted answer: http://stackoverflow.com/a/28269620
has body: I'm trying to draw a binary tree on canvas. From the server side form data is sent. The data are: text to insert the tree, position on the x axis position on the y axis. When I say "the x axis and y axis position", I mean the arrangement of nodes in a binary tree, I'll try to explain as clearly as possible with a graphic example: (0,0) / \ (-1,1) (1,1) / \ / \ (-2,2) (0,2) (0,2) (2,2) This is: the root is in the position (0,0), the left child in the position (-1,1) (increases in depth, but decreases in width.), the right child (1,1) and so on. The problem is that in some position, two nodes of diferent parent will coincide and one of them will overlap the other. I am having the components in this way because, in the server side, the pairs are formed while the binary tree is traversed (when I walk into a child of the current node I sum 1 to the second component of the pair; if the child is in the left, then I residue 1 in the first component, but if the child is in the right, I sum 1 to the first component). My canvas code is: var TreeDrawer = (function(){ var _depth = 20 , _breadth = 15 , _rootX = width/2 , _rootY = 50 ; var _context = getContext("2d"); _context.textAlign = "center"; _context.fillStyle = "black"; _context.font = "16px Verdana"; var _getX = function (x) { return _rootX + (x * 80); } var _getY = function(y) { return _rootY + (y * 50); } var _drawText = function(partialText, x, y) { console.log(x, y); _context.fillText(partialText, x, y); } return { drawRoot: function (value) { _drawText(value, _rootX, _rootY); }, drawNode: function(value, x, y) { _drawText(value, _getX(x), _getY(y)); } } }); var _tree = new TreeDrawer(); _tree.drawRoot("Raíz"); _tree.drawNode("Nodo", -1, 1); _tree.drawNode("Nodo", 1, 1); _tree.drawNode("Nodo", -2, 2); _tree.drawNode("Nodo", 0, 2); _tree.drawNode("Nodo", 2, 2); _tree.drawNode("Nodo", 0, 2); So, the question is: what I can do to solve this problem ?, ie plot the tree without overlapping. PS: I do not want libraries beca…
upvote count: 1
type: Question
tagged with: tree

http://stackoverflow.com/q/28213634
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28213819
has title: Change scrollbar color of div
has body: I have a div with many row (thymeleaf cicle) and so I use a scrollbar to view all elements. Now i would change the color of this scrollbar but i don't know how. I have read and tried many guides without any result. This is my scrollbar code in js file: $(window).on("load resize",function() { winHeight = $(window).height(); $('#scrollerCa').css({ 'max-height' : (winHeight)-100 + "px", 'overflow-y' : "auto", 'overflow-x' : "hidden", }); }); Anyone have idea how to change the color? Now is very bad thanks in advance
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28213680
tagged with: javascript
tagged with: scrollbar
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/comment/44898713
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28260724
has text: What version of php you are using? If it's under 5.4, the array cannot be defined using square braces `[]` but `array()` instead. I edited the answer. Take a look again.
type: Comment

http://stackoverflow.com/a/75310445
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28137801
has body: img { display: block; } Solved the problem for me.
type: Answer
score: 1

http://stackoverflow.com/comment/103217601
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28250704
score: 0
has text: @Bergi I may have been reading this post and MDN for too long, but are PromiseA and PromiseB actually promises themselves? Are they not functions that return objects, which are promises themselves. And then those promises either result in the resolve or reject methods of the objects being executed? It's the final piece of the puzzle I am still confused about.

http://stackoverflow.com/a/28518104
answers question: http://stackoverflow.com/q/28250628
has body: After inspecting the elements in the browser debugger, I find that the div enclosing the PageContent is being rendered with zero height. To resolve this, I used the following steps: In index.html: Add the fullbleed attribute to the element, per the Polymer layout docs. This tells the body to take up all available space in the viewport. Add the vertical layout and flex attributes to the code in the body so that they take up available vertical space: In my-page.html: Add the vertical layout attributes to the <my page> component and the flex attribute to the ` element so that it takes up : . . . At this point, the will be pushed to the right side of the page. This is not what you want, I gather, so remove the self-end attribute: Finally, although this is not strictly necessary, I noticed that the core-selected selector in your style section should read .core-selected if you want to select the CSS class of that name. For completeness, here are the edited versions of your code: index.html Home my-page.html {{p.TabCaption}} {{p.PageContent}}
type: Answer
score: 0

http://stackoverflow.com/a/28228472
has comment: http://stackoverflow.com/comment/44820102
has comment: http://stackoverflow.com/comment/44820157
score: -2
has comment: http://stackoverflow.com/comment/44820017
has comment: http://stackoverflow.com/comment/44820058
upvote count: 0
answers question: http://stackoverflow.com/q/28228432
has comment: http://stackoverflow.com/comment/44820125
has comment: http://stackoverflow.com/comment/44820186
has comment: http://stackoverflow.com/comment/44819969
has comment: http://stackoverflow.com/comment/44820009
has comment: http://stackoverflow.com/comment/44820035
type: Answer
has body: "num" is not a property of the "add" function is a property of the object created and returned by that function if you want to add num to your add function you need to do add.prototype.num=0; and remove it from your objects definition
downvote count: 2
has comment: http://stackoverflow.com/comment/44820067

http://stackoverflow.com/comment/44762966
comment on: http://stackoverflow.com/q/28197793
has text: @Craicerjack. The random id is generated by the custom component..
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44732675
has text: Does `new Date().getTime()` help you?
comment on: http://stackoverflow.com/q/28181663
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44730964
type: Comment
has text: `.bind` returns a new function and passes the second and further arguments to that function. So `index` is passed the value of `last`. The first argument of `.bind` is the value `this` gets bound to. But since we don't need to bind `this` to a specific value, I just passed `null`. Learn more about `.bind` here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
type: AnswerComment
comment on: http://stackoverflow.com/a/28180731
score: 0

http://stackoverflow.com/a/28155697
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/78299565
has comment: http://stackoverflow.com/comment/78299813
accepted answer of: http://stackoverflow.com/q/28146868
answers question: http://stackoverflow.com/q/28146868
upvote count: 5
has body: This is due to the following change in AngularJS 1.3.1: $observe: check if the attribute is undefined Ui-select uses $observe to set a default value for resetSearchInput: attrs.$observe('resetSearchInput', function() { var resetSearchInput = scope.$eval(attrs.resetSearchInput); $select.resetSearchInput = resetSearchInput !== undefined ? resetSearchInput : true; }); But since the change noted above and since resetSearchInput is undefined, the observer function will never get executed. To solve it for now add the following attribute to your ui-select element: reset-search-input="'false'" Demo: http://plnkr.co/edit/M0pXrN3n6CBjjoJXS4df?p=preview

http://stackoverflow.com/comment/45302625
score: 0
has text: Where did you add it?
comment on: http://stackoverflow.com/q/28166833
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44711126
comment on: http://stackoverflow.com/q/28166607
type: Comment
type: QuestionComment
score: 0
has text: I've cleaned up your question a bit, if you don't mind.

http://stackoverflow.com/a/46409174
has comment: http://stackoverflow.com/comment/80072470
has comment: http://stackoverflow.com/comment/79817689
upvote count: 3
downvote count: 2
has body: As far as I can tell this should work: All non-arrow functions when converted to String START with 'function '. Arrow functions don't. Trying to test for the presence of '=>' is not a reliable way to test whether the function is an arrow or not because any non-arrow function can contain arrow-functions inside them and thus the '=>' can be present in their source-code.
has comment: http://stackoverflow.com/comment/79951631
score: 1
answers question: http://stackoverflow.com/q/28222228
has comment: http://stackoverflow.com/comment/124191384
type: Answer
has comment: http://stackoverflow.com/comment/85143003

http://stackoverflow.com/comment/44816069
comment on: http://stackoverflow.com/a/28225622
has text: @zerkms so, yeah, I retract my statement that `undefined` as a syntax hasn't been properly defined by the standard. It has been, it's an object property. Please, don't freak out now. :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/78520174
answers question: http://stackoverflow.com/q/28150967
score: 0
has body: I took the algorithm from @marckassay and made it work for arrays and having an array at top level: function deepClone&lt;T&gt;(source: T): any { if (Array.isArray(source)) { let res = []; for (let ii of source as any[]) { res.push(deepClone(ii)); } return res; } else if (typeof source === 'object') { let results: { [k: string | number]: any } = {}; for (let P in source) { results[P] = deepClone(source[P]); } return results; } else { return source; } };
type: Answer

http://stackoverflow.com/comment/44724736
score: 0
type: Comment
type: QuestionComment
has text: No. I'm not using Jquery. I'm using angular in my app but the fiddle was quickly created with Jquery. How should I solve it with key frames since I don't know the width of the fading in element, meaning that I don't know at whixh left coordinate I should set the element.
comment on: http://stackoverflow.com/q/28177625

http://stackoverflow.com/q/28218323
tagged with: qml
has comment: http://stackoverflow.com/comment/44801339
type: Question
has body: I am currently trying to use the password strength library zxcvbn.js in QML, without success. I have the following setup with QT 5.3 and the library from here. import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 import "zxcvbn.js" as Zxcvbn ApplicationWindow { Component.onCompleted: { var result = Zxcvbn.zxcvbn('asdf1234', null); } } Which gives me the following error message: TypeError: Property 'zxcvbn' of object [object Object] is not a function Has someone already succeeded in using this lib in qml?
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/33576259
answer count: 1
has title: Using zxcvbn.js in QML
upvote count: 3
type: UnansweredQuestion
downvote count: 1
tagged with: qt
score: 2
has comment: http://stackoverflow.com/comment/44832346

http://stackoverflow.com/a/28204221
downvote count: 0
has body: Use a repeatation quantifier {} to specify the range. /higher than ([\s\S]{10})/igm And get the string you want from group index 1. &gt; var str = "blah blah I'm higher than a plane in the sky blah blah blah" undefined &gt; var re = /higher than ([\s\S]{10})/gmi; undefined &gt; var s = [] undefined &gt; var m; undefined &gt; while ((m = re.exec(str)) != null) { ... s.push(m[1]); ... } 1 &gt; s [ 'a plane in' ]
answers question: http://stackoverflow.com/q/28204183
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44845026
has text: I like it, much neater and simpler way :) Thanks! :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28241816

http://stackoverflow.com/comment/44721992
comment on: http://stackoverflow.com/q/28176334
has text: Already saw that one (and the others actually) but it did not allowed me to do what I need. I'm actually ok with solutions not using __proto__ if it does the job. Thank you for your comment anyway :)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28213491
possible better answer: http://stackoverflow.com/a/28214223
has title: Knockout: Handle events on foreach elements
has answer: http://stackoverflow.com/a/28214223
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/44791377
tagged with: javascript
has comment: http://stackoverflow.com/comment/44790728
answer count: 2
has answer: http://stackoverflow.com/a/28213972
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I have the following code: So what i want to do is, when i put the mouse over the div with class "result", the divs with class "resultcontenttypeIcon" should get visible. This works fine, but the problem is, that this happens to every div child that is created with the foreach loop. So what i want is, that only the div childs of the hovered div become visible, so that the event mouseover is not triggered for every div. I think the problem is, that the newClass value becomes true for the whole viewmodel. This is my viewmodel code: function ItemListViewModel() { newClass= ko.observable(true); myfunction = function() { newClass(true); }, myFunction2= function(){ newClass(false); }, } ko.applyBindings(new ItemListViewModel());
favorite count: 0
accepted answer: http://stackoverflow.com/a/28213972

http://stackoverflow.com/q/28262013
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44886443
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
has body: I am trying to add to my dropdown one of the classes of animate css with bootstrap 3 dropdown native events but it doesn't work. Could you help me with this problem. Thank you very much. Here is the markup Toggle navigation Brand Link (current) Link Dropdown Action Another action Something else here Separated link One more separated link Submit Link Dropdown Action Another action Something else here Separated link $('.dropdown').on('show.bs.dropdown', function () { $(this).children('.dropdown-menu').addClass('fadeInLeft'); })
has answer: http://stackoverflow.com/a/28262948
has comment: http://stackoverflow.com/comment/44893218
score: 1
has comment: http://stackoverflow.com/comment/44892522
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to add animate css to bootstrap dropdown?

http://stackoverflow.com/comment/44985581
type: AnswerComment
type: Comment
has text: No it didn't worked. It shows the same output, only id is displayed
score: 0
comment on: http://stackoverflow.com/a/28213509

forms
tags question: http://stackoverflow.com/q/28228798
tags question: http://stackoverflow.com/q/28160175
tags question: http://stackoverflow.com/q/28157437
tags question: http://stackoverflow.com/q/28155876
tags question: http://stackoverflow.com/q/28193664
tags question: http://stackoverflow.com/q/28166610
tags question: http://stackoverflow.com/q/28258892
type: Tag
tags question: http://stackoverflow.com/q/28215501
tags question: http://stackoverflow.com/q/28184186
tags question: http://stackoverflow.com/q/28256147
tags question: http://stackoverflow.com/q/28204600
tags question: http://stackoverflow.com/q/28243124
tags question: http://stackoverflow.com/q/28204549
tags question: http://stackoverflow.com/q/28248532
tags question: http://stackoverflow.com/q/28251699
tags question: http://stackoverflow.com/q/28153522
tags question: http://stackoverflow.com/q/28206857
tags question: http://stackoverflow.com/q/28189673
tags question: http://stackoverflow.com/q/28128150
tags question: http://stackoverflow.com/q/28168393
tags question: http://stackoverflow.com/q/28129571
tags question: http://stackoverflow.com/q/28137386
tags question: http://stackoverflow.com/q/28174008
tags question: http://stackoverflow.com/q/28237559
tags question: http://stackoverflow.com/q/28207384
tags question: http://stackoverflow.com/q/28122656
tags question: http://stackoverflow.com/q/28127147
tags question: http://stackoverflow.com/q/28258894
tags question: http://stackoverflow.com/q/28152830
tags question: http://stackoverflow.com/q/28146396
tags question: http://stackoverflow.com/q/28253758
tags question: http://stackoverflow.com/q/28270831
tags question: http://stackoverflow.com/q/28238672
tags question: http://stackoverflow.com/q/28223622
tags question: http://stackoverflow.com/q/28198491
tags question: http://stackoverflow.com/q/28180092
tags question: http://stackoverflow.com/q/28219360
tags question: http://stackoverflow.com/q/28218215
tags question: http://stackoverflow.com/q/28275833
tags question: http://stackoverflow.com/q/28161821
tags question: http://stackoverflow.com/q/28160039
tags question: http://stackoverflow.com/q/28142742
tags question: http://stackoverflow.com/q/28184346
tags question: http://stackoverflow.com/q/28189647
tags question: http://stackoverflow.com/q/28263560
tags question: http://stackoverflow.com/q/28260546
tags question: http://stackoverflow.com/q/28263051
tags question: http://stackoverflow.com/q/28183482
tags question: http://stackoverflow.com/q/28243049
tags question: http://stackoverflow.com/q/28196827
tags question: http://stackoverflow.com/q/28122120
tags question: http://stackoverflow.com/q/28165131
tags question: http://stackoverflow.com/q/28181795
tags question: http://stackoverflow.com/q/28146044
tag name: forms
tags question: http://stackoverflow.com/q/28168914
tags question: http://stackoverflow.com/q/28219443
tags question: http://stackoverflow.com/q/28145688
tags question: http://stackoverflow.com/q/28228075
tags question: http://stackoverflow.com/q/28124028
tags question: http://stackoverflow.com/q/28192920
tags question: http://stackoverflow.com/q/28168151
tags question: http://stackoverflow.com/q/28260089
tags question: http://stackoverflow.com/q/28148271
tags question: http://stackoverflow.com/q/28157136
tags question: http://stackoverflow.com/q/28159208
tags question: http://stackoverflow.com/q/28230614
tags question: http://stackoverflow.com/q/28147583

http://stackoverflow.com/comment/52400004
comment on: http://stackoverflow.com/a/32250911
type: Comment
type: AnswerComment
has text: Will give it a try in sometime.
score: 0

http://stackoverflow.com/comment/44654087
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28132687
has text: Yes, but I want to be able to select one element, then the second (then both are selected), then third, fourth (four are selected at the same time). And then to select the fifth element, I would have to unselect one of the previous elements.

http://stackoverflow.com/comment/44757654
type: Comment
type: QuestionComment
has text: This was tagged as Polymer, but Polymer/WebComponents work very differently from Angular and have far different terminology and functionality. Are you actually interested in a Polymer/WebComponent solution?
comment on: http://stackoverflow.com/q/28187244
score: 0

http://stackoverflow.com/q/28180203
score: 10
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28180578
favorite count: 0
has body: I have a method in C++ that expects an object: Q_INVOKABLE void sendValue (const MyClass &amp;value); I'd like to call this method from qml, inside a javascript function, like this: MyApi.sendValue({ "one":"one", "two":2.0, "three": false, "four": [ 5, 6 ], } }); MyClass is defined as follows: #ifndef MYCLASS_H #define MYCLASS_H #include &lt;QString&gt; #include &lt;QVariant&gt; class MyClass { QString one; double two; bool three; int four[10]; public: MyClass(); ~MyClass(); // getters, setters, etc. }; Q_DECLARE_METATYPE(MyClass) #endif // MYCLASS_H In main.cpp, MyClass is registered with qRegisterMetaType&lt;MyClass&gt;(); But none of the setters gets called, only MyClass' default constructor.
tagged with: c++
has title: How to send javascript object to C++ from qml?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28180578
upvote count: 10
type: Question
tagged with: qml

http://stackoverflow.com/a/28237739
has comment: http://stackoverflow.com/comment/44841607
has body: Some jQuery will do the trick, use the Validation Plugin which will make this a lot easier http://jqueryvalidation.org/ then use a rule callback: rules: { textarea: { required: function(element) { return $("#textarea").is(':empty'); } }, checkboxes: { required: function(element) { return $(".checkboxes:checkbox:checked").length &gt; 0); } } } you will need to add classes to the the checkbox inputs as class="{checkboxes: true}" Or whatever you decide to make that class. Also you should adapt the class to be less generic.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44836771
answers question: http://stackoverflow.com/q/28237611
has comment: http://stackoverflow.com/comment/44836995
has comment: http://stackoverflow.com/comment/44836974

http://stackoverflow.com/q/28144740
has comment: http://stackoverflow.com/comment/44661406
has comment: http://stackoverflow.com/comment/44661523
has comment: http://stackoverflow.com/comment/44661475
has comment: http://stackoverflow.com/comment/44661275
has title: JQuery Remove Text Before String
upvote count: 1
has body: Is there anyway to remove the characters before fa-? []  fa-deviantart []  fa-diamond []  fa-digg []  fa-dollar (alias) []  fa-dot-circle-o []  fa-download []  fa-dribbble [] $(document).ready(function() { // var myfa = "fa-"; // var findFA = myfa.substr(myfa.length - 3); // => "fa-" $("textarea").val( $("div").html().replace(/fa-/g,".fa .fa-") ); $("div").html( $("textarea").val() ); }); div { white-space: pre-line; position: absolute; top: 200px; top: 100px; } textarea { position: absolute; width: 90%; left: 5%; padding: 0; height: 100px; }  fa-bitcoin (alias) []  fa-bold []  fa-bolt []  fa-bomb []  fa-book []  fa-bookmark []  fa-bookmark-o []  fa-briefcase []  fa-btc []  fa-bug []  fa-building []  fa-building-o []  fa-bullhorn []  fa-bullseye []  fa-bus []  fa-buysellads []  fa-cab (alias) []  fa-calculator []  fa-calendar []  fa-calendar-o []  fa-camera []  fa-camera-retro []  fa-car []  fa-caret-down []  fa-caret-left []  fa-caret-right []  fa-caret-square-o-down []  fa-caret-square-o-left []  fa-caret-square-o-right []  fa-caret-square-o-up []  fa-caret-up []  fa-cart-arrow-down []  fa-cart-plus []  fa-cc []  fa-cc-amex []  fa-cc-discover []  fa-cc-mastercard []  fa-cc-paypal []  fa-cc-stripe []  fa-cc-visa []  fa-certificate []  fa-chain (alias) []  fa-chain-broken []  fa-check []  fa-check-circle []  fa-check-circle-o []  fa-check-square []  fa-check-square-o []  fa-chevron-circle-down []  fa-chevron-circle-left []  fa-chevron-circle-right []  fa-chevron-circle-up []  fa-chevron-down []  fa-chevron-left []  fa-chevron-right []  fa-chevron-up []  fa-child []  fa-circle []  fa-circle-o []  fa-circle-o-notch []  fa-circle-thin []  fa-clipboard []  fa-clock-o []  fa-close (alias) []  fa-cloud []  fa-cloud-download []  fa-cloud-upload []  fa-cny (alias) []  fa-code []  fa-code-fork []  fa-codepen []  fa-coff…
linked to: http://stackoverflow.com/q/9364400
has comment: http://stackoverflow.com/comment/44661410
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44661954
linked to: http://stackoverflow.com/q/5963182
favorite count: 0
has comment: http://stackoverflow.com/comment/44661325
tagged with: regex
has comment: http://stackoverflow.com/comment/44661366
has answer: http://stackoverflow.com/a/28144896
accepted answer: http://stackoverflow.com/a/28144896
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/28266706
type: Question
has title: get td jstl value by javascript
answer count: 2
has answer: http://stackoverflow.com/a/28266744
tagged with: javascript
tagged with: jquery
upvote count: 3
possible better answer: http://stackoverflow.com/a/28266744
accepted answer: http://stackoverflow.com/a/28266742
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28266742
type: AnsweredQuestion
score: 3
downvote count: 0
has body: I want to get value of td and print it to textbox but td has jstl value so it get the first value in arraylist but I want to get the current value in td when user click it. Can anyone help me how can I do that? $(document).ready(function() { $("div.contacts table td").live('click', function() { document.getElementById("contactName").value= document.getElementById("contactId").innerHTML; }); }); input text and td &lt;input type="text" id="contactName"&gt; &lt;td id="contactId"&gt;{{contact.email}}&lt;/td&gt;

http://stackoverflow.com/q/28229673
tagged with: google-maps-api-3
upvote count: 4
score: 3
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44822291
has comment: http://stackoverflow.com/comment/44832926
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28235708
has title: Get nearest location from a set of predefined locations with Google Maps Javascript API
has comment: http://stackoverflow.com/comment/44824248
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44832359
tagged with: javascript
has body: I have a set of 2 predefined locations and based on user's input of zipcode, I need to show the nearest one. So far, I have searched the user input location using the zipcode: $("form#zipcodeSearch").on("submit", function(event){ event.preventDefault(); var jsonUrl = 'http://maps.googleapis.com/maps/api/geocode/json?address='+$("input#zipcode").val(); $.ajax({ type: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'text/plain' }, dataType: "json", url: jsonUrl, success: function (data) { var lat = (data.results[0].geometry.bounds.northeast.lat + data.results[0].geometry.bounds.southwest.lat) / 2; var lng = (data.results[0].geometry.bounds.northeast.lng + data.results[0].geometry.bounds.southwest.lng) / 2; initialize(lat, lng); } }); }); var map; function initialize(lat, lng) { var mapOptions = { zoom: 15 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(lat, lng); var infowindow = new google.maps.InfoWindow({ map: map, position: pos, content: ' You are here! ' }); map.setCenter(pos); }, function() { handleNoGeolocation(true); }, { enableHighAccuracy: true }); } else { // Browser doesn't support Geolocation handleNoGeolocation(false); } } function handleNoGeolocation(errorFlag) { if (errorFlag) { var content = 'Error: The Geolocation service failed.'; } else { var content = 'Error: Your browser doesn\'t support geolocation.'; } var options = { map: map, position: new google.maps.LatLng(60, 105), content: content }; var infowindow = new google.maps.InfoWindow(options); map.setCenter(options.position); } *{ margin: 0; padding: 0; } body{ font-family: arial; font-size: 62.5%; /* so, 10px = 1rem */ } #map-canvas{ z-index: -1; position: absolute; top: 0; height: 100%; width: 100%; } jsFiddle Any ideas on how to achieve this? If it is not possible with the JS API, is there any othe…
accepted answer: http://stackoverflow.com/a/28235708
has comment: http://stackoverflow.com/comment/44822675

http://stackoverflow.com/q/28264580
linked to: http://stackoverflow.com/q/1458633
has comment: http://stackoverflow.com/comment/44885859
has comment: http://stackoverflow.com/comment/44885835
has answer: http://stackoverflow.com/a/28266381
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28264865
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/28265510
has title: Can javascript be trusted when making calculations?
accepted answer: http://stackoverflow.com/a/28264724
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/588004
tagged with: floating-point-precision
favorite count: 0
has comment: http://stackoverflow.com/comment/44885900
has answer: http://stackoverflow.com/a/28264724
has answer: http://stackoverflow.com/a/28264865
has body: I am implementing an invoice system, where everything is dynamically added on the dom through javascript and I am making some calculations on the browser itself with javascript. for eg I am calculating each invoice line with quantity and price of unit and generating a total sum price can be a floating point number but I am not sure if this should be trusted or not, if someone has the same toughts about javascript please comment :) I don't know but javascript doesn't seem to me to be trusted like other programming languages like PHP or so, this is my opinion, but if you can convince me please do Thanks
answer count: 4
has comment: http://stackoverflow.com/comment/44886804
has comment: http://stackoverflow.com/comment/44886011
has comment: http://stackoverflow.com/comment/44886043
has comment: http://stackoverflow.com/comment/44885897

http://stackoverflow.com/q/28141389
has comment: http://stackoverflow.com/comment/44655144
has comment: http://stackoverflow.com/comment/44655178
has body: I have a web page which is chock full of javascript, and a few references to resources like images for the javascript to work with. I use a websocket to communicate with the server; the javascript parses the socket's data and does things with the page presentation accordingly. It all works fine, except when it doesn't. The problem appears to be that that page contains images which I want to display parts of, under javascript control. No matter how I play with defer, there are apparently situations in which the images don't seem to be fully downloaded before the javascript tries to use them. The result is images are missing when the page is rendered, some small percentage of the time. I'm not very used to languages and protocols where you don't have strict control over what happens when, so the server and browser shipping stuff and executing stuff in an uncontrolled and asynch order annoys me. So I'd like to stop depending on apparently unreliable tricks like defer. What I'd like to do is just download the whole page, and then open my websocket and send my images and other resources down through it. When that process is complete, I'll know it's safe to accept other commands from the websocket and get on with doing what the page does. In other words I want to subvert the browsers asynch handling of resources, and handle it all serially under javascript control. Pouring an image file from the server down a socket is easy and I have no trouble coming up with protocols to do it. Capturing the data as byte arrays, also easy. But how do I get them interpreted as images? I know there are downsides to this approach. I won't get browser caching of my images and the initial page won't load as quickly. I'm ok with that. I'm just tired of 95% working solutions and having to wonder if what I did works in every browser imaginable. (Working on everything from IE 8 to next year's Chrome is a requirement for me.) Is this approach viable? Are there better ways to get strict, portable …
tagged with: javascript
tagged with: image
has answer: http://stackoverflow.com/a/28162465
score: 0
answer count: 1
favorite count: 0
has title: javascript: create an image resource from a byte array
has comment: http://stackoverflow.com/comment/44695283
has comment: http://stackoverflow.com/comment/44695276
has comment: http://stackoverflow.com/comment/44695296
accepted answer: http://stackoverflow.com/a/28162465
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/q/28239089
has answer: http://stackoverflow.com/a/59060586
upvote count: 1
type: Question
has title: addClass('active') with window.location.pathname - url is without file extension
has comment: http://stackoverflow.com/comment/44839526
score: 1
tagged with: javascript
tagged with: navigation
answer count: 2
downvote count: 0
tagged with: url
tagged with: jquery
favorite count: 0
has body: this is my first question here, I'm stuck and didn't found the answer I was looking for. I have this situation where I want to .addClass('active') to navigation link. It works well if my window.location.pathname has extension like .html or .php. I have "nice" URL via .htaccess which hides extension of files and look something like this: http://mydomain/biography instead of http://mydomain/biography.php So here is the code that I wrote HTML Home Bio Something Contact jQuery $(document).ready(function() { $("nav [href]").each(function() { if (this.href == window.location.href) { $(this).addClass("active"); } }); }); I think .htaccess code is not necessary for this kind of situation Is there any way to parse this.href and to exclude file extension (in my case .php) or is there better way to deal with this? Thanks in advance! =D
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28241322
has comment: http://stackoverflow.com/comment/44839227

http://stackoverflow.com/a/28134713
has body: Javascript function() should return true, since you are using return function() in onclick attribute of button type=submit This will continue the form posting onclick of the button If you are trying to create the number of questions on click dynamically using javascript, then use syntax to call questionTable Create Questions Remove onSubmit=" return questiontable()" from the form Now when the question table is rendered, please show the button type="submit" Go to trigger form submission Hope it helps!
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44641677
answers question: http://stackoverflow.com/q/28134685
has comment: http://stackoverflow.com/comment/44641638

http://stackoverflow.com/q/28134390
tagged with: scope
has title: Javascript - Emptying Object instead of Creating new Object
score: 0
has comment: http://stackoverflow.com/comment/44641054
accepted answer: http://stackoverflow.com/a/28134825
has comment: http://stackoverflow.com/comment/44641227
has comment: http://stackoverflow.com/comment/44641059
possible better answer: http://stackoverflow.com/a/28134717
has answer: http://stackoverflow.com/a/28134825
has answer: http://stackoverflow.com/a/28134717
type: AnsweredQuestion
has body: After each click, I intend to empty object editProductList. My code below is instead creating an additional new object editProductList instead of emptying the original editProductList. How do I ensure I'm emptying editProductList instead of creating a new editProductList after clicking it once more? After the first clicking on the 'devices' column, then #edit_product_add_btn, I'm logging: product name, qty: Remote Tag 6 After the second clicking on the 'devices' column, then #edit_product_add_btn, the previous object remains, and it updates both the original object and new one at the same time product name, qty: Remote Tag 7 product name, qty: Remote Tag 6 Why is it creating an additional object of the same editProductList instead of emptying the original one? EditableGrid.prototype.mouseClicked = function(e) { var editProductList = {}; $.ajax({ //... success: function(response) { editProductList = JSON.parse(response); console.log('editProductList direct from DB: ', editProductList); //adding products into editProductList $('#edit_product_add_btn').on('click', function(e) { var in_editProductList = false; for (var product in editProductList) { if (editProductList.hasOwnProperty(product)) { if (editProductList[product].name === productType) { //... console.log('product name, qty: ', editProductList[product].name, editProductList[product].qty); in_editProductList = true; break; } } } if (in_editProductList === false) { //... var new_product_obj = { name: productType, qty: qty }; editProductList[Object.size(editProductList)] = new_product_obj; } }); }); }
has comment: http://stackoverflow.com/comment/44641302
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44641323
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/44792621
has text: the problem is even when I remove dom ready I'm getting same error
comment on: http://stackoverflow.com/a/28214413
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28154358
has comment: http://stackoverflow.com/comment/44681264
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44680265
tagged with: css
has comment: http://stackoverflow.com/comment/44680404
score: 0
has comment: http://stackoverflow.com/comment/44680862
has comment: http://stackoverflow.com/comment/44680447
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44706844
has title: is it possible to externally call a with java in browsers url box?
has body: I'm testing how secure is an experiment I'm doing with Javascript. I have this 'popup' (a form, not external popup in a new window) that shows when a user gets a certain number of points. Is it possible if a person can call that pop-up with a javascript command in the url box. And what command would one have to use? Here's an example; You won Enter your info Submit ali
has comment: http://stackoverflow.com/comment/44681328
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44680295

http://stackoverflow.com/comment/44744305
has text: Why the downvote? The question makes perfect sense.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28187988

android-viewpager
tag name: android-viewpager
type: Tag
tags question: http://stackoverflow.com/q/28231431

http://stackoverflow.com/a/28258237
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28258088
has body: I created a working fiddle for you. http://jsfiddle.net/8dtauh8e/1/ $(document).ready(function(){ window.sati = 1; $("#addSat").click(function(){ var sat = window.sati; var item = $('&lt;span class="hour' + sat + '"&gt;&lt;span class="numHour"&gt;' + sat + '&lt;/span&gt;&lt;input type="text" value="" name="subject"/&gt;&lt;button type="button" class="down"&gt;&amp;darr;&lt;/button&gt;&lt;button type="button" class="up"&gt;&amp;uarr;&lt;/button&gt;&lt;/span&gt;&lt;br/&gt;'); $('form#form1').append(item); item.find('button').on('click', function(){ alert('here - ' + $(this).prop('class') + ' ' + sat); }); window.sati+=1; }); });

http://stackoverflow.com/comment/44683326
comment on: http://stackoverflow.com/q/28155841
type: Comment
has text: @dystroy I'll see if I can fiddle it.
type: QuestionComment
score: 0

http://stackoverflow.com/q/28179545
score: 0
has body: Hi I have warm up myself with ember.js and I am a ASP.NET Web developer. by reading more and more about ember.js I found that I can build a page with MVC pattern in javascript. Seems foolish question but anyway is it logical to this : 1)Create a aspx page which contains some methods like this : //Shop.aspx [WebMethod] public static object GetCustomers(){ var db = new entities(); return from c in db.Custmers select c; } [WebMethod] public static object AddCustomer(string fullname,string phone){ var db = new entities(); Customer c = new Customer(fullname,phone); db.Customers.Add(c); db.SubmitChanges(); } 2) Now I will create a app.js and by ember.js I will do something like this: //for example : //define new controller to get Customers from server aspx page; //define new controller to save a customer to server; 3) post my html page with ember libs near the aspx page on server 4) share my website. So with ember js I had show my total database tables in Ember.Model , so anyone can understand my database scheme. and Hackers can see my web methods. can they call my web methods ? if the can they had hacked me. At last but not least , does this way of programming safe ? thanks in advance.
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28180182
tagged with: javascript
tagged with: asp.net
type: Question
has title: full emberjs database driven website
tagged with: ember.js

http://stackoverflow.com/comment/44756818
has text: Thanks Tom, lifesaver!
comment on: http://stackoverflow.com/a/28191265
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44846257
has text: @BhojendraNepal not true with angular 1.3 https://docs.angularjs.org/guide/migration
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28242712
score: 1

http://stackoverflow.com/q/28125830
has comment: http://stackoverflow.com/comment/44625026
favorite count: 0
has comment: http://stackoverflow.com/comment/44625018
has body: I was having some problem when trying to find the minimum distance from an array. I got a list of distance retrieved from Servlet and I loop through it to find the minimum. Here is the code: function getAllTaxiLoc(){ var taxiIcon = []; var minDist = 0; var minDistPlate = ""; $.ajax({ url: "/TrackNYP/TrackNYPServlet?action=GetAllTaxiLoc", type: "GET", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { $.each(data, function (i, jsondata) { var taxiPlate = jsondata.taxiPlate; var taxiLocX = jsondata.taxiLocX; var taxiLocY = jsondata.taxiLocY; // Calculating to determine if the taxi location is within buffer radius var xs = 0; var ys = 0; xs = taxiLocX - 29770.742075; xs = xs * xs; ys = taxiLocY - 40062.99945; ys = ys * ys; var distance = Math.sqrt( xs + ys ); if(distance &lt; 800){ //Plot marker onto map if(minDist &gt; distance){ minDist = distance; minDistPlate = taxiPlate; } } console.log(minDist + "DIST"); console.log(minDistPlate + "PLATE"); }); }, error: function (request, state, errors) { } }); } From these code, the minDist and minDistPlate I printed out was 0 and empty. Any ideas? Thanks in advance.
has comment: http://stackoverflow.com/comment/44624894
accepted answer: http://stackoverflow.com/a/28126009
tagged with: loops
has comment: http://stackoverflow.com/comment/44625185
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44625248
has answer: http://stackoverflow.com/a/28126009
tagged with: javascript
has comment: http://stackoverflow.com/comment/44624922
has title: Finding minimum value from array
type: Question
upvote count: 2
score: 0
downvote count: 2
answer count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/44624989

http://stackoverflow.com/q/28254498
accepted answer: http://stackoverflow.com/a/28254610
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28254687
tagged with: constructor
type: Question
has title: What does constructor.prototype.property do in Javascript?
upvote count: 3
has answer: http://stackoverflow.com/a/28254570
possible better answer: http://stackoverflow.com/a/28254564
has answer: http://stackoverflow.com/a/28254610
has answer: http://stackoverflow.com/a/28254564
tagged with: javascript
has body: var x = { foo: "A" }; x.constructor.prototype.foo = "B"; var y = {}; After running this code x.foo returns "A" which is understood. But y.foo returns "B" even if y is an empty object. I'm interested to know what does x.constructor.prototype.foo actually do? Thanks for everyone in advance.
answer count: 4
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/44737915
has text: Are you using alining roles package?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28183458

http://stackoverflow.com/comment/44841574
type: Comment
has text: Yes, both os them are in root/grunt/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28240063

http://stackoverflow.com/q/28224624
tagged with: javascript
score: 0
has title: Specific property from object in Javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28224683
tagged with: loops
has body: Lets say i have this object and the first two have the property bought(how many of them the user bought) var Drugs = { Extasy : { name : "Extasy", value: 0, bought : 2, hist : [], qty : 0 }, Hash : { name : "Hash", value: 0, hist : [], bought: 3, qty : 0 }, Adrenaline : { name : "Adrenaline", value: 0, hist : [], qty : 0 }, Cocaine : { name : "Cocaine", value: 0, hist : [], qty : 0 }, Mdma : { name : "Mdma", value: 0, hist : [], qty : 0 } }; and i want to loop through the Drugs object in order to find out which of them has the bought property. var outputs = '&lt;li class="ui-li-has-count"&gt;'; for (var d in Drugs) { var dd = Drugs[d]; if (Drugs.hasOwnProperty(dd.bought)) { // if (dd.bought != 'undefined' ){ outputs+='&lt;a class="ui-btn ui-btn-icon-right ui-icon-carat-r" href="#myPopup" onclick="buyPopup(this.id)" id='+dd.name+' &gt;'+dd.name+'&lt;span class="ui-li-count"&gt;'+dd.bought+'&lt;/span&gt; '; } else { outputs = false; } outputs += '&lt;/li&gt;&lt;/div&gt;'; } //getElementById ast("panel1").innerHTML += outputs; Even if my bought key has a property i always get false
type: Question
tagged with: object
answer count: 2
has comment: http://stackoverflow.com/comment/44812380
has answer: http://stackoverflow.com/a/28224736
has comment: http://stackoverflow.com/comment/44812465

http://stackoverflow.com/comment/85837994
has text: @trusktr, `(() => {let prot = Object.create(null); let instance = Object.create(prot); Object.freeze(prot); instance.foo = "bar"; console.log(instance)})();`. descendant can be modified with a frozen prototype.
type: Comment
comment on: http://stackoverflow.com/a/28197020
type: AnswerComment
score: 0

http://stackoverflow.com/a/28217037
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44797982
has comment: http://stackoverflow.com/comment/44800471
answers question: http://stackoverflow.com/q/28216554
score: 0
has body: You can reset and set the popover... Fiddle : http://jsfiddle.net/Lh2rpj0f/3/ JS : jQuery(document).ready(function($) { $('a.add').on('click', function(event) { event.preventDefault(); $('.container').append(' '); }); $('a.enable').on('click', function(event) { event.preventDefault(); $('.input').not('.showPopover').addClass('showPopover'); unset();set(); }); set(); function unset(){ $('.input').popover('destroy'); } function set(){ $('.container').on('focus', '.input.showPopover', function(event) { if (!$(this).data("bs.popover")) { $(this).popover({ placement:'right', trigger:'manual', html:true, content:'Remove' }); } $(this).popover('show'); }); $('.container').on('blur', '.input', function(event) { if(mousedownHappened) { mousedownHappened = false; } else { $(this).popover('hide'); } }); $('.container').on('mousedown', '.popover .btn', function(event) { mousedownHappened = true; }); } var mousedownHappened = false; });
upvote count: 1

http://stackoverflow.com/comment/44801017
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28218263
has text: Yeah I agree - think I'll have to add some code to catch it, and ensure enter triggers the button click, rather than the form post. Bit of a pain, but I'm off to google it now :) Cheers Vijay

http://stackoverflow.com/comment/44804340
type: Comment
type: QuestionComment
score: 1
has text: Oh yes, please avoid it!
comment on: http://stackoverflow.com/q/28220550

http://stackoverflow.com/q/28231051
tagged with: date
has title: play framework : Pass date to view
tagged with: playframework
answer count: 1
type: UnansweredQuestion
has body: I need to pass the date parameter to view in play framework My controller looks like something.render(new Date()); And on my view what I've done is @(myDate : Date) &lt;script lang="text/javascript"&gt; var time = "@(myDate)"; &lt;/script&gt;&gt; This time variable I further need to use in jQuery. Thing is Play framework is converting the date to string object. What I want is date object itself. If I remove the quotes around "@(myDate)" Java script gives following output. var backupTimeString = 2015-01-15 00:01:28.767; Uncaught Syntax Error : expecte number I really need the object to passed as Date object not as String represnetation of Date
has answer: http://stackoverflow.com/a/28232818
score: 0
type: Question
tagged with: java
tagged with: javascript

http://stackoverflow.com/comment/44664803
comment on: http://stackoverflow.com/q/28144615
score: 0
has text: @guavacat. True, this is always an option. I wonder if its possible to scope jquery in some way that I dont have to do this though
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44859883
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28250094
type: Comment
has text: `$("textarea[name=textcode]").val();` maybe ?

http://stackoverflow.com/q/28176897
type: UnansweredQuestion
tagged with: php
tagged with: popup
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/28176965
tagged with: magento
tagged with: javascript
tagged with: jquery
upvote count: 1
answer count: 1
has body: I've been having this ongoing problem where my newsletter modal window popup is firing off on every single page on the website. It's very intrusive and I would like it only to popup when a user visits the homepage. I'm running on EE Magento ver. 1.13.1.0 The code I've tried is below and it's placed in footer.phtml: <?php if(Mage::getSingleton('cms/page')->getPageId() == '2' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') : ?> <form action="<?php echo($this->getUrl('newsletter/subscriber/new')) ?>" method="post" > verbiage goes here verbiage goes here *First Name *Last Name *Email Address Submit * Required Fields Email Privacy Statement: more verbiage <?php endif; ?> I've checked to verify that the page id is 2. <?php echo " "; print_r(Mage::getSingleton('cms/page')->getPageId()); echo " "; ?> Additionally, I've found this code snippet here on stack but to no avail, it doesn't work correctly either. <?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') : ?> If it helps that i post the JS then i'll do so too. Any help would be greatly appreciated. Thank you.
has title: Magento newsletter popup (modal window) firing off on every page. It should only popup on the homepage
favorite count: 0

http://stackoverflow.com/q/28153303
tagged with: javascript
favorite count: 0
has title: Reducing duplicate code between emscripten-compiled JS files
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: emscripten
score: 2
has body: Let's say I compile two C libraries to JavaScript using emscripten, e.g. sdl.js and openal.js. I output them as separate files because I don't necessarily want to use both of them all the time. Is it possible to tell emcc to put all the libc code in a third shared file so that the two libraries aren't much larger than they need to be?
type: Question
downvote count: 0

browserify
tags question: http://stackoverflow.com/q/28169090
tags question: http://stackoverflow.com/q/28274573
tags question: http://stackoverflow.com/q/28147694
tags question: http://stackoverflow.com/q/28170788
tags question: http://stackoverflow.com/q/28170705
tags question: http://stackoverflow.com/q/28194243
tags question: http://stackoverflow.com/q/28159631
tags question: http://stackoverflow.com/q/28162686
tags question: http://stackoverflow.com/q/28181554
tag name: browserify
tags question: http://stackoverflow.com/q/28175978
tags question: http://stackoverflow.com/q/28204727
tags question: http://stackoverflow.com/q/28266540
type: Tag
tags question: http://stackoverflow.com/q/28191918

http://stackoverflow.com/comment/44767083
type: QuestionComment
has text: yes, i dont think that matters
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28196421

http://stackoverflow.com/a/28242525
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28242420
has comment: http://stackoverflow.com/comment/44846019
has body: There are a couple things here. First, the template path is always relative to the root. So, if your templates directory is off the root, then this should work: /templates/field.html Second, the property is named templateUrl, the case matters here. So, you need to rename templateURL to templateUrl. Here is the documentation showing the templateUrl property.
answers question: http://stackoverflow.com/q/28242420
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44738128
has text: Wrap `$('#popup').click..` inside a function and invoke it from callback of the ajax call.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28184514
type: Comment

http://stackoverflow.com/comment/44800860
type: Comment
comment on: http://stackoverflow.com/a/28217688
has text: I am trying to run gulp-uglify on the output of factor bundle (https://github.com/substack/factor-bundle) can you help?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/57020922
has text: @ChepA See [my answer](http://stackoverflow.com/a/34637859/)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28227698

http://stackoverflow.com/q/28129198
tagged with: javascript
has comment: http://stackoverflow.com/comment/44631291
has body: So I have this JSON: { "posts":{ "fields":{ "date":"2015/01/24", "date_end":"2015/01/25", "time":"23:00 - 05:00" } } } How do i get into a variable the value from key time but only 05:00 characters if there are present, keeping in mind that time could have in some cases only 23:00 without - 05:00.
possible better answer: http://stackoverflow.com/a/28129229
answer count: 3
upvote count: 1
favorite count: 0
has title: Get string value from json starting from specific index
accepted answer: http://stackoverflow.com/a/28129240
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28129233
has answer: http://stackoverflow.com/a/28129240
type: Question
has answer: http://stackoverflow.com/a/28129229

http://stackoverflow.com/comment/44740851
score: 0
has text: can you explain how can i pass that acquired image into multipart file which your thinking.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28185781

http://stackoverflow.com/comment/44856778
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28248156
has text: Adding the 'jquery' in the array() seems to have gotten rid of the jQuery undefined problem. But now when I check the net panel, it doesn't even get the mobile-menu.js file. What could be wrong?

http://stackoverflow.com/a/28137518
accepted answer of: http://stackoverflow.com/q/28137481
downvote count: 0
answers question: http://stackoverflow.com/q/28137481
type: AcceptedAnswer
has body: I'd suggest, based on the limited information in the question: // attaching the click event-handler to the 'myDiv', // firing the anonymous function if the clicked-element has // an id attribute: $('#myDiv').on('click', '[id]', function(){ // this/$(this) refers to the clicked element, $(this) // finds the &lt;p&gt; elements, and sets its text to: .find('p').text(function (i,t) { // i: the index of the element, // t: the current-text of the element // +t converts to a number, then we add 1 to that number: return +t + 1; }); }); References: find(). on(). text().
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28212644
has title: Javascript TypeError: var not defined, but alert shows content of var
tagged with: string
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44789325
answer count: 0
type: Question
tagged with: javascript
tagged with: variables
has body: i've got an problem with my replace method. function replacePlaceHolder(description) { return description.replace(/\n/g, '&lt;br /&gt;'); } The error is: TypeError: description is undefined But description is defined, if I do alert(description);, i get the content of description. If it try it without the replace method it works: function replacePlaceHolder(description) { return description; } I think it's a little problem, but I don't get it. Thanks for your help!
tagged with: replace
score: 0
has comment: http://stackoverflow.com/comment/44789543

http://stackoverflow.com/q/28162810
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/39161378
has answer: http://stackoverflow.com/a/28163091
has answer: http://stackoverflow.com/a/39161378
favorite count: 0
has title: Why is chart.js canvas not respecting the padding of the container element?
upvote count: 28
has answer: http://stackoverflow.com/a/36558620
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am using Chart.js with a simple line chart but the width and height properties calculated by Chart.js seem to be based on the total width and height of the parent element ignoring padding. var options = { maintainAspectRatio: false, responsive: true }; var data = { labels: ["", "", "", "", "", "", ""], 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] } ] }; var ctx1 = document.getElementById("mychart1").getContext("2d"); var myNewChart = new Chart(ctx1).Line(data, options); .container { padding: 15px 15px 15px 15px; width: 300px; height: 200px; border: 1px solid black; } .child { display: inline-block; border: 1px solid red; width:100%; height:100%; } test JSFiddle The second container and child shows the behaviour I am expecting. Is this a bug with how Chart.js calculates the width and height of the canvas or am I making a styling mistake?
has answer: http://stackoverflow.com/a/37967647
answer count: 6
tagged with: chart.js
has answer: http://stackoverflow.com/a/41693454
score: 28
has answer: http://stackoverflow.com/a/32106194
tagged with: javascript
tagged with: canvas
accepted answer: http://stackoverflow.com/a/32106194

http://stackoverflow.com/comment/44828518
type: QuestionComment
has text: I have edited the question to show my PHP file on the server. No I am not, but I thought this was required with CrossDomain?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28232794

http://stackoverflow.com/q/28234832
upvote count: 3
downvote count: 1
has title: Localhost refuses connection from Javascript
has body: I am making a single web app that takes information from MYSQL database and displays it on screen using AngularJS and NodeJS. I have set up a node.js server that gives out JSON file from a database. It works fine if I connect to it like this: 192.168.1.57:8888 which is my home server ip or remote connecting my server and using localhost:8888. Doing this downloads the JSON file on my computer. However. If I'm using javascript to get JSON file from the server it gives me this error: GET http://localhost:8888/ net::ERR_CONNECTION_REFUSED I have tried connecting to the server with both AngularJS and JQuery and they both give the same error. I've also tried 127.0.0.1 and that doesn't work either. What can I do to fix it or can I do this with a better alternative way? This is the server code in node.js var http = require("http"); mysql = require("mysql"); var connection = mysql.createConnection({ user: "test", password: "test", database: "test" }); http.createServer(function (request, response) { request.on('end', function () { connection.query('SELECT * FROM feedback;', function (error, rows, fields) { response.writeHead(200, { 'Content-Type': 'x-application/json' }); response.end(JSON.stringify(rows)); }); }); }).listen(8888); this is the client side in angularJS: (function(){ var app = angular.module('question', [ ]); app.controller("ServerController", [ '$http', function($http){ $http.get("http://localhost:8888").success(function(data,status,headers,config){ console.log("success"); }).error(function(data,status,headers,config){ console.log("error"); }); } ]); } )();
tagged with: node.js
favorite count: 0
has comment: http://stackoverflow.com/comment/44831718
type: AnsweredQuestion
score: 2
tagged with: server
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28235105
accepted answer: http://stackoverflow.com/a/28235105
has comment: http://stackoverflow.com/comment/44831470
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/44831700
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44735493
type: QuestionComment
has text: Use lodash groupBy function
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28182603

http://stackoverflow.com/comment/44799304
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28217837
has text: Also please post some html
score: 0

http://stackoverflow.com/a/28135532
has body: replace $(e.target) with $(this) your problem get resolved. demo http://jsfiddle.net/sua0yp4y/8/
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28135388
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44684307
type: QuestionComment
has text: Are you confused by the assignment inside a function parameter, `(window.pageName = window.pageName || {}`, or by the entire thing?
score: 0
comment on: http://stackoverflow.com/q/28156454
type: Comment

http://stackoverflow.com/comment/44811957
type: AnswerComment
has text: Also there is another issue with clicking into the table. I would need to add JS to detect what row has been clicked and set focus to it. Right now with your code, if you click into the table the arrow keys only control the the scrolling of the table. If your answer could be updated to reflect those changes it would better suit for future viewers
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28223557

http://stackoverflow.com/q/28122485
has body: Here is the code where I am using uniqid script &lt;a href="" id="download" download="&lt;?php echo uniqid(mt_rand(), true)?&gt;-meme.png" &gt;Download&lt;/a&gt; and the Javascript code $('#download').click(function() { var data = canvas.toDataURL(); download.href = data; }); Here is the demo page. When I click on download link a random name is generated but when I click no it again without refreshing the page I get the same filename?
tagged with: javascript
score: -1
linked to: http://stackoverflow.com/q/4872380
has title: uniqid(mt_rand(), true) is not generating unique names in PHP
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28122654
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/44618980
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44618966
has comment: http://stackoverflow.com/comment/44618956

http://stackoverflow.com/a/28201015
accepted answer of: http://stackoverflow.com/q/28199801
upvote count: 1
answers question: http://stackoverflow.com/q/28199801
has comment: http://stackoverflow.com/comment/44771637
score: 1
has comment: http://stackoverflow.com/comment/44768773
has body: Assuming you have node and npm installed... You need to forget about the HTML markup. That's what node is complaining about. Create a folder called something like example. In that folder, run npm install json-2-csv. Create a file called example.js and paste in the following. Basically, just the script from your question... var converter = require('json-2-csv'); var documents = [ { Make: 'Nissan', Model: 'Murano', Year: '2013', Specifications: { Mileage: '7106', Trim: 'S AWD' } }, { Make: 'BMW', Model: 'X5', Year: '2014', Specifications: { Mileage: '3287', Trim: 'M' } } ]; var json2csvCallback = function (err, csv) { if (err) throw err; console.log(csv); }; converter.json2csv(documents, json2csvCallback); Save the file in that folder. In that folder, run node example.js. That's it! The program will print out the data in CSV format.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44904023
has text: if you do a console.log(MainController); just before the last line, what do you get?
comment on: http://stackoverflow.com/q/28274417
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44785540
type: Comment
has text: Yeah sure but I cannot directly links to it with http, don't know why. sry.
score: 0
comment on: http://stackoverflow.com/q/28210527
type: QuestionComment

http://stackoverflow.com/q/28204727
answer count: 1
has body: On the front end part of my Drupal 8 project, I have several javascript modules linked together using Browserify (and gulp). In several modules I use Foundation, and the way Foundation is made is that it adds a foundation() function to the $ object. This is an excerpt of my package.json where I declared the shims that my project needs : "browser": { "jwplayer": "./libraries/utils/jwplayer/jwplayer.js", "Foundation": "./node_modules/foundation/js/foundation/foundation.js", "jquery": "./node_modules/jquery/dist/jquery.min.js", "Backbone": "./node_modules/backbone/backbone.js", "underscore": "./node_modules/underscore/underscore-min.js" }, "browserify-shim": { "jquery": "$", "underscore": "_", "jwplayer": "jwplayer", "Foundation": { "exports": null, "depends": [ "jquery" ] }, "Backbone": { "exports": "Backbone", "depends": [ "jquery", "underscore" ] } }, "browserify": { "transform": [ "browserify-shim" ] } Everything works great when I'm logged out of the Drupal admin. Although when I'm logged as an admin, Drupal adds a small taskbar on the top, helping you to access the different access menus, and a couple other useful stuff. When Drupal does that, it uses its own version of jQuery, and attach a certain amount of plugins to it. Now when I export my own jQuery and declare it as $ in my package.json file, I obviously erase Drupal's jQuery and all the plugins that came with it, destroying the topbar. How can I possibly tell Foundation and every module or plugin that needs jQuery to use the Drupal one, and not the one in my node_modules folder?
has title: Drupal 8 jQuery conflict
linked to: http://stackoverflow.com/q/23125338
score: 0
accepted answer: http://stackoverflow.com/a/28205609
tagged with: drupal
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28205609
tagged with: shim
tagged with: browserify

http://stackoverflow.com/a/28228914
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44821164
type: Answer
has body: Just test to see if the element exists before trying to get the src attribute from it. angular.forEach($scope.allnews.entries, function (value) { var img = $(value.content).find('img').eq(0); value.articleImage = img ? img.attr('src') : null; });
has comment: http://stackoverflow.com/comment/44821278
score: 2
accepted answer of: http://stackoverflow.com/q/28228887
downvote count: 0
has comment: http://stackoverflow.com/comment/44820989
has comment: http://stackoverflow.com/comment/44821291
answers question: http://stackoverflow.com/q/28228887
has comment: http://stackoverflow.com/comment/44821410
upvote count: 2
has comment: http://stackoverflow.com/comment/44821698

http://stackoverflow.com/comment/44755731
has text: @deveshchauhan27 if it helped, please do mark it as answer by clicking the tick mark.
type: AnswerComment
comment on: http://stackoverflow.com/a/28189099
score: 0
type: Comment

http://stackoverflow.com/a/28431315
has body: I would say this code might be quite slow, since you are using yield* all the task will run sequentially potentially taking much more time than necessary (assuming mockPromise does some io) you might be better of yielding Promise.all or just using promises also your usage of while(true) is very weird..
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28260140

http://stackoverflow.com/q/28275176
type: UnansweredQuestion
tagged with: php
has title: import only email format (Remove invalid format)
type: Question
has answer: http://stackoverflow.com/a/28276340
tagged with: javascript
has body: I am using oauth for yahoo api to import email contact. And I have been successfully importing all my contact email from yahoo into a page. My problem now is I am using a javascript to highlight each email in the text area. This is the sample of the JavaScript which will highlight each email. echo "$(\"#email-tags\").addTag(\"yahoo@yahoo.com\");"; Now if there is something which is not formatted as email, the text area will be blank won't show any email. My question now is how to import only something which is formatted as email. Because sometime in email contact, there is some contact from mailer which its format is like this: DAFDGREGSDFHASRFEW2 &lt;= Not email format, which will make my javascript error in the text area and won't show any email. Here is some last line of yahoo email contact: // Call Contact API $retarrs = callcontact_yahoo(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, $guid, $access_token, $access_token_secret, false, true); //I have to use a delimiter of white space to separate each email here. $ymail = str_replace(',', ' ', $retarrs); //This is my javascript tag &amp; the email contact list will show. echo "$(\"#email-tags\").addTag(\"".$ymail."\");";
linked to: http://stackoverflow.com/q/12026842
score: 0
answer count: 1
tagged with: email

http://stackoverflow.com/comment/44814694
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225523
has text: No, I have not heard of using this method in JS before. how would it used in this case? - thanks

http://stackoverflow.com/q/28131909
has body: How can I control the order that MeteorJS loads my bower packages? I am using the meteor-bower package, but Meteor is loading all bower packages last. This is no good when I need to use a jQuery plugin or something from a script in the client directory.
score: 1
upvote count: 1
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/34956860
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has title: MeteorJS + Bower and Dictating the Loading Order
tagged with: bower

http://stackoverflow.com/q/28182052
has title: Proper use of promises to return results
answer count: 2
has answer: http://stackoverflow.com/a/28182172
tagged with: promise
has comment: http://stackoverflow.com/comment/44733415
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44734052
has answer: http://stackoverflow.com/a/28182145
has comment: http://stackoverflow.com/comment/44734006
score: 0
has body: I am using the 'Q' library for promises. Here is the scenario: var results = dbContext.query(userCert.conn, dbQuery.BuildQuery(query)); var models = []; if (!results.hasErr) { for (var r in results.okPacket.results) { var m = new model(results.okPacket.results[r]); models.push(m); } } userCert.conn.end(); // close db connection In dbContext.query(...): var $Q = require('Q'); function execQuery(connection, query) { console.log("[backend][context] EXEC QUERY: " + query); $Q.nfcall(connection.query, query) .then(function (err, results) { var ret = {}; if (err) { // log var errPkt = getErrPacket(err); console.log("QUERY ERROR[" + errPkt.errCode + ": " + errPkt.errConst + "]: " + errPkt.errMessage); ret = { hasErr: true, errPacket: errPkt }; } else { ret = { hasErr: false, okPacket: { resType: results.constructor.name, resLength: results.length, results: results } }; } // is this correct? return function () { return ret; }; }) .then(function (ret) { // how do I then return ret to the caller? }) .done(); } I'm just a little lost on the way to do this (if possible). Callbacks are okay in the lower levels of my application, but I didn't want to end up with a dish filled with callback spaghetti.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44868993
type: AnswerComment
has text: Hi, this hasn't worked for me :( On the python idle I still get the message: ReferenceError: Can't find variable: MarkersFromDatabase 0 undefined And the markers, still, don't show up on the map...
comment on: http://stackoverflow.com/a/28254893
type: Comment
score: 0

http://stackoverflow.com/a/28277131
has body: To refresh a page without reloading, you have to load the contents of the page through ajax. You could do this as follows: index.php Header of website here Content here Footer here ajax_refresh.php Header of website here Content here Footer here In the above example the 'url' parameter should be a PHP file that only returns the body of the page you want to refresh. For this example to work, you should include jQuery. Good luck Edit To explain this a little more. You will need a second file that looks exactly te same as your index file. Except that in this second file you do not have html, head or body tags. The content of the second file will be loaded into the first file without refreshing. This is the concept of AJAX. For further reading: - Introduction to AJAX - W3Schools
answers question: http://stackoverflow.com/q/28276402
has comment: http://stackoverflow.com/comment/44939626
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28276402
has comment: http://stackoverflow.com/comment/44928123
type: Answer
has comment: http://stackoverflow.com/comment/44910881
score: 1
has comment: http://stackoverflow.com/comment/44910131
upvote count: 1

http://stackoverflow.com/comment/44852492
comment on: http://stackoverflow.com/a/28245560
score: 0
type: AnswerComment
has text: @NiCkNewman First run `document.body.setAttribute('attributehere', 'foobar')`, and then `getA('attributehere')` will return `'foobar'`.
type: Comment

http://stackoverflow.com/q/28135072
accepted answer: http://stackoverflow.com/a/28135106
has body: I have javascript file this is part of the file a().initLibrary({ controls: [ "aa","bb"], elements: [] }); I want to check if input parameter is exist in controls for example var search1 = "dd" the result should be false var search2 = "aa" the result should be true This is the regex to find the data in controls : controls\s*:\s*\[([^\]]*) - the result is the data of the controls How i can check if serach1 or serach2 exist in the result of regex without to check the result with string and split it according to ','. Can I insert the parameter to the regex ?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28135106
upvote count: 1
type: Question
score: 1
has title: How to insert parameter to regex?

http://stackoverflow.com/q/28232660
has comment: http://stackoverflow.com/comment/44837315
tagged with: centos
score: 0
tagged with: css
answer count: 0
type: UnansweredQuestion
has body: Hi I am in very confusing state now. I have configured Nginx 1.6 on Centos 6 for serving only Code (js, css, html) pages all other images coming and calls happened through load balancer. My problem is when I load the page on web browser the first time it will take time and then i refreshed the page 3 to 4 times the images/words are breaking such as akki shown as __akki__ how do i know where its cached and how do i solve this problem my configuration as shown below user nginx; worker_processes 12; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; proxy_buffers 30 32k; proxy_busy_buffers_size 64k; keepalive_timeout 65; gzip on; gzip_comp_level 6; gzip_vary on; gzip_min_length 1024; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript te$ gzip_buffers 16 8k; open_file_cache max=10000 inactive=30s; open_file_cache_valid 60s; open_file_cache_min_uses 2; open_file_cache_errors on; include /etc/nginx/conf.d/*.conf; } default.conf server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
has comment: http://stackoverflow.com/comment/44898876
has comment: http://stackoverflow.com/comment/44901663
type: Question
has title: Nginx Server break images on web browser after refreshed 3 to 4 times
tagged with: nginx
tagged with: configuration-files
tagged with: javascript

http://stackoverflow.com/q/28195420
tagged with: aggregate
type: UnansweredQuestion
has title: How to calculate monthly averages using Forecast.io API in the most efficient way?
score: 3
upvote count: 3
type: Question
has body: In my project I would like to calculate monthly precipitation and temperature averages (min/max) for the whole year, similarly to this chart or average views in this app (which is using Forecast.io data). I have stumbled quite early, however, as I am unable to extract the necessary data from the daily data point in Forecast.io API. This data point promises to contain weather information for the whole week: Ideally, the minutely data block will contain data for the next hour, the hourly data block for the next two days, and the daily data block for the next week; however, if we are lacking data for a given time period, the data point sequence may contain gaps or terminate early. In fact all wrapper libraries for this API that I've checked suggest the same. But I'm getting data only for the particular day, no matter if it's in the future or in the past: forecastData.daily.data.length == 1 See this jsFiddle example. Am I doing something wrong or is there indeed nothing more than one day worth of data and I would need to call the API 365 times? Which leads to my primary question of how most efficiently handle my project in terms of API calls to aggregate the necessary information for the whole year?
has answer: http://stackoverflow.com/a/29917337
tagged with: weather-api
tagged with: javascript
tagged with: jquery
answer count: 1
downvote count: 0
favorite count: 0

e10s
tag name: e10s
type: Tag
tags question: http://stackoverflow.com/q/28130097

datetimepicker
tags question: http://stackoverflow.com/q/28170162
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28206382
tags question: http://stackoverflow.com/q/28135991

http://stackoverflow.com/a/30770026
has comment: http://stackoverflow.com/comment/56554708
answers question: http://stackoverflow.com/q/28258106
score: 9
upvote count: 9
type: Answer
has body: @littleguy23 That is correct, but you don't want to do it to multi select. So just a small change to the code: $(document).ready(function() { // Select - Single $('select:not([multiple])').material_select(); });
downvote count: 0

http://stackoverflow.com/comment/44654692
has text: @CoryDanielson, see [this page in the docs](http://facebook.github.io/react/docs/update.html)
type: AnswerComment
comment on: http://stackoverflow.com/a/28127762
score: 1
type: Comment

http://stackoverflow.com/a/28214413
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44795131
has body: the problem is that you are instantiating "Auth" on dom ready, but the dependecy injector is trying to inject before the dom ready (simplifying). The question is why on dom ready? here are two examples: http://jsbin.com/lulin/1/edit (with on dom ready definition, not working, same error) http://jsbin.com/wajeho/2/edit (without on dom ready definition,working) EDIT: You have to do something like this: http://jsbin.com/xusiva/1/edit?html,js,console I'm difining the factory outside the domready, and inside the controller after domready i'm using it.
type: Answer
answers question: http://stackoverflow.com/q/28212837
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28212837
has comment: http://stackoverflow.com/comment/44794829
has comment: http://stackoverflow.com/comment/44792499
has comment: http://stackoverflow.com/comment/44792621
has comment: http://stackoverflow.com/comment/44792808

http://stackoverflow.com/comment/44908210
has text: Yes you would call it dataStates.withData which I am guessing you would check against something that comes from the server to check if response.stateState == dataStates.withData?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28276812
score: 0

http://stackoverflow.com/q/28130929
has comment: http://stackoverflow.com/comment/44634683
has comment: http://stackoverflow.com/comment/44635094
has answer: http://stackoverflow.com/a/28131010
type: Question
answer count: 2
tagged with: php
has body: I'm trying to use a PHP file to process serialized info from an Ajax request. I want to send back the value of each form field to be further manipulated by javascript (inserted into a div). The result is not being inserted into the HTML. When I alert the result I get {"return":[" form value for name<\/p>"," form value for description<\/p>"]} Any suggestions? EDIT: Updated question with relevant HTML and revised PHP code. HTML: Heading Javascript: .on('success.form.fv', function (e) { e.preventDefault(); var $form = $(e.target); var bv = $form.data('formValidation'); $.post($form.attr('action'), $form.serialize()) .done(function (result) { $('#formBasicResults').html(result.responseText); alert(result); },'json'); }); PHP: if (!isset($_SESSION)) { session_start(); if (!isset($_SESSION['token'])) { $token = md5(uniqid(rand(), TRUE)); $_SESSION['token'] = $token; $_SESSION['token_time'] = time(); } else { $token = $_SESSION['token']; } } foreach($_POST as $key = > $value) { $temp = is_array($value) ? $value : trim($value); $_SESSION[$key] = $temp; } $expected = array( 'name' = > 'string', 'description' = > 'string', ); foreach($expected AS $key) { if (!empty($_POST[$key])) { $ {$key} = $_POST[$key]; } else {${$key} = NULL; } } foreach($expected AS $key = > $type) { if (empty($_POST[$key])) { $ {$key} = NULL; continue; } if (!isset($ { $key})) { $ {$key} = NULL; } } function safe( $value ) { htmlentities( $value, ENT_QUOTES, 'utf-8' ); return ($value); } $name = $_POST['name']; $description = $_POST['description']; $return['result']=array(); if(!empty($name)){$return['result'][]= ' ' . safe($name) . ' ';} if(!empty($description)){$return['result'][]= ' ' . safe($description) . ' ';} echo json_encode($return);
score: 0
has answer: http://stackoverflow.com/a/28130969
tagged with: dom
has comment: http://stackoverflow.com/comment/44634591
has title: Unable to insert Ajax return into HTML
has comment: http://stackoverflow.com/comment/44634877
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/a/28167340
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28164642
answers question: http://stackoverflow.com/q/28164642
has body: You can use Promise.map with .bind: function getComponentStatuses(componentsToCheck) { return Promise.map(componentsToCheck, function() { var start = Date.now(); return getAsync({ url: component.endpoint, timeout: component.timeout }) .bind({ name: component.name, status: null, body: null, time: null }) .spread(function(response, body){ Logger.info('GET took ' + end + 'ms.'); this.status = response.statusCode; this.body = body; return this; }) .catch(function(e) { return this; }) .finally(function() { this.time = Date.now() - start; }) }); } Note that your timing method is incorrect because the http agent might throttle requests.
downvote count: 0
has comment: http://stackoverflow.com/comment/44707700
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44711566
has comment: http://stackoverflow.com/comment/44711177
has comment: http://stackoverflow.com/comment/44712388
type: Answer
score: 6

http://stackoverflow.com/q/28215896
linked to: http://stackoverflow.com/q/7381293
has comment: http://stackoverflow.com/comment/44795262
has comment: http://stackoverflow.com/comment/44795366
has title: Intercepting innerHTML and execution other command
has comment: http://stackoverflow.com/comment/44795356
answer count: 1
has comment: http://stackoverflow.com/comment/44795471
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/44795099
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28215991
has comment: http://stackoverflow.com/comment/44800757
downvote count: 1
type: Question
has body: Is it possible to somehow intercept element.innerHTML = msg; in one particular location and run it: $("#id").text(msg); instead of .innerHTML = msg? http://jsfiddle.net/j8b4zoLt/ UPDATE: I've found the similar question: how to intercept innerHTML changes in javascript? and as I understand the interception innerHTML is not possible.
upvote count: 0
tagged with: javascript
score: -1

http://stackoverflow.com/q/28254375
answer count: 3
linked to: http://stackoverflow.com/q/16245767
tagged with: ng-flow
linked to: http://stackoverflow.com/q/24007735
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28318586
has title: Populate ng-flow with jpeg/jpg as blob
tagged with: angular-resource
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/32821568
has body: I'm currently trying to populate ng-flow with images from my webserver(nodejs http-server), and I found this thread: Populating image files with ng-flow.js from json As you can see in the answer from Aidas, he says that you need to add the data to a blob and then use addFile(blob) But... when I use $resource to GET an url like: http://localhost:8080/3c6397ff-cbb4-4a1c-98b3-5304e02c1bd4.jpg and then take the value from $resource, and adding it to a blob the image is missing - In ng-flow it says that the blob is 15kb - and not the 700kb the actually image is. I've read that the picture could be base64 formatted, but my google dev console says: content-length:780831 content-type:image/jpeg; charset=utf-8 If I take a look at the response data in google dev console, there's alot of questionmarks (it cannot display the character I guess). How do I get the response formatted correctly, so I can add it to ng-flow using the addFile(blob) function?
type: Question
tagged with: blob
possible better answer: http://stackoverflow.com/a/32821568
has answer: http://stackoverflow.com/a/39732622
has answer: http://stackoverflow.com/a/28318586
tagged with: javascript
score: 0

http://stackoverflow.com/a/44118122
score: 4
upvote count: 4
type: Answer
answers question: http://stackoverflow.com/q/28176552
downvote count: 0
has body: I have managed to make it work wonderfully in the following way: $(document).on('ready',function(){ $(function() { var arrLinks = [ {% for u in users %} { nombres: "{{ u.names }} {{u.sur_names}}", email: "{{ u.username }}", documento: {{ u.identificationNumber }}, telefono: {{ u.phone }}, label: '{{ u.names }} {{u.sur_names}} / {{ u.username }} * Doc: {{ u.identificationNumber }} - Cel: {{ u.phone }}' }, {% endfor %} ]; $("input[name=search]").autocomplete({ source: arrLinks }).data("autocomplete")._renderItem = function(ul, item) { return $("&lt;li&gt;").data("item.autocomplete", item).append("&lt;a&gt;" + item.nombres + "&lt;/a&gt;").appendTo(ul); }; }); }); Note: I work with symfony, from the controller I am sending an object with users and in the view (twig) I make a FOR with which I assign the javascript object the data I need. It is important to define in the label all the parameters for which you want to search. Demo image! $(document).on('ready',function(){ $(function() { var arrLinks = [ { nombres: "Fernando León", email: "efleon9@gmail.com", documento: 10695846754, telefono: 3208123307, label: 'Fernando León / efleon9@gmail.com * Doc: 10695846754 - Cel: 3208123307' }, { nombres: "Edgar Molina", email: "fleon@fitpal.co", documento: 736282826, telefono: 30087654637, label: 'Edgar Molina / fleon@fitpal.co * Doc: 736282826 - Cel: 30087654637' } ]; $("input[name=search]").autocomplete({ source: arrLinks }).data("ui-autocomplete")._renderItem = function(ul, item) { return $("&lt;li&gt;").data("ui-autocomplete-item", item).append("&lt;a&gt;" + item.nombres + "&lt;/a&gt;").appendTo(ul); }; }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"&gt;&lt;/script&gt; &lt;input type="text" name="search"&gt;

http://stackoverflow.com/comment/44691119
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28159450
has text: Sorry. Perhaps I Should simply delete this entire question of mine. Seems as though I've opened up pandoras box of issues with the way I am approaching this needed solution.
type: AnswerComment

http://stackoverflow.com/q/28148962
has answer: http://stackoverflow.com/a/28149054
has title: js can not call function name right
type: UnansweredQuestion
tagged with: php
score: -5
has comment: http://stackoverflow.com/comment/44669250
downvote count: 5
has comment: http://stackoverflow.com/comment/44669293
type: Question
has body: I want to make one javascript function, but I cannot call my function name right when i click on it(show_more_in_month_0/1/2). this is my code $i = 0; foreach ($data as $row){ echo ' '; echo ' '; echo $row[0]; echo ' ; echo $row[1]; echo ' '; echo $row[2]; echo ' '; $i ++; } And this is my script, i just want alert my class name after i call right function name $(document).ready(function() { $(".show_more_in_mont_'.$i.'.").click(function(){ alert(show_more_in_mont_'.$i.'); }); });
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44669265
has comment: http://stackoverflow.com/comment/44672907
favorite count: 0

http://stackoverflow.com/a/28248470
score: 52
type: Answer
has body: Add wp_enqueue_script('jquery'); before you enqueue your scripts.&nbsp;
accepted answer of: http://stackoverflow.com/q/28248113
has comment: http://stackoverflow.com/comment/44857437
answers question: http://stackoverflow.com/q/28248113
upvote count: 54
has comment: http://stackoverflow.com/comment/54427825
downvote count: 2
has comment: http://stackoverflow.com/comment/75891717
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/54426845
has comment: http://stackoverflow.com/comment/44857354

http://stackoverflow.com/a/28147429
upvote count: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28147351
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28147351
score: 1
has body: You have to add the script-tag completely with javascript. You cant use javascript variables like that in the HTML page. If you want to add a script-tag dynamicly use this script: var script = document.createElement('script'); //create new tag script.src = "http://analysisTool.js?idtag=123456789&amp;orderid=" + uid;//set the url with your id document.getElementsByTagName('head')[0].appendChild(script);//append the scripttag

return
tags question: http://stackoverflow.com/q/28200117
type: Tag
tag name: return
tags question: http://stackoverflow.com/q/28203132
tags question: http://stackoverflow.com/q/28194243

http://stackoverflow.com/a/28160125
has body: I think you're here after: var myArray = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; for (var i = 1; i &lt; 21; i++){ if (i%3 === 0 &amp;&amp; i%5 === 0){ console.log(myArray[i]+"is FizzBuzz") } else if (i%3 === 0){ console.log(myArray[i]+"is Fizz") } else if (i%5 === 0){ console.log(myArray[i]+"is Buzz") } else { console.log(i) }}
has comment: http://stackoverflow.com/comment/44691818
score: 0
answers question: http://stackoverflow.com/q/28160066
type: Answer

http://stackoverflow.com/comment/44876749
comment on: http://stackoverflow.com/a/28259427
has text: that's what i need exactly thanks a lot. but there's a little problem that, it's repeating that 10 seconds again and again. can you please just make it once time 10 seconds finished and div2 showed up and it must keep it like that. it should not hide the div again and start 10 seconds again etc
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/q/28180330
score: 1
has comment: http://stackoverflow.com/comment/44730468
has comment: http://stackoverflow.com/comment/44729829
has comment: http://stackoverflow.com/comment/44729891
has comment: http://stackoverflow.com/comment/44729900
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44729838
has title: Drag drop in javascript
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28642866
upvote count: 1
has comment: http://stackoverflow.com/comment/44729978
has body: I am trying to make drag drop functionality in javascript. I have almost completed this but problem comes when mousemove event is fired. The element does not comes at pointer's location. I tried a lot of things but could not set it right. Here is the link of my code. I am mentioning my code structure here too: HTML: Randome tet Randome tet Randome tet Randome tet JS: var mouseX = 0, mouseY = 0, elmX = 0, elmY = 0, tempZ = 0, currentElm; $(document).on('mousedown', '.dragable', function(e){ var temp; $(this).addClass('abs'); mouseX = e.clientX; mouseY = e.clientY; temp = +($(this).css('left')); //temp = $(this).offset().left; elmX = null || isNaN(temp) ? 0 : temp; temp = +($(this).css('top')); //temp = $(this).offset().top elmY = null || isNaN(temp) ? 0 : temp; $(this).css({'z-index':'9999'}); currentElm = $(this); document.body.focus(); // prevent text selection in IE document.onselectstart = function () { return false; }; // prevent IE from trying to drag an image $(this).ondragstart = function() { return false; }; // prevent text selection (except IE) return false; }).mouseup('.dragable', function(e){ if(currentElm !== null){ currentElm.css({'z-index' : '1'}); currentElm = null; } }).mousemove('.dragable', function(e){ if(currentElm !== null){ currentElm.css({ left : (elmX + e.clientX - mouseX)+'px', top : (elmY + e.clientY - mouseY)+'px' }); } }); The Dragging item is not setting its position properly. Here is the Link for Codepen One more thing... what should be the condition if I want to check if mouse target is pillers class at mouseup event.
type: Question

http://stackoverflow.com/q/28220550
tagged with: javascript
has comment: http://stackoverflow.com/comment/44804400
downvote count: 0
tagged with: events
has comment: http://stackoverflow.com/comment/44804340
favorite count: 0
has comment: http://stackoverflow.com/comment/44804709
has comment: http://stackoverflow.com/comment/44814224
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44806014
score: 3
has body: Is it considered bad practice to have multiple "onresize" javascript event listeners in a single page? My script currently looks something like that: (...) callFuntion1(); $(window).on('resize', Foundation.utils.throttle(function(e){ callFuntion1(); }, 300)); (...) callFuntion2(); $(window).on('resize', Foundation.utils.throttle(function(e){ callFuntion2(); }, 300)); (...) if(something){ callFuntion3(); $(window).on('resize', Foundation.utils.throttle(function(e){ callFuntion3(); }, 300)); } (...) Should I find a way to factorize the onresize listeners? Can multiple listeners have an impact on a website's performance?
answer count: 0
upvote count: 3
type: Question
tagged with: performance
has comment: http://stackoverflow.com/comment/44804406
has title: Should I avoid multiple onresize listener?
has comment: http://stackoverflow.com/comment/44804541

http://stackoverflow.com/comment/44657655
comment on: http://stackoverflow.com/q/28142938
score: 0
has text: can i ask what you're trying to accomplish? your code looks needlessly complex
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28177271
has comment: http://stackoverflow.com/comment/128004108
type: Answer
has comment: http://stackoverflow.com/comment/91085480
has body: The problem was Autocomplete couldn't render the source for its functioning. You need to set the source of the autocomplete based on the JSON data present using , source: function (request, response) { //data :: JSON list defined response($.map(data, function (value, key) { return { label: value.first_name, value: value.id } })); }, And, I also removed the .data callback from the code. See the working code here
has comment: http://stackoverflow.com/comment/99221885
score: 32
has comment: http://stackoverflow.com/comment/74357380
downvote count: 3
accepted answer of: http://stackoverflow.com/q/28176552
has comment: http://stackoverflow.com/comment/108584965
answers question: http://stackoverflow.com/q/28176552
upvote count: 35
type: AcceptedAnswer

http://stackoverflow.com/q/28245798
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28246942
tagged with: angularjs
has body: http://plnkr.co/edit/F8K66L?p=preview I have a li menu which at 300px goes to display:none, while the mobile_nav button turns on. Now currently in my Controller I'm using this main.js $scope.mobileMenu = function() { var menu = document.getElementById('main_nav'); if (menu.style.display == 'block') { menu.style.display = 'none'; } else { menu.style.display = 'block'; } }; If I open the mobile menu, then close it, it stays closed on a larger view when resized, even though I have display:block in the CSS. Also need the mobile menu to close if an item is clicked inside of it. Tried this, but without any luck index.html = Home About style.css // the button .mobile_nav { display: none; } @media all and (max-width: 300px) { .mobile_nav { display: block; } #main_nav { display: none; } #main_nav li { float: none; margin-bottom 20px; } #main_nav a { width: 100%; } }
tagged with: ng-show
type: AnsweredQuestion
tagged with: angularjs-ng-click
score: 1
upvote count: 1
type: Question
has title: How to Angularize Mobile menu with ng-show & ng-click?
tagged with: javascript
has answer: http://stackoverflow.com/a/28246942

http://stackoverflow.com/comment/44722203
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28176432
has text: have you included fancybox's css file?
type: AnswerComment

http://stackoverflow.com/comment/44665724
type: QuestionComment
score: 1
has text: Include the `/* optional settings */` maybe the error is there `:)`.
comment on: http://stackoverflow.com/q/28147010
type: Comment

http://stackoverflow.com/comment/44693265
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28160914
has text: @d-_-b you can instantiate an `Error` instance and get a stack trace.
score: 0

http://stackoverflow.com/q/28130568
upvote count: 1
linked to: http://stackoverflow.com/q/28131355
has comment: http://stackoverflow.com/comment/44635010
answer count: 1
accepted answer: http://stackoverflow.com/a/28131206
has comment: http://stackoverflow.com/comment/44635044
has title: Retrieving strings in Parse
has comment: http://stackoverflow.com/comment/44635039
has body: I am trying to retrieve two strings from my Parse Customers class. I want to compare these strings (usernameAdmin, and passwordAdmin respectively) with the input field entered by the user, and if they matched it will take them to a specific page. I am taking this approach for a particular reason, and would appreciate feedback. $scope.logIn = function(form) { var Customer = Parse.Object.extend("Customers"); parseAdminUsername = Customer.get('usernameAdmin'); parseAdminPassword = Customer.get('passwordAdmin'); if (form.lusername == parseAdminUsername && form.lpassword == parseAdminPassword) { window.location = 'adminSelect.php' } else { alert('error'); } }; The html code looks as follow: Sign In I receive the following error on console: undefined is not a function at Object.$scope.logIn below is the line parseAdminUsername = Customer.get('usernameAdmin');
has comment: http://stackoverflow.com/comment/44635728
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28131206
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44634883
tagged with: parse-platform
tagged with: angularjs
type: Question

http://stackoverflow.com/a/28253707
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28253668
score: 1
answers question: http://stackoverflow.com/q/28253668
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44867044
has body: $(document).ready(function(){ var list = [1,2,3,4,5,6]; var length = list.length; var i = 0; var ivl = setInterval( function () { if (i &lt; length) { $('#nums').html(list[i]).delay(750); i++; } else { clearInterval(ivl); } }, 750); });
downvote count: 0
has comment: http://stackoverflow.com/comment/44866011

http://stackoverflow.com/q/28170538
score: 0
accepted answer: http://stackoverflow.com/a/28170638
has answer: http://stackoverflow.com/a/28170775
type: Question
has comment: http://stackoverflow.com/comment/44710460
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28170638
has body: I want to validate the text box should allow only numbers and only can type two digit. For example EIN (employee identification number) has only 2 digit and check the typed value is number. I write code for number validation.I have to allow to type only 2 digits. I attached code for number validation var specialKeys = new Array(); specialKeys.push(8); //Backspace function IsNumeric1(e) { var keyCode = e.which ? e.which : e.keyCode var ret = ((keyCode &gt;= 48 &amp;&amp; keyCode &lt;= 57) || specialKeys.indexOf(keyCode) != -1); document.getElementById("error1").style.display = ret ? "none" : "inline"; return ret; }
answer count: 3
tagged with: validation
possible better answer: http://stackoverflow.com/a/28170665
tagged with: javascript
has answer: http://stackoverflow.com/a/28170665
has title: number validation for textbox
has comment: http://stackoverflow.com/comment/44710394

express
tags question: http://stackoverflow.com/q/28159907
tags question: http://stackoverflow.com/q/28174076
tags question: http://stackoverflow.com/q/28179551
tags question: http://stackoverflow.com/q/28258153
tags question: http://stackoverflow.com/q/28172552
tags question: http://stackoverflow.com/q/28253658
tags question: http://stackoverflow.com/q/28217462
tags question: http://stackoverflow.com/q/28266081
tags question: http://stackoverflow.com/q/28274741
tags question: http://stackoverflow.com/q/28273300
tags question: http://stackoverflow.com/q/28254533
tags question: http://stackoverflow.com/q/28157597
tags question: http://stackoverflow.com/q/28150503
tags question: http://stackoverflow.com/q/28182305
tags question: http://stackoverflow.com/q/28227286
tags question: http://stackoverflow.com/q/28225458
tags question: http://stackoverflow.com/q/28161752
tags question: http://stackoverflow.com/q/28196421
tags question: http://stackoverflow.com/q/28210138
tags question: http://stackoverflow.com/q/28238938
tags question: http://stackoverflow.com/q/28250316
tags question: http://stackoverflow.com/q/28196926
tags question: http://stackoverflow.com/q/28162000
tags question: http://stackoverflow.com/q/28205034
tags question: http://stackoverflow.com/q/28152870
tags question: http://stackoverflow.com/q/28231723
tags question: http://stackoverflow.com/q/28174642
tags question: http://stackoverflow.com/q/28242510
tags question: http://stackoverflow.com/q/28220456
tags question: http://stackoverflow.com/q/28262291
tags question: http://stackoverflow.com/q/28123264
tags question: http://stackoverflow.com/q/28191507
tags question: http://stackoverflow.com/q/28234885
tags question: http://stackoverflow.com/q/28175484
tags question: http://stackoverflow.com/q/28122920
tags question: http://stackoverflow.com/q/28192752
tags question: http://stackoverflow.com/q/28269579
tag name: express
tags question: http://stackoverflow.com/q/28196240
tags question: http://stackoverflow.com/q/28163328
tags question: http://stackoverflow.com/q/28183444
tags question: http://stackoverflow.com/q/28202801
tags question: http://stackoverflow.com/q/28183482
tags question: http://stackoverflow.com/q/28267610
type: Tag
tags question: http://stackoverflow.com/q/28198685
tags question: http://stackoverflow.com/q/28160471
tags question: http://stackoverflow.com/q/28186395
tags question: http://stackoverflow.com/q/28124712
tags question: http://stackoverflow.com/q/28145469
tags question: http://stackoverflow.com/q/28266662
tags question: http://stackoverflow.com/q/28156042
tags question: http://stackoverflow.com/q/28247230
tags question: http://stackoverflow.com/q/28199421
tags question: http://stackoverflow.com/q/28132125
tags question: http://stackoverflow.com/q/28254572
tags question: http://stackoverflow.com/q/28202448

http://stackoverflow.com/comment/44708477
type: Comment
has text: Do you always want to replace `[...]` by ` ... `, and `(...)` by `...`? (Except when `(...)` is inside `[...]`)
comment on: http://stackoverflow.com/q/28168844
score: 0
type: QuestionComment

http://stackoverflow.com/a/28250410
accepted answer of: http://stackoverflow.com/q/28250268
upvote count: 2
answers question: http://stackoverflow.com/q/28250268
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: When one click on html submit button, the form values are collected and server request is generated. Depending on request type defined (POST or GET), the data are sent to the server in URL or form format. After request the page is refreshed because the client html code is rendered again. You can build the logic reading the values after server side response received results to client. However, I guess you need in your code to to prevent sending data to the server side each time you click on the button and to make calculations on the client only. There're two ways you could do that: change the type of the button from "submit" to "button". in the oncick event as well as at the end of the function "return false". It prevents from the submit action and sending submit request to server. &lt;input type="submit" onclick="return calc_form()"&gt; then: function calc_form(first, second) { ... return false; ... }
has comment: http://stackoverflow.com/comment/44860678
score: 2

http://stackoverflow.com/a/28245405
answers question: http://stackoverflow.com/q/28245199
score: 0
has body: You need to use jQuery's selector function $. jQuery returns a special jQuery object that provides the method children that you are trying to use. $('.Carousel-Inner').children() Read more about it here: The jQuery Object
type: Answer

http://stackoverflow.com/a/41803992
has body: I have faced this issues in my app, you are trying to call $state.go on an internal ui-view that is not relative to the state ,thats you are facing this problem, so try this : app.run(['$state', '$rootScope', '$timeout', function ($state, $rootScope, $timeout) { $timeout(function() { $state.go('login'); }); }]);
downvote count: 0
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28208893

http://stackoverflow.com/q/28203378
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28203418
has body: I got a class in css : img { position: relative; left: 0; top: 0; } and an img in the HTML body. I can move the img with my JQuery/Javascript code: $('img').animate({left: "-=20"}, 'fast'); Now I want to print out the attribute 'left' from my img class. Any Suggestions how to do that? My window.alert($('img').left) does not work. Thanks
has title: Javascript: Printing class attributes
score: 0
has answer: http://stackoverflow.com/a/28203474
accepted answer: http://stackoverflow.com/a/28203418
type: AnsweredQuestion
tagged with: class-attributes
possible better answer: http://stackoverflow.com/a/28203474
type: Question
answer count: 2

jquery-focusout
type: Tag
tag name: jquery-focusout
tags question: http://stackoverflow.com/q/28156547

http://stackoverflow.com/comment/44713241
has text: Yes it wont wait. It will be executed immediately and it would return the default return value `undefined`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28172010

http://stackoverflow.com/comment/47369952
comment on: http://stackoverflow.com/a/29609898
score: 0
has text: Excellent! I didn't know about the Bezier plugin.
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28236843
has answer: http://stackoverflow.com/a/28239301
has comment: http://stackoverflow.com/comment/44954848
has comment: http://stackoverflow.com/comment/44847969
upvote count: 1
has title: Is there any way around the HTML5 canvas size limitation?
has comment: http://stackoverflow.com/comment/44839326
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44835300
score: 1
has comment: http://stackoverflow.com/comment/44839569
has answer: http://stackoverflow.com/a/28301805
accepted answer: http://stackoverflow.com/a/28301805
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28239301
tagged with: canvas
has comment: http://stackoverflow.com/comment/44848248
has body: I need to draw a dynamically-generated diagram onto the page and have thus far been using a canvas element. Unfortunately, some users have diagrams so large that the resulting canvas exceeds the size limitations of mobile browsers - the result is an empty canvas. I have tried drawing onto smaller tiled canvasses, but this is inefficient as the drawing needs to be done multiple times. I've also tried creating a single large canvas in memory and then using drawImage to slice it up onto smaller tiled canvasses. This fails because the in-memory canvas exceeds maximum canvas size (even though it has not been appended to the DOM). I'm looking for any suggestions on how to get a large dynamic diagram drawn onto the page when it's width/height aren't known in advance. Thanks!
downvote count: 0
linked to: http://stackoverflow.com/q/6081483
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/comment/44619590
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28122503
has text: There is not a column name "download_link" in my database.
score: 0

http://stackoverflow.com/q/28165733
has answer: http://stackoverflow.com/a/28165773
has body: I want to show the text next to radio buttons in another element when the buttons are clicked. My HTML: &lt;p&gt; &lt;input type="radio" value="1" name="General"&gt; I need a simple template &lt;/p&gt; &lt;p&gt; &lt;input type="radio" value="2" name="General"&gt; I need a simple template based &lt;/p&gt; &lt;p&gt; &lt;input type="radio" value="3" name="General"&gt; I need a simple template based type &lt;/p&gt; I want to show the result in an element with the class display, so something like: $('.display').val(); I tried this: $('.display').val($('input[type=radio]:checked').closest('p').html());
accepted answer: http://stackoverflow.com/a/28165773
has comment: http://stackoverflow.com/comment/44701912
possible better answer: http://stackoverflow.com/a/28207895
has answer: http://stackoverflow.com/a/28207895
has comment: http://stackoverflow.com/comment/44701836
downvote count: 1
has title: How to show text besides input tags in jquery
type: AnsweredQuestion
score: -1
type: Question
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/44701989
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/44876642
score: 0
comment on: http://stackoverflow.com/a/28248321
type: AnswerComment
has text: I didn't fully complete the dictionary, as I do not know which pairs of characters will equate to which full characters. You would need to write the dictionary object in the syntax I provided with your character-pairs being on the left side of the : and the translated character on the right. If you wish to put quotes around the character-pairs, that is fine (it won't make any difference to Javascript). And, of course, you must omit the "..." as that will throw a syntax error.
type: Comment

http://stackoverflow.com/a/28254610
has comment: http://stackoverflow.com/comment/44867827
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28254498
type: Answer
answers question: http://stackoverflow.com/q/28254498
upvote count: 1
has body: x.constructor refers to Object (since all object literals have reference to Object assigned to their constructor predefined property). Object.prototype is given a property foo and assigned value of "B". y is object literal, thus it's internal Prototype property (available as __proto__ in some engines) refers to Object.prototype. Due to JavaScripts prototypal inheritance, every time when object's property is requested, and this object does not contain the property, engine looks upward the prototype chain. Thus when accessing y.foo - since y has no property named foo - you are accessing y.Prototype.foo which is exactly Object.prototype.foo.

http://stackoverflow.com/a/28169496
has comment: http://stackoverflow.com/comment/44708926
answers question: http://stackoverflow.com/q/28169279
score: 1
downvote count: 0
has body: Your are calling different function but have same event listener. You need to change your code to this and try: Replace the function rowedit() and rowdelete() with the following code: $(document).ready(function(){ $('#addpurchase tbody').on('click', 'a', function() { var action = $(this).data('action'); //Or you can use var action = $(this).attr('data-action'); var tr = $(this).closest("tr"); var rowindex = tr.index(); if(action == 'edit'){ //YOUR EDIT CODE }else{ //YOUR DELETE CODE } }); }); and change below line in your addproduct() function: productdata[8] = "&lt;a href='#' data-action='edit'&gt; Edit &lt;/a&gt; / &lt;a href='#' data-action='delete'&gt; Delete &lt;/a&gt;" ])
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44708960
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28169279

http://stackoverflow.com/a/54405254
has body: var viewModel; $(function () { var viewModel = new DynamicModelLoading(JSON.parse('@Html.Raw(Json.Encode(Model))')); ko.applyBindings(viewModel); });
answers question: http://stackoverflow.com/q/28222785
score: 0
type: Answer

http://stackoverflow.com/comment/44745047
has text: what is `cardContainer`?
type: QuestionComment
comment on: http://stackoverflow.com/q/28188387
score: 2
type: Comment

http://stackoverflow.com/q/28226156
score: 0
answer count: 1
tagged with: three.js
tagged with: javascript-objects
has answer: http://stackoverflow.com/a/28243186
has title: Extending Physijs.Mesh
tagged with: physijs
type: AnsweredQuestion
has body: I am working with Physijs to create a simple fps. Without Physijs I would create a Player object and use the code below to extend the THREE.Mesh class. function Player() { THREE.Mesh.apply(this, arguments); ... } Player.prototype = Object.create(THREE.Mesh.prototype); Then I would instantiate a Player and add the camera to it for first person vision. However I would have to program all of the collision detection for Player so he wouldn't fall through the floor. I can use new Physijs.BoxMeshfor the floor, but what about the player? How do I create a 'Player' class that has physics applied to it using Physijs? I tried something like... Physijs.Mesh.apply(...)... and Object.create(Physijs.Mesh.prototype), but that doesn't work. Thank you for any feedback.
type: Question
accepted answer: http://stackoverflow.com/a/28243186
tagged with: javascript

http://stackoverflow.com/q/28203363
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
upvote count: 8
type: Question
has body: I was looking at this post How to get the background color of an element using javascript? which confirmed that if you do div.style.color you will get returned the color applied to the div. However this only seems to return a result if the style is applied inline on the element? How do you return the style applied to the element when the style is applied through a style sheet (or in tags) rather than directly inline? See example below. console.log(document.getElementById('content').style.backgroundColor); console.log(document.getElementById('content').style.color); #content { background-color: #000000; display: inline-block; height: 100px; width: 100px; } &lt;div id="content" style="color:red;"&gt;&lt;/div&gt; console.log(document.getElementById('content').style.backgroundColor); returns nothing console.log(document.getElementById('content').style.color); returns red
tagged with: javascript
has answer: http://stackoverflow.com/a/28203395
accepted answer: http://stackoverflow.com/a/28203395
has title: Get current applied style with JS
answer count: 1
score: 8
favorite count: 0
linked to: http://stackoverflow.com/q/1887104

http://stackoverflow.com/comment/44783289
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28209289
type: AnswerComment
has text: Thnx a lot , can u tell me how can i access with using (function () { printUserInformation ..... })

http://stackoverflow.com/comment/44628543
type: QuestionComment
has text: downvote my post will not work, i have friends here :)
comment on: http://stackoverflow.com/q/28127036
type: Comment
score: 0

http://stackoverflow.com/a/28271994
answers question: http://stackoverflow.com/q/28271904
upvote count: 6
score: 4
has body: Use this awesome library. Moment JS For your case it would be some thing link var dateString = 'Mon Feb 02 2015 05:18:44 GMT+0000'; var date = new Moment(dateString); alert(date.format('MM/dd/YYYY'));
downvote count: 2
type: Answer

http://stackoverflow.com/a/28189050
answers question: http://stackoverflow.com/q/28187924
type: Answer
has comment: http://stackoverflow.com/comment/44758885
has comment: http://stackoverflow.com/comment/44757858
has comment: http://stackoverflow.com/comment/44757158
accepted answer of: http://stackoverflow.com/q/28187924
has comment: http://stackoverflow.com/comment/44748570
has comment: http://stackoverflow.com/comment/44758097
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44755914
has comment: http://stackoverflow.com/comment/44757396
has comment: http://stackoverflow.com/comment/44771429
has comment: http://stackoverflow.com/comment/44771293
has comment: http://stackoverflow.com/comment/44758510
has body: Your data service is injected as service but you have not appended the functions to this.rather you have returned it as part of literal like u do in factory
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44771766

http://stackoverflow.com/comment/44742375
has text: Where have you used AJAX? you are submiting the code to "userInfo.php". The page will compulsorily refresh.
score: 2
type: Comment
comment on: http://stackoverflow.com/q/28186884
type: QuestionComment

http://stackoverflow.com/a/28155821
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44687199
has comment: http://stackoverflow.com/comment/44683132
score: 3
answers question: http://stackoverflow.com/q/28155421
upvote count: 3
has comment: http://stackoverflow.com/comment/44683353
has body: Have you tried using just window.location = 'page2.html?uname=mustafa'; instead of using .href? This should preserve the querystring. Worked for me in Chrome and FF with .href just fine, but I used absolute URLs: window.location = 'http://google.com/?test=blah&amp;foo=bar'; window.location.href = 'http://google.com/?test=blah&amp;foo=bar';

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28265270
tags question: http://stackoverflow.com/q/28203002
tags question: http://stackoverflow.com/q/28203366
tags question: http://stackoverflow.com/q/28165728
type: Tag
tags question: http://stackoverflow.com/q/28142531
tags question: http://stackoverflow.com/q/28149899
tags question: http://stackoverflow.com/q/28197316

http://stackoverflow.com/comment/44724746
type: Comment
type: QuestionComment
has text: And `newJson` is generated correctly, right? Then we need to see how you are using it. Most likely it's a binding issue somewhere.
score: 0
comment on: http://stackoverflow.com/q/28177636

http://stackoverflow.com/comment/47857627
type: Comment
score: 0
has text: @user3877230, hi. I decided not to use canvas.
type: QuestionComment
comment on: http://stackoverflow.com/q/28276179

http://stackoverflow.com/q/28151422
has comment: http://stackoverflow.com/comment/44674425
tagged with: php
has answer: http://stackoverflow.com/a/28151509
has comment: http://stackoverflow.com/comment/44674198
has comment: http://stackoverflow.com/comment/44674320
has comment: http://stackoverflow.com/comment/44674376
has comment: http://stackoverflow.com/comment/44674242
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I'm doing a redesign for a site and right now my goal is to replace an old way of opening a certain window with a new one (jQuery). This is how it looked before: https://i.sstatic.net/WGp5R.png and this is how it looks now: https://i.sstatic.net/ZxSxx.png .Everything looks good, but there is a problem. The jQuery dialog works only for the first item in every page, If I press on another item, other than the first one, nothing happens. Also, If I continue opening the jQuery dialog it starts showing all the items in the page one by one (Example: I press on the first item and it opens the jQuery dialog with the contents of the first item, I press on the first item again but now it shows the contents of the second item and so on and so forth, it shows them one by one for some reason). The php code: // SHOP ITEM LARGE //This is how it worked before // print '&lt;a href="'; // print "javascript:regular('pages/item_large.php?shop=".$item-&gt;webshopMenu."&amp;amp;nr=".$item-&gt;id."');"; // print '"&gt;&lt;img style="margin-top:5px;margin-bottom:0; padding-bottom:0px;" border="0" src="'.$img.'" alt="'.$item-&gt;Naam.'" '.$image_size.'&gt;&lt;/a&gt;'; // print '&lt;br&gt;&lt;small&gt;Artikelnr. : '.$item-&gt;Artikelnr.'&lt;/small&gt;&lt;/div&gt;'."\n"; //This is how I'm trying to do it now print '&lt;a id="save" href="'; print '"&gt;&lt;img style="margin-top:5px;margin-bottom:0; padding-bottom:0px;" border="0" src="'.$img.'" alt="'.$item-&gt;Naam.'" '.$image_size . "&lt;/a&gt;"; print '&lt;br&gt;&lt;small&gt;Artikelnr. : ' . $item-&gt;Artikelnr . '&lt;/small&gt;&lt;/div&gt;' . "\n"; ?&gt; &lt;div style="display: none" id="dialog"&gt; &lt;?php echo "&lt;iframe src='pages/item_large.php?shop=" . $item-&gt;webshopMenu . "&amp;amp;nr=" . $item-&gt;id . "'" . "width='100%' height='100%' frameborder='0'&gt;&lt;/iframe&gt;" ?&gt; &lt;/div&gt; jQuery code: (function() { $('#save').click(function(event) { event.preventDefault(); $('#dialog').dialog({ modal: true, scrollable: false, d…
score: 0
has comment: http://stackoverflow.com/comment/44674458
has title: Problems with jQuery dialog
has comment: http://stackoverflow.com/comment/44674344
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28151619

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28198391
tag name: webbrowser-control

http://stackoverflow.com/a/28234290
score: 0
has comment: http://stackoverflow.com/comment/44835657
type: Answer
has body: You can use following functions to set and get values of cookies in javascript: &lt;script&gt; function ll_set_cookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function ll_get_cookie(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 ""; } &lt;/script&gt; When you want to set cookie just call the function like ll_set_cookie('Q1','A','1') Where Q1 is your question number A is the selected answer And cookie will be stored for 1 day Then on the final page you can get the answer of each question like: ll_get_cookie('Q1');
answers question: http://stackoverflow.com/q/28212301

http://stackoverflow.com/comment/44878749
comment on: http://stackoverflow.com/a/28250706
type: Comment
score: 0
type: AnswerComment
has text: I want to use chart like I have attached as a Image. I am not able to find out one. If you have any idea how to use that chart please suggest....

http://stackoverflow.com/comment/44904020
score: 0
type: QuestionComment
has text: Are any errors showing on the browser console?
type: Comment
comment on: http://stackoverflow.com/q/28274463

http://stackoverflow.com/comment/44725752
type: Comment
type: QuestionComment
has text: What made you think [`document.getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/document.getElementById) returns the value of the input?
score: 1
comment on: http://stackoverflow.com/q/28178270

http://stackoverflow.com/comment/44859290
type: Comment
type: QuestionComment
has text: Subclassing natives is problematic. Take look at [this article](http://speakingjs.com/es5/ch28.html) or others out there. It might be possible with ECMA6, but I haven't looked into that.
comment on: http://stackoverflow.com/q/28249456
score: 0

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/28122964
type: Tag

http://stackoverflow.com/a/37699339
has comment: http://stackoverflow.com/comment/103816220
answers question: http://stackoverflow.com/q/28211174
score: 0
has body: If you want just selected text from context menu than you can do it by following code function getClickHandler() { return function(info, tab) { // info.selectionText contain selected text when right clicking console.log(info.selectionText); }; }; /** * Create a context menu which will only when text is selected. */ chrome.contextMenus.create({ "title" : "Get Text!", "type" : "normal", "contexts" : ["selection"], "onclick" : getClickHandler() });
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/103566886
downvote count: 2

http://stackoverflow.com/a/28273979
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28261658
answers question: http://stackoverflow.com/q/28261658
type: Answer
has comment: http://stackoverflow.com/comment/64370308
score: 4
has body: Well, since no one gave this a shot I just had to exhaust all my resources and find a solution myself. The answer was here: http://www.datatables.net/examples/data_sources/server_side.html Inside the "Server-side script" tab, at the very bottom, they include the SSP class. Since I'm using WordPress here, I wrongly assumed I wouldn't need that class, because my queries are via $wpdb or other WP core functions, plus, I was reading all the documentation online and didn't even think of looking into that class - why would I, if I was following the rest of the instructions that were supposed to work. Long story short, I did some modifications to the SSP class to suit my needs, then used pretty much the same setup the example pages have, and finally got my datatables paginating correctly. Just as reference, I was trying to return an array like the following to datatables: array( "sEcho" =&gt; intval( $_GET['sEcho'] ), "iTotalRecords" =&gt; $iTotal, "iTotalDisplayRecords" =&gt; $iTotal, "aaData" =&gt; $my_data ); When it turned out I need to return the array like this: array( "draw" =&gt; intval( $request['draw'] ), "recordsTotal" =&gt; intval( $recordsTotal ), "recordsFiltered" =&gt; intval( $recordsFiltered ), "data" =&gt; $my_data ); Probably it's just me, but datatables although a nice working plugin, really needs more work on the documentation. I found some parameters were found one way in one place and another way elsewhere - just like the example above.
upvote count: 4

http://stackoverflow.com/q/28182279
has answer: http://stackoverflow.com/a/28182404
has comment: http://stackoverflow.com/comment/44734077
has comment: http://stackoverflow.com/comment/44733846
has answer: http://stackoverflow.com/a/28182342
has body: Whenever I define a function in javascript, I frequently name the place holder what I would like them to be. This leads to the problem that, declaring those arguments as variables in the function makes them have the same name. Is this a problem (because I do not often see it done). For example: var words = 'Hello there'; var talk = function talk (words) { // Realizing this does nothing, I am leaving it in because other answers refer to it. var words = words; //I suppose this could also be this.words = words? console.log(words); } talk(words); //To log "hello there" This is an extreme example, but in many instances it seems like this would make more sense than using similar and not quite correct words (like var letters = words)
has title: Is it bad form to treat argument names the same as variable names in javascript?
possible better answer: http://stackoverflow.com/a/28182342
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44734045
accepted answer: http://stackoverflow.com/a/28182404
type: Question
has comment: http://stackoverflow.com/comment/44733870
answer count: 2
has comment: http://stackoverflow.com/comment/44733883
tagged with: javascript
has comment: http://stackoverflow.com/comment/44733889
has comment: http://stackoverflow.com/comment/44733845
score: 0

http://stackoverflow.com/comment/44629096
comment on: http://stackoverflow.com/a/28126744
type: Comment
has text: Thanks for your detailed answer Ben. It helps me to understand how to write regex in js, but are you sure about it? the date 2015-02-01 09:40 (which is valid date) not accepted by your regex.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44794345
comment on: http://stackoverflow.com/a/28215331
type: AnswerComment
score: 0
type: Comment
has text: Thisis what I have written : <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> Can you please check if there is a difference in what you have written?

http://stackoverflow.com/q/28197581
has answer: http://stackoverflow.com/a/28197672
accepted answer: http://stackoverflow.com/a/28197672
has title: RegEx to get ALL Strings between two Strings
type: AnsweredQuestion
score: 1
has body: I seem to have a love/hate relationship with RegEx in that I love how incredibly powerful it is, but at the same time, I don't quite understand all of the nuances of it yet. I've got rather lengthy JSON feed that I need to parse and capture ALL of the matches between two specific strings. I've included a link to the regex101.com example with a few of the JSON results. regex101.com Example I'm trying to match every string between each /content/usergenerated and /jcr:content ... I guess what I should really be trying to match is a string that starts with /content/webAppName/en/home and ends before /jcr:content The path that I care about will always start with /content/webAppName/en/home
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44765253
has answer: http://stackoverflow.com/a/28198242
type: Question
has comment: http://stackoverflow.com/comment/44761902
possible better answer: http://stackoverflow.com/a/28197659
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/28197659
upvote count: 1
tagged with: regex
has comment: http://stackoverflow.com/comment/44761693

http://stackoverflow.com/a/50942936
type: Answer
has comment: http://stackoverflow.com/comment/88883280
answers question: http://stackoverflow.com/q/28148502
score: 0
has body: I had the same issue, I know this is an old thread but want to post my solution anyway. I needed to override the functions in swiper.js. update: function(event) { if (this.active) { if (!this.dragging) this.dragging = true; this.draw(event); if (Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); } }, draw: function(event) { var pointer = [Event.pointerX(event), Event.pointerY(event)]; if(navigator.userAgent.match(/Android/i)){ pointer = [parseInt(event.targetTouches[0].clientX),parseInt(event.targetTouches[0].clientY)]; } var offsets = Position.cumulativeOffset(this.track); pointer[0] -= this.offsetX + offsets[0]; pointer[1] -= this.offsetY + offsets[1]; this.event = event; this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] )); if (this.initialized &amp;&amp; this.options.onSlide) this.options.onSlide(this.values.length&gt;1 ? this.values : this.value, this); }, And this fixed my issue

http://stackoverflow.com/q/28150704
has body: Im using picturefill 2.0 and the picture element with some dynamic urls. &lt;picture alt="&lt;?php the_title(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt; &lt;source srcset="&lt;?php echo $tablet; ?&gt;, &lt;?php echo $tablet; ?&gt; 2x" media="(max-width: 950px)"&gt; &lt;source srcset="&lt;?php echo $laptop; ?&gt;, &lt;?php echo $laptop; ?&gt; 2x" media="(max-width: 1440px)"&gt; &lt;img srcset="&lt;?php echo $desktop; ?&gt;, &lt;?php echo $desktop; ?&gt; 2x"&gt; &lt;/picture&gt; I have created an image that is twice the size and used if I detect a retina display via a cookie. If no retina is detected then those variables are just the normal sized images. The problem I'm having is that non-retina macs are loading the &lt;?php echo $desktop; ?&gt; 2x image from the picture element. If I remove the 2x option from the picture element images load fine. Shouldn't that image only be loaded by devices with retina displays?
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Why do non-retina macs load the 2x version of a picture element?
tagged with: retina-display
tagged with: macos
has answer: http://stackoverflow.com/a/29281550
upvote count: 1
tagged with: picturefill
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44732857

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/28131363
type: Tag

http://stackoverflow.com/comment/44841485
score: 0
comment on: http://stackoverflow.com/q/28240111
type: QuestionComment
type: Comment
has text: Note: `ar.join()` does nothing useful in your above code. What did you expect it to do?

http://stackoverflow.com/a/28125686
has body: Value urlm is assigned outside the click event. Please load urlm in this click event, in other words, copy the line in the click event var urlm = event.target.href; Since urlm is loaded outside the click event, the value in urlm might be different at the time the click event happened. Your click event could look like document.getElementsByTagName("a")[i].addEventListener('click', function(event){ var urlm = event.target.href; alert(urlm); ajaxpagefetcher.load("ajax-div",urlm, true); }, false);
answers question: http://stackoverflow.com/q/28125432
score: 0
type: Answer

http://stackoverflow.com/q/28199712
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28204375
has comment: http://stackoverflow.com/comment/44766716
has title: Text is clipped when split between multiple divs
score: 1
tagged with: css
has comment: http://stackoverflow.com/comment/44790145
has comment: http://stackoverflow.com/comment/44799681
upvote count: 1
has comment: http://stackoverflow.com/comment/44766768
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44766318
accepted answer: http://stackoverflow.com/a/28204375
has body: The script in this fiddle takes a long text and breaks it up in different divs. It does that by cloning the whole text in each div and incrementing the margin for each page so that only the required text is displayed. Like so: for (var i = 2; i &lt; page_no + 1; i++) { $("#stuff").append("&lt;div id='page" + i + "' class='mydiv'&gt;&lt;/div&gt;"); var copy = $("#page1").clone().attr("id", "onecopy").css({ "margin-top": '-' + (214 * (i - 1)) + 'px', "height": (214 * 2 * (i - 1)) + 'px' }); $("#page" + (i)).append(copy); } The problem is that the text gets 'clipped' by the overflow/hidden property. Is there a way so that the first line on a page is 'truncated' if clipped and that the last line is displayed fully if it is clipped? Any workaround this most annoying of issues would be greatly appreciated.
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28191373
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44750766
tagged with: angularjs
tagged with: d3.js
type: UnansweredQuestion
upvote count: 1
has body: I am writing one Angularjs app. I am using MEAN stack with Grunt. I have written one directive that uses d3 library. I have d3.js file in the following location: /client/app/lib/d3.js The file is automatically included in the index.html and it runs fine in development mode. But when I run it in production mode I get the following error: Uncaught ReferenceError: d3 is not defined Then I did some R&amp;D and found that if any java script file is included with the following syntax it gives same error: !function foo() { var myd3 = {}; ... ... ... this.myd3 = myd3; }(); The above code will give error: Uncaught ReferenceError: myd3 is not defined
score: 1
has title: How to include d3.js in angularjs app?
has answer: http://stackoverflow.com/a/28191884
type: Question
downvote count: 0

http://stackoverflow.com/comment/44942242
has text: @ThomasM.Tveten check this [demo](http://plnkr.co/edit/vtBKNB?p=preview), then you can have an idea how to send messages between different emails.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28208585

http://stackoverflow.com/a/31842566
type: Answer
answers question: http://stackoverflow.com/q/28123985
upvote count: 15
has body: There actually another option that I find "cleaner". In the object passed to the show method you can also define a css class for the popup, so you can use it to override the default ionic styles. Specifically for your use case: .popup-vertical-buttons button { min-width: 100%; margin-bottom: 5px; } .popup-vertical-buttons .popup-buttons { display: block; } and in the object use pass to the show method add: cssClass: "popup-vertical-buttons"
score: 15
downvote count: 0

http://stackoverflow.com/comment/44857986
has text: @ArunPJohny The question asks how it's working; if there weren't a variable called `userNameTxt`, then it wouldn't be working.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28248809

http://stackoverflow.com/comment/44639236
has text: The library is included properly. It works for my other slideshow that is on the webpage. It looks like the timer is working, but not the onClick.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28133349

http://stackoverflow.com/comment/44715317
score: 0
comment on: http://stackoverflow.com/q/28172508
type: Comment
type: QuestionComment
has text: Prusse, I have updated my question, please let us know about this pattern style.

http://stackoverflow.com/comment/44869660
has text: No, i need to implement it on the app!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28253438

http://stackoverflow.com/comment/44756127
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28193926
has text: I can see an understand it now. thank u ( : will use it in another case, got the solution that I wanted from Tambo in the answer 2

http://stackoverflow.com/comment/44879863
type: QuestionComment
comment on: http://stackoverflow.com/q/28261363
has text: Javascript and jQuery can only get an element once it exists.
score: 2
type: Comment

http://stackoverflow.com/a/28273985
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/44904998
has comment: http://stackoverflow.com/comment/44905348
accepted answer of: http://stackoverflow.com/q/28273846
downvote count: 0
answers question: http://stackoverflow.com/q/28273846
has body: Make sure your settings are correct, if you have a single image by default owl will not work, as it requires more than one image to display the carousel.
score: 4
has comment: http://stackoverflow.com/comment/44903653
has comment: http://stackoverflow.com/comment/44905160
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44905505

http://stackoverflow.com/q/28237624
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44836740
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm using AngularJS with UI Bootstrap to display a form in a modal dialog. However, any input loses focus when the scroll bar is clicked. This happens if the scroll bar is associated with a div or with the window. If the text input was not inside a modal then it maintains focus during scroll. An example can be found at http://plnkr.co/edit/uaXiT1NedWjUm2DOKyrD?p=preview There is nothing special about the input, it's as simple as can be &lt;input type="text" id="textinput" name="textinput"/&gt; Is there a way to maintain focus whilst the user scrolls? Thanks Chris
has answer: http://stackoverflow.com/a/28239141
has comment: http://stackoverflow.com/comment/44836675
tagged with: http://stackoverflow.com/tag/html
has title: Textbox loses focus in modal on scroll
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/44748570
type: AnswerComment
comment on: http://stackoverflow.com/a/28189050
type: Comment
has text: thanks for your input. What would you suggest doing? should I just write this.getUserFreeStatus
score: 0

http://stackoverflow.com/q/28170995
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/27917218
has answer: http://stackoverflow.com/a/28171197
upvote count: 0
has comment: http://stackoverflow.com/comment/44711490
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: -3
downvote count: 3
has body: I have this working piece of code that is repeated multiple times. &lt;div ng-controller="MyCtrl"&gt; &lt;div ng-repeat="item in test{{c}}.collection"&gt; {{ item.hwTypeName }} &lt;/div&gt; &lt;/div&gt; and below is the code in controller for this function MyCtrl($scope) { $scope.searchParameters = {userName: '', userEmail: ''}; var c=123; var test="test"+c $scope[test].collection = [{"ticketHardwareId":3817987,"requestId":3854951,"hwId":64543,"hwPrice":0,"assetId":"98ifgh","hwTypeName":"HW Type-1"}] } But this is not working,what could be the issues please help Fiddle Link :http://jsfiddle.net/sLqpL29b/1/
type: Question
has title: Angularjs with dynamic model in ng-repeat

http://stackoverflow.com/a/28182256
has comment: http://stackoverflow.com/comment/44770633
downvote count: 0
has comment: http://stackoverflow.com/comment/44773250
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28181541
has body: Your CSS is not being applied correctly because you have multiple elements with the same ID. Reference: http://www.w3schools.com/tags/att_global_id.asp "The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document)." You have this in your sample HTML &lt;li&gt; &lt;div id="slides" class="bkgd1"&gt; &lt;h1 class="fade"&gt;We Deliver Your Trust&lt;/h1&gt; &lt;h1 class="fade"&gt;Intermodal Drayage&lt;/h1&gt; &lt;h2 class="fade"&gt;Centrally Located Terminals&lt;/h2&gt; &lt;h2 class="fade"&gt;9 Locations Covering North America&lt;/h2&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div id="slides" class="bkgd2"&gt; &lt;h1 class="fade"&gt;Rail &amp;amp; Steamship Interchange&lt;/h1&gt; &lt;h2 class="fade"&gt;Fully Customs Bonded&lt;/h2&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div id="slides" class="bkgd3"&gt; &lt;h1 class="fade"&gt;Dedicated Fleet &amp;amp; Preferred Network&lt;/h1&gt; &lt;h2 class="fade"&gt;Real Time Dispatch Technology&lt;/h2&gt; &lt;h2 class="fade"&gt;Instant Proof of Delivery&lt;/h2&gt; &lt;/div&gt; &lt;/li&gt; And this in your CSS #slides h1 Change these ID's to classes (like this) &lt;div class="slides bkgd1"&gt; &lt;div class="slides bkgd2"&gt; &lt;div class="slides bkgd3"&gt; And change your CSS selectors accordingly .slides h1 And then it should work. More Detail FlexSlider creates clones of your &lt;div&gt; elements to allow for smooth cycling and repeating. When it creates the clones, it copies the ID from the original and appends "_clone" to the end of it. This is actually what you see when you go back to the first slide after cycling through. Therefore, your CSS styles (#slides h1 etc) are not being applied. Further, it is not enough to simply add #slides h1, #slides_clone h1 because of the first thing I mentioned in this answer. IDs must be unique.
has comment: http://stackoverflow.com/comment/44772397

http://stackoverflow.com/q/28186053
accepted answer: http://stackoverflow.com/a/28225388
upvote count: 0
tagged with: angularjs
downvote count: 2
type: Question
type: AnsweredQuestion
tagged with: protractor
tagged with: automation
has comment: http://stackoverflow.com/comment/44778874
has body: If remember me checkbox is checked while login, browser should remember user credentials. Website homepage should load directly for next time. If remember me checkbox is unchecked while login, browser should not remember user credentials. Website should go to login page for next time. It will be helpful to know how to implement these test case with protractor.
score: -2
answer count: 1
tagged with: javascript
favorite count: 0
has title: Remember me checkbox test case for login functionality using protractor
has answer: http://stackoverflow.com/a/28225388

http://stackoverflow.com/q/28129918
answer count: 1
has body: Plnkr: http://plnkr.co/edit/6xe46opL2kpgQrf7VaEu?p=preview I have a ng-click="switchCurreny() function that I'm trying to get working on an block of HTML that is placed inside of another block of HTML that is embedded on the page from my directive. My app-main controller that places another block of HTML into the directive placed HTML, also contains the ng-click function I'm trying to get working: var app = angular.module('app-main', ['ngAnimate', 'wallet-directives']) .controller('MainCtrl', ['$scope', '$sce', function($scope, $sce) { var vm = $scope; var currency = 'USD'; vm.modal = false; vm.modal_send = false; vm.modalActive = false; // HTML to be placed inside of directive placed HTML in var send_html = ' '+currency+' '; // Open the modal, then place send_html into modal_bind: vm.openModal = function($event) { vm.modal = true; // show modal vm.modal_send = true; // show modal_send vm.modal_bind = $sce.trustAsHtml(send_html); // stick send_html inside of modal_bindd } vm.closeModal = function() { vm.modal = false; vm.modal_send = false; }; // ng-click function inside of send_html: vm.switchCurreny = function() { console.log('clicked'); if (currency === 'USD') { currency = 'BTC'; } else { currency === 'USD'; } }; }]); My Directive with the Modal HTML (function() { var app = angular.module('wallet-directives', []) .directive('walletModals', function () { return { restrict: 'E', template: ' The Modal, button below: ' }; }); })(); HTML
accepted answer: http://stackoverflow.com/a/28130225
upvote count: 1
tagged with: javascript
has title: How to bind ng-click to a HTML block inserted inside of a directive embedded HTML block
tagged with: angularjs-scope
type: AnsweredQuestion
tagged with: ng-bind-html
has answer: http://stackoverflow.com/a/28130225
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question

http://stackoverflow.com/a/28244461
answers question: http://stackoverflow.com/q/28243053
has body: You have an issue with execution order. JS will run those two block simultaneously. You can do this synchronously as follows: var sum = 0; $('.revenue').each(function(index, value) { //Remove the first "header element from sum if(index !== 0) { sum += parseInt($(this).html(), 10); } //Remove the class if you still need to else { $(this).removeClass('revenue'); } }); console.log(sum); Here is a fiddle: http://jsfiddle.net/a14rva0m/2/ Or you could do this with some crazy callback magic.
score: 0
type: Answer

http://stackoverflow.com/q/28244899
has comment: http://stackoverflow.com/comment/44852743
upvote count: 1
has comment: http://stackoverflow.com/comment/44850750
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44853502
has answer: http://stackoverflow.com/a/28256726
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/44850511
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44853129
favorite count: 0
has comment: http://stackoverflow.com/comment/44851210
linked to: http://stackoverflow.com/q/16385278
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28256726
has title: Angularjs $http.get doesn't call the callback
has comment: http://stackoverflow.com/comment/44852080
has comment: http://stackoverflow.com/comment/44853540
has comment: http://stackoverflow.com/comment/44851360
has comment: http://stackoverflow.com/comment/44850486
has comment: http://stackoverflow.com/comment/44853515
has body: I do the $http.get request as soon as my javascript loaded, it works fine in 90% percent of cases, however, sometimes it just dont call the success or error callback, I'm not sure if the request is actually sent or it just doesn't call the callback, it's weird because it works good in 90% of cases, and 100% if I run it on my own computer, if I put this onto remote server, this case will happen... $scope.load = function(){ console.log("Sending request at "+Date()); $http.get(requestUrl). success(function(data, status, headers, config) { console.log("Loading Question Succeed"); $scope.Content = data.Html; data = data.Data; }). error(function(data, status, headers, config) { console.log("Loading Question Failed"); }); }; $timeout($scope.load);
score: 1

http://stackoverflow.com/comment/44888526
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28265722
has text: If this is specifically for an app and not for a mobile site, then you can send a special header to the remote host, who can remove their referrer protection for images where the header is received. Would they be willing to implement that on their side? If they use Apache, I expect some `mod_rewrite` rules will do this.

http://stackoverflow.com/a/28168092
has body: Vanilla Leaflet does not work in node. I've made a wrapper here: https://github.com/jieter/leaflet-headless
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28167343
has comment: http://stackoverflow.com/comment/44709673
answers question: http://stackoverflow.com/q/28167343
upvote count: 2
type: Answer
score: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28187136
has body: i try to login with facebook in firebase using java script and html. i also create a facebook application and set app secret and app id in firebase dashbord. and all the other setting in facebook app that firebase said in their doc but im getting this. im getting Login Failed! Error: There are no login transports available for the requested method.code: "TRANSPORT_UNAVAILABLE"message: "There are no login transports available for the requested method."stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }proto: dconstructor: function Error() { [native code] }message: ""name: "Error"toString: function toString() { [native code] }proto: Object
tagged with: firebase
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/35282690
upvote count: 3
has comment: http://stackoverflow.com/comment/44804549
accepted answer: http://stackoverflow.com/a/28220815
has title: getting stuck ,Log in with facebook with firebase
type: Question
downvote count: 0
possible better answer: http://stackoverflow.com/a/28199709
tagged with: javascript
has comment: http://stackoverflow.com/comment/44765597
has answer: http://stackoverflow.com/a/28199709
has comment: http://stackoverflow.com/comment/44803679
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28220815
favorite count: 0
linked to: http://stackoverflow.com/q/28158714

mysql
tags question: http://stackoverflow.com/q/28226918
tags question: http://stackoverflow.com/q/28178799
tags question: http://stackoverflow.com/q/28133804
tags question: http://stackoverflow.com/q/28206497
tags question: http://stackoverflow.com/q/28122750
tags question: http://stackoverflow.com/q/28213575
tag name: mysql
tags question: http://stackoverflow.com/q/28200083
tags question: http://stackoverflow.com/q/28197441
tags question: http://stackoverflow.com/q/28224543
tags question: http://stackoverflow.com/q/28182666
tags question: http://stackoverflow.com/q/28262285
tags question: http://stackoverflow.com/q/28184170
tags question: http://stackoverflow.com/q/28122947
tags question: http://stackoverflow.com/q/28141734
tags question: http://stackoverflow.com/q/28174459
tags question: http://stackoverflow.com/q/28174502
tags question: http://stackoverflow.com/q/28225792
tags question: http://stackoverflow.com/q/28275954
tags question: http://stackoverflow.com/q/28261771
tags question: http://stackoverflow.com/q/28274552
tags question: http://stackoverflow.com/q/28140105
tags question: http://stackoverflow.com/q/28240231
tags question: http://stackoverflow.com/q/28207744
type: Tag
tags question: http://stackoverflow.com/q/28122120
tags question: http://stackoverflow.com/q/28177302
tags question: http://stackoverflow.com/q/28276101
tags question: http://stackoverflow.com/q/28234832
tags question: http://stackoverflow.com/q/28222332
tags question: http://stackoverflow.com/q/28177117
tags question: http://stackoverflow.com/q/28125555
tags question: http://stackoverflow.com/q/28167215
tags question: http://stackoverflow.com/q/28208907
tags question: http://stackoverflow.com/q/28267138
tags question: http://stackoverflow.com/q/28202866
tags question: http://stackoverflow.com/q/28229832
tags question: http://stackoverflow.com/q/28176089
tags question: http://stackoverflow.com/q/28273403
tags question: http://stackoverflow.com/q/28176225
tags question: http://stackoverflow.com/q/28125014
tags question: http://stackoverflow.com/q/28276402
tags question: http://stackoverflow.com/q/28156103
tags question: http://stackoverflow.com/q/28170829
tags question: http://stackoverflow.com/q/28230205

http://stackoverflow.com/comment/44825768
has text: When I place a return false; like I write before, my link dont work it just refersh my actual page.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28219934

http://stackoverflow.com/q/28166797
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28169698
type: AnsweredQuestion
has body: Using following code i ma calling a modal window. I am using jquery .toggle() method to hide and show some portion of modal window based on a checkbox selection. $(document).ready(function() { function ShowSaveEventForm(start, end, allDay) { var month = start.getMonth() + 1 + ""; if (month.length == 1) { month = "0" + month; } var date = start.getDate() + ""; if (date.length == 1) { date = "0" + date; } var year = start.getFullYear(); var hours = start.getHours(); var sec = start.getSeconds(); var msec = start.getMilliseconds(); var stdate = new Date(year, month, date, hours, sec, msec); var sdate = year + "-" + month + "-" + date; var month = end.getMonth() + 1 + ""; if (month.length == 1) { month = "0" + month; } var date = end.getDate() + ""; if (date.length == 1) { date = "0" + date; } var year = end.getFullYear(); var hours = end.getHours(); var sec = end.getSeconds(); var msec = end.getMilliseconds(); var eddate = new Date(year, month, date, hours, sec, msec); var edate = year + "-" + month + "-" + date; $('#eventdate').val(sdate); $('#edate').val(edate); var acctype = $('input:radio[name=accesstype]:checked').val(); if (acctype == 1) { $('#chose-multi').hide(); } $("#check").click(function() { $("#stime").toggle(); $("#etime").toggle(); }); $("#rstrcted").click(function() { $("#chose-multi").show(); }); $("#private").click(function() { $("#chose-multi").hide(); }); $("#public").click(function() { $("#chose-multi").hide(); }); $('#error-message').hide(); // hide the error message section $('#modal-form').modal('show'); } And my HTML code is &lt;div id="modal-form" class="modal" tabindex="-1"&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;&amp;times;&lt;/button&gt; &lt;center&gt; &lt;h4 class="blue bigger"&gt;Create Event&lt;/h4&gt;&lt;/center&gt; &lt;/div&gt; &lt;center&gt; &lt;div id="error-message" class="alert alert-danger col-xs-12" style…
type: Question
has answer: http://stackoverflow.com/a/28169698
tagged with: javascript
has title: why jquery toggle() method doesnot work properly if page is not refreshed

http://stackoverflow.com/q/28126941
has comment: http://stackoverflow.com/comment/44626994
has comment: http://stackoverflow.com/comment/44627696
has title: Why is 019 not a JavaScript syntax error? Or why is 019 > 020
accepted answer: http://stackoverflow.com/a/28127633
has body: If I type 019 &gt; 020 in the JavaScript console (tested in both Chrome and Firefox), I get the answer true. This is due to 020 being interpreted as an OctalIntegerLiteral (equals 16) whereas 019 is apparently being interpreted as DecimalLiteral (and equals 19). As 19 is greater than 16, 019 &gt; 020 is true. What puzzles me is why 019 is interpreted as a DecimalLiteral in first place. Which production is it? DecimalIntegerLiteral does not allow 019: DecimalIntegerLiteral :: 0 NonZeroDigit DecimalDigits_opt OctalIntegerLiteral also does not allow 019 (as 9 is not an octal digit): OctalIntegerLiteral :: 0 OctalDigit OctalIntegerLiteral OctalDigit OctalDigit :: one of 0 1 2 3 4 5 6 7 So from what I see in the specification, 019 should actually be rejected, I don't see why it is interpreted as a decimal integer. I guess there's some kind of compatibility rule in place here but I have failed to find a formal definition. Could please anyone help me with this? (Why I need this: I'm developing a JavaScript/ECMAScript parser for Java with JavaCC and have to pay a special attention to the specification - and deviations thereof.)
has comment: http://stackoverflow.com/comment/44627168
has comment: http://stackoverflow.com/comment/44627000
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44627069
tagged with: javacc
has comment: http://stackoverflow.com/comment/44626908
has comment: http://stackoverflow.com/comment/44627071
has comment: http://stackoverflow.com/comment/44626973
has comment: http://stackoverflow.com/comment/44627049
type: Question
upvote count: 78
tagged with: grammar
has comment: http://stackoverflow.com/comment/44627147
tagged with: ecmascript-5
tagged with: javascript
has comment: http://stackoverflow.com/comment/44626981
has comment: http://stackoverflow.com/comment/44626971
score: 78
tagged with: language-lawyer
has comment: http://stackoverflow.com/comment/44627597
has comment: http://stackoverflow.com/comment/44626945
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28127633
favorite count: 0

http://stackoverflow.com/a/28160989
upvote count: 1
has comment: http://stackoverflow.com/comment/44693367
answers question: http://stackoverflow.com/q/28160918
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44693463
has comment: http://stackoverflow.com/comment/44693366
has comment: http://stackoverflow.com/comment/44693390
has body: Try this code: function handleInputKey(e) { if (!e) { var e = window.event; } //allow only numeric input //48-57 and 96-105 (keyboard left and numpad) if ( ((e.keyCode &gt;= 48 &amp;&amp; e.keyCode &lt;= 57 || e.keyCode == 47) &amp;&amp; (!e.shiftKey &amp;&amp; !e.altKey &amp;&amp; !e.ctrlKey) )) { return true; } else { e.preventDefault(); return false; } } document.getElementById('txtbox').addEventListener("keypress", handleInputKey, false); Please input date in DD/MM/YYYY format.&lt;br /&gt; &lt;input id="txtbox" maxlength="10" placeholder="example: 01/01/1970"&gt;
has comment: http://stackoverflow.com/comment/44693477

http://stackoverflow.com/q/28201164
has comment: http://stackoverflow.com/comment/44769152
tagged with: javascript
has body: Maybe not because the call is slow, but rather the lookup is; I'm not sure, but here is an example: var foo = {}; foo.fn = function() {}; var bar = {}; bar.fn = function() {}; console.time('t'); for (var i = 0; i &lt; 100000000; i++) { foo.fn(); } console.timeEnd('t'); Tested on win8.1 firefox 35.01: ~240ms chrome 40.0.2214.93 (V8 3.30.33.15): ~760ms msie 11: 34 sec nodejs 0.10.21 (V8 3.14.5.9): ~100ms iojs 1.0.4 (V8 4.1.0.12): ~760ms Now here is the interesting part, if i change bar.fn to bar.somethingelse: chrome 40.0.2214.93 (V8 3.30.33.15): ~100ms nodejs 0.10.21 (V8 3.14.5.9): ~100ms iojs 1.0.4 (V8 4.1.0.12): ~100ms Something went wrong in v8 lately? What causes this?
has comment: http://stackoverflow.com/comment/44768526
has comment: http://stackoverflow.com/comment/44769304
answer count: 2
has comment: http://stackoverflow.com/comment/44769003
has title: slow function call in V8 when using the same key for the functions in different objects
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28202612
possible better answer: http://stackoverflow.com/a/28202142
upvote count: 51
has comment: http://stackoverflow.com/comment/44768672
has answer: http://stackoverflow.com/a/28202142
tagged with: node.js
has comment: http://stackoverflow.com/comment/44769900
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44768603
tagged with: v8
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/28202612
tagged with: performance
has comment: http://stackoverflow.com/comment/44769478
score: 51

http://stackoverflow.com/q/28139070
tagged with: google-earth
type: Question
has comment: http://stackoverflow.com/comment/44681832
tagged with: javascript
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44803813
has title: 3d kml barcharts in google map
tagged with: kml
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44719580
has body: I have some kml which looks like this: When I view the same kml in google map, everything is 2D. Is it impossible to view 3D KML shapes (e.g barcharts) in google map? The html of my page contains this: I tried to run: $(document).ready(function() { var mapOptions = { center: new google.maps.LatLng(36.964645, -122.01523), zoom: 18, mapTypeId: google.maps.MapTypeId.SATELLITE }; map = new google.maps.Map(document.getElementById('gmTest'), mapOptions); map.setTilt(45); }); Is this a step in the right direction? The tilt does not change. Btw, can I massage/obtain the map without setting the options like I did? Thanks.
has comment: http://stackoverflow.com/comment/44783949
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/44703764

http://stackoverflow.com/q/28156873
has body: I am not clear about the pattern in which a D3 code must be written. for e.g In the below code snippet, If I mention the 3rd section(Chart Title) of the code after creating the svg element my chart doesn't show the title text but If i mention the 3rd section before creating the svg it simply works. Why ?
has title: D3 Coding Order
score: 0
has comment: http://stackoverflow.com/comment/44685244
has comment: http://stackoverflow.com/comment/44686248
answer count: 1
has comment: http://stackoverflow.com/comment/44685852
has comment: http://stackoverflow.com/comment/44687293
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/44685772
tagged with: d3.js
has comment: http://stackoverflow.com/comment/44685639
accepted answer: http://stackoverflow.com/a/28167374
type: AnsweredQuestion
tagged with: dimple.js
has comment: http://stackoverflow.com/comment/44685845
has comment: http://stackoverflow.com/comment/44685114
has answer: http://stackoverflow.com/a/28167374
has comment: http://stackoverflow.com/comment/44686697
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44777058
comment on: http://stackoverflow.com/q/28159057
score: 0
type: Comment
type: QuestionComment
has text: Just edited it so the functions are not nested inside each other. Still running into the same problem.

http://stackoverflow.com/q/28168698
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/52773516
has title: File Upload shows data with empty strings on Safari and Chrome iOS8.1.2
has answer: http://stackoverflow.com/a/41410409
upvote count: 1
answer count: 1
tagged with: file-upload
has body: Hello we are having issues with File Upload on Chrome and Safari on IOS 8.1.2. Some photo upload shows data with an empty string, others are displaying OK. Anyone knows a workaround so the uploaded photos can be consistently displayed? Thanks so much. Initially we thought that it was a known issue with File Upload featuring broken on iOS 8 Safari. "http://blog.uploadcare.com/you-cannot-upload-files-to-a-server-using-mobile-safari/". However, It appeared to be problem with 8.0.0 and has supposedly been fixed. Also, the problem is not limited to Safari and appears in Chrome iOS as well. Specifically, when a photo chosen was taken directly from the iPHONE camera, the data appears to be empty (see log in console) [Log] Object (controllers.js, line 228) src: "data:," However, when a photo chosen is either a Screen Shot or a photo saved from an email, the image is in fact displayed and the data is sent [Log] Object (controllers.js, line 228) src: "[binary]...." Has anyone encountered a similar issue? Why does it work with some photos but not others? Anyone knows any workaround to display images that have been taken from the Camera itself? Snippets of codes here: $scope.getAlbumPicture = function() { Camera.getAlbumPicture().then(function(fileURI) { $scope.normalisePicture(fileURI, function(dataURL) { Local.setTemp(dataURL); $state.go('tab.camera-detail'); }); }, function(err) { console.log(err); }); }; $scope.readImage = function(input) { if (input.files &amp;&amp; input.files[0]) { var fileReader = new FileReader(); fileReader.onloadend = function() { $scope.normalisePicture(fileReader.result, function(dataURL) { Local.setTemp(dataURL); $state.go('tab.camera-detail'); }); }; fileReader.readAsDataURL(input.files[0]); } };
favorite count: 0
type: UnansweredQuestion
tagged with: safari
downvote count: 0
score: 1
tagged with: google-chrome
type: Question

http://stackoverflow.com/comment/44815421
has text: Thanks all of you for answers. It happens that I've got Emmet plugin (installed via Package Browser) however shortcuts you mention 1) don't work 2) do different stuff. I have done some Google research but couldn't answer question why these shortcuts differ. (Abbreviations on Tab work well). Have you got any ideas why it's like so? My setup is: OS X Yosemite 10.10.1 & Sublime Text 3
comment on: http://stackoverflow.com/a/28223973
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28253157
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28253120
answers question: http://stackoverflow.com/q/28253120
has body: You need to stringify the object when sending it so that you send JSON. , data: JSON.stringify(data)

http://stackoverflow.com/comment/44701664
has text: I have a java class which will connect to Mysql DB & Retrieve the latitude ,longitude from a table ,Now The retrieved values should be passed to a JS .This JS has a code to display a map.In this i have a button called show vehicle Button.If the user clicks this button ,I will pass the lat,lon from my java class to a function in Javascript .
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28165102

http://stackoverflow.com/q/28156987
has comment: http://stackoverflow.com/comment/44685363
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has body: Sorry for the confusing title, basically I have a json file that looks like this that points to other locations: { "link": [ { "href": "some-external-resource", "title": "services-path" } ] } My real problem is getting the href of the object to not load asynchronously into the Angular service. The following is my request to the above json file: var servicesPath = $http({ url: 'resource-directory.json', method: "GET" }).success(function(data){ return $filter('filter')(data.link, {title: "services-path"})[0].href; }); console.log(servicesPath); I know what is being returned is what I want, but the console log returns the standard "then, catch, finally, success, error" object functions, meaning the data isn't there when I need it. How can I manipulate my request so the variable contains the information?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44685523
answer count: 1
downvote count: 0
has title: AngularJS $http request object for another request
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28157708

http://stackoverflow.com/comment/44836966
has text: You don't need to use `.setAttribute()` to set those properties, and you don't need to set the "type" property at all. Just `script_tag.src = "...";` will work.
comment on: http://stackoverflow.com/q/28237813
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28225313
upvote count: 4
has comment: http://stackoverflow.com/comment/44814101
downvote count: 0
score: 4
type: AcceptedAnswer
has body: As written your code works. So there must be another reason for it not working. Either the DOM isn't ready in which case wrap the click handler in the DOM ready callback $(function(){ // register event handler for delcomment $( "span.delcomment" ).click(function() { // some code that actually deletes comment from database }); }); Or these elements are being added dynamically, in which case you would delegate the click event to that specific class // register event handler for delcomment $( "body" ).on("click", "span.delcomment", function() { // some code that actually deletes comment from database }); This delegation works by assigning a handler to the body element itself, and then every time a click event is registered, it looks to see if the target element matches the given selector. If it does, then the callback function is called (and internally .bind is used to make that target element equal to this in the callback).
type: Answer
has comment: http://stackoverflow.com/comment/44814528
accepted answer of: http://stackoverflow.com/q/28225238
answers question: http://stackoverflow.com/q/28225238

http://stackoverflow.com/q/28212454
answer count: 1
downvote count: 0
has title: How to connect objects with Bezier-like curves using Paper.js
favorite count: 0
tagged with: paperjs
has body: I have a web app prototype where nodes similar to Blender shader editor are connected to each other. I am using Paper.js framework I want them to be connected using those smooth Bezier-like curves. So I have 2 shapes and I can connect them by making a straight line, but now I want to have handles at the endpoints that smooth these objects out, kinda like this: So 2 handles on endpoints, pointing horizontally for half the bounding box of the path. The problem is I can't figure out how to add and edit those handles using Paper.js The code I have is this: function makeRectangle(topLeft, size, cornerSize, colour){ var rectangle = new Rectangle(topLeft, size); var cornerSize = cornerSize; var path = new Path.RoundRectangle(rectangle, cornerSize); path.fillColor = colour; return path; } var xy1 = new Point(50,50); //Position of 1st rectangle. var size = new Size(100, 80); //Size var c = new Size(8,8); //Corner radius var col = "#167ee5"; //Colour var r1 = makeRectangle(xy1, size, c, col); //Make first rectangle var xy2 = new Point(467,310); //Position of second rectangle var size2 = new Size(115, 70); //Size of second rectangle var r2 = makeRectangle(xy2, size2, c, col); //Make secont rectangle var r1cent = r1.bounds.center; //Get the center points, they will be used as endpoints for the curve. var r2cent = r2.bounds.center; var connector = new Path(r1cent, r2cent); //Ok so I made this path... Now what? How do access and edit the handlers at endpoints like in the image? connector.strokeColor = 'black'; //Give it some colour so we can see it. You can paste all this code here without any setup, it's a good way to test the framework.
score: 2
accepted answer: http://stackoverflow.com/a/28214587
upvote count: 2
type: AnsweredQuestion
tagged with: javascript
type: Question
tagged with: canvas
has answer: http://stackoverflow.com/a/28214587

http://stackoverflow.com/q/28232695
answer count: 4
has comment: http://stackoverflow.com/comment/44827638
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28232851
upvote count: 1
has comment: http://stackoverflow.com/comment/44827746
has comment: http://stackoverflow.com/comment/44828069
score: 1
type: Question
has answer: http://stackoverflow.com/a/28233007
downvote count: 0
has answer: http://stackoverflow.com/a/28233192
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28232862
favorite count: 0
has title: Cannot access to dom tree after dynamically loaded page
tagged with: http://stackoverflow.com/tag/html
has body: Welcome I have a problem with landing in jquery. I remove all from the div using a empty() or remove() functions. The problem is when the page is loaded dynamically into that div i can not access to any loaded elements inside of that div using jquery. data from the get response is the same as below link [E] link [E] link [E] $('#menu').empty() $.get('.php?id=get_menu', function(data) { $('#menu').append(data); }); And after load if i click e (edit) jquery do nothing This a jquery script i using $('.form').submit(function(event) { var $form = $(this); var $inputs = $form.find("input, select, button, textarea"); var serializedData = $form.serialize(); request = $.ajax({ url: "check.php?id=update_menu", type: "post", data: serializedData }); request.done(function (response, textStatus, jqXHR){ $('#menu').empty(' '); $.get('admin_index.php?id=get_menu', function(data) { $('#menu').append(data); }); }); request.always(function () { $('.preloader-big').fadeOut(); }); }); The php script is output ready to use formated html code THE ANSWER FOR MY POST This code gets php datas after clicki'n on the letter e $('.optedit').on('click', function() { $.get('admin_index.php?id=get_menu_edit&mid='+menu_id[1], function(data) { $('#link_name').val(res[2]); $('#link_title').val(res[3]); $('#mid').val(res[1]); )}; )}; I just pack him into a some function i called her update_menu(); and repeat the function after $.get('.php?id=get_menu', function(data) { $('#menu').append(data); update_menu(); }) Thats update jquery code to use code that just was added. Everything works ok. Thanks for Your help :)
tagged with: css

http://stackoverflow.com/q/28207744
type: Question
has comment: http://stackoverflow.com/comment/44858189
tagged with: database
tagged with: javascript
has comment: http://stackoverflow.com/comment/44794338
has title: Hiberbate query for the product search based it's category id
score: 0
has comment: http://stackoverflow.com/comment/44781068
has comment: http://stackoverflow.com/comment/44796593
answer count: 0
type: UnansweredQuestion
has body: I have a schema which consist of the following table. 1)TABLE category_type. Basically we have 4 category_type a)Groceries b)Pharma c)Baby Products d) Sports item CREATE TABLE `category_type` ( `id` int(11) NOT NULL DEFAULT '0', `name` varchar(45) NOT NULL, `image` varchar(128) NOT NULL, `creation_date` datetime NOT NULL, `last_updated_date` datetime NOT NULL, `created_by` int(11) DEFAULT NULL, `last_updated_by` int(11) NOT NULL, `object_version_number` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 2) TABLE category. Table's description as follows. The category_type table and category table are different. Category Type table is the higher level as explain earlier. The category table consist of the next level of categorization. Ex) Staples,Personal Care,Biscuit and Beverages is the 2nd level of category which come under the main category_type Groceries. All the next level of the categorization is been done in the same category table itself. Suppose rice and pulses,flour,spices,salt and sugar are the 3rd level of categorization with comes under staples category.So,all the 3rd level of the categorization refer to the 2nd level of categories using the "parent_category_id" field in the same table.Similarly 4th level of the categorization refer to the 3rd level using the "parent_category_id" field in the same table. Ex: 1). 1st level of categorization are Groceries,Pharma,Baby Products,Sport item 2). 2nd level of categorization arerice and pulses,flour,spices,salt and sugar using groceries. Similarly pharma,baby products,sport item will have there own 2nd level of categorization. 3). Similarly each 2nd level of categories will have there own 3rd level of categories. The table info is given below. CREATE TABLE `category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, `creation_date` datetime NOT NULL, `last_updated_date` datetime NOT NULL, `created_by` int(11) NOT NULL, `last_updated_by` int(11) NOT NULL, `object_versio…
tagged with: spring-mvc
tagged with: hibernate
tagged with: mysql

http://stackoverflow.com/comment/44733471
has text: seems fine, did you try and echo out your user id to makesure it exists? Also you have 2 ifs but no else - check the $viewPref variable.
comment on: http://stackoverflow.com/q/28180584
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28130623
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44634024
has comment: http://stackoverflow.com/comment/44634850
type: Question
has title: unable to debug javascript in visual studio 2013 and IE 11
has comment: http://stackoverflow.com/comment/44634823
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44635411
has comment: http://stackoverflow.com/comment/44634955
has comment: http://stackoverflow.com/comment/44635013
has comment: http://stackoverflow.com/comment/44634649
favorite count: 0
score: 2
tagged with: visual-studio-2013
has body: Here is my javascript file yogaspace.js var input = document.getElementById('location'); var options = { types: ['(cities)'], componentRestrictions: { country: "us" } }; var autocomplete = new google.maps.places.Autocomplete(input, options); debugger; var result = autocomplete.getPlace(); this is the whole file and it is being called in the index.cshtml file at the bottom of the view like this. @Scripts.Render("~/bundles/js") and the js is a bundle that has the yogaspace.js file in it. The script gets used and the autocomplete feature works fine but the breakpoint at "debugger" never gets triggered. I also tried setting a breakpoint but that doesn't work as well. Any help! I read in other posts that VS has some problems with javascript debugging but it says that adding debugger; will always work. VS 2013, MVC 5, Razar View Engine, IE 11
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44634590
has comment: http://stackoverflow.com/comment/44635751
tagged with: razor
linked to: http://stackoverflow.com/q/20807845
has answer: http://stackoverflow.com/a/28131598
tagged with: debugging

http://stackoverflow.com/comment/44805329
type: Comment
comment on: http://stackoverflow.com/a/28213416
type: AnswerComment
has text: Code only answers can generally be improved by the addition of some explanatory text. In this case explaining both how this works and why you think it is the most efficient method.
score: 0

http://stackoverflow.com/comment/44745171
score: 1
type: QuestionComment
has text: use `$index` instead of `index`
comment on: http://stackoverflow.com/q/28188209
type: Comment

http://stackoverflow.com/a/28136692
has body: alert("Your number is the sum of " + (theNumber + parseInt(10))); The parseInt() function parses a string and returns an integer.
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/44645299
type: Answer
has comment: http://stackoverflow.com/comment/44645734
answers question: http://stackoverflow.com/q/28136677
downvote count: 1
has comment: http://stackoverflow.com/comment/44645695

http://stackoverflow.com/q/28232737
has comment: http://stackoverflow.com/comment/44827681
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44830847
linked to: http://stackoverflow.com/q/18287482
type: Question
tagged with: angularjs-routing
answer count: 2
has comment: http://stackoverflow.com/comment/44830193
has title: AngularJs View not showing
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28234246
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28234246
possible better answer: http://stackoverflow.com/a/28233998
has comment: http://stackoverflow.com/comment/44829918
tagged with: ng-view
score: 2
has answer: http://stackoverflow.com/a/28233998
has comment: http://stackoverflow.com/comment/44831224
upvote count: 2
has comment: http://stackoverflow.com/comment/44830744
has body: Hi I am a new comer to angular js. when I load the page it shows two errors 1 - Error: [$injector:unpr] 2 - Error: [$injector:cdep] HTML index.html partials/developers.html Sort By Name Organisation Designation Ascending Descending Name Designation Organisation app.js var myApp = angular.module("MyApp",[ 'ngRoute', 'appController' ]); myApp.config(['$routeProvider',function($routeProvider){ $routeProvider. when('/list',{ templateUrl : 'partials/developers.html', controller:'DeveloperController', }). otherwise({ redirectTo: '/list' }); }]); controller.js var appController = angular.module("appController", []); appController.controller('DeveloperController', ['$scope','$http',function($scope,$http) { $scope.name="asdsas"; }]); see the console image here EDIT this is my directory structure of project. will it make any trouble. I'm not running it on wamp or any other server. anyone please help me to sort it out

http://stackoverflow.com/a/28186573
score: 2
accepted answer of: http://stackoverflow.com/q/28186435
downvote count: 0
has body: removed click event(you don't need it) and modified code little bit(used prop instead of attr).. $(document).ready(function() { $('#mycheckbox').keypress(function(event) { var keycode = (event.keyCode ? event.keyCode : event.which); if (keycode == 13) { clickCheckBox(this); } event.stopPropagation(); }); }); function clickCheckBox(box) { var $box = $(box); $box.prop('checked', !$box.prop('checked')); } created jsfiddle for this and working fine.. http://jsfiddle.net/c2S5d/23/
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28186435

http://stackoverflow.com/comment/44749582
type: AnswerComment
type: Comment
has text: @JamesThorpe TIL! I've always been following that up with a `valueHasMutated` - I guess I'll go through my latest project and replace all instances of that!
score: 1
comment on: http://stackoverflow.com/a/28190944

http://stackoverflow.com/a/28222941
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28222919
downvote count: 0
score: 4
has body: You'll have to insert the value into the string manually in JavaScript using string concatenation. Try this instead: $('.result:nth-child(' + a + ') .name .title')
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28222919

http://stackoverflow.com/comment/44820771
type: Comment
comment on: http://stackoverflow.com/a/28228529
has text: @Vijay " javascript standerds says to add properties using prototype" --- it does not. You are free to add properties to objects without using prototypes.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/109103538
type: Comment
has text: appreciate this is an old question but would you consider changing the accepted answer to the one referencing isValid(). I'd like to dupe something else here but the accepted answer is no longer the best.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28227862

http://stackoverflow.com/comment/44732820
type: Comment
comment on: http://stackoverflow.com/a/28181764
type: AnswerComment
score: 0
has text: I should have been clearer in my question - I know how to do what you have described - it is the **stop (reset) animation** and **restart animation** aspects of your answer that I need information on.

http://stackoverflow.com/a/28155035
has comment: http://stackoverflow.com/comment/44681550
score: 3
has body: Use the dir method. console.dir(obj)
upvote count: 5
has comment: http://stackoverflow.com/comment/73268992
has comment: http://stackoverflow.com/comment/44681494
type: Answer
has comment: http://stackoverflow.com/comment/44681412
downvote count: 2
has comment: http://stackoverflow.com/comment/108565135
answers question: http://stackoverflow.com/q/28154990

http://stackoverflow.com/comment/44737729
comment on: http://stackoverflow.com/a/28184270
score: 0
type: AnswerComment
has text: Did you echo or use the brackets?
type: Comment

http://stackoverflow.com/q/28161496
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28163601
has title: How to structure a multi-page chrome app?
answer count: 1
tagged with: google-chrome-app
has body: I'm building a file for each 'page' I want to dynamically load. Each 'page' file is implemented using the Singleton Pattern, with pretty much just one public method, loadPage() or init(). Is there a better way to approach this? A framework that I should know of? It's not a complicated app, maybe 3-5pages. It just started to become a real pain document.createElement-ing several nested div's with JavaScript.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28163601

http://stackoverflow.com/q/28167957
tagged with: jquery
favorite count: 0
tagged with: datepicker
has title: on submit change date format from dd M yy to "2015-01-28T00:00:00+00:00" datepicker
score: 2
downvote count: 0
tagged with: wordpress
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/17807806
accepted answer: http://stackoverflow.com/a/28168005
linked to: http://stackoverflow.com/q/22296712
tagged with: date
upvote count: 2
has answer: http://stackoverflow.com/a/28168005
has body: I am currently using a datepicker in wordPress allowing the user to select a date. On submit, how can I change the current format of 'dd M yy' to something like 2015-01-28T00:00:00+00:00 so it can be submitted into a database later on. As well as check for validation, but I think this will be a different question. Currently I have the following to declare the date picker : // triggers the calendar to open. $(document).ready(function() { $('#deadline_date').datepicker({ dateFormat : 'dd M yy', minDate: 0 }); });
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28184539
answers question: http://stackoverflow.com/q/28184263
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28184263
type: AcceptedAnswer
downvote count: 0
score: 1
has body: The height appears to be fixed rather than resizing to fit the contents. According to the documentation for chart.height: By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0. Since you have specified the height of the containing element to be 400px, the bars cannot fit in the chart without overlapping. Unfortunately, removing the height styling from the containing element does not cause the chart to resize itself to fit the contents either, as the container will have a height of zero by default, defaulting the chart height to 400px. You'll have to set the height manually, either by increasing the container's height or by setting the height of the chart (any combination of these seem to work).
type: Answer
has comment: http://stackoverflow.com/comment/44775152

http://stackoverflow.com/a/28280228
has body: It looks like you are using bootstrap to create the dropdown. If that is the case you can use the "shown" event. However you need to attach the event on a container element. Html Quick Search SUBMIT Javascript $('#quickSearchContainer').on('show.bs.dropdown', function () { $('#inputSearch').focus(); });
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28279796
upvote count: 1
type: Answer

http://stackoverflow.com/a/28249753
has body: for top use position: var position = $('#w'+w ).position(); console.log( "left: " + position.left + ", top: " + position.top ); for height or width use jQuery width() and height(): console.log( "width: " +$('#w'+w ).width() + ", height: " + $('#w'+w ).height() );
type: Answer
has comment: http://stackoverflow.com/comment/44865106
score: 0
answers question: http://stackoverflow.com/q/28249695

http://stackoverflow.com/comment/44731377
type: AnswerComment
comment on: http://stackoverflow.com/a/28177818
type: Comment
has text: As long as you have a defined height, you might go with this: http://jsfiddle.net/dw4Lz8qe/18/
score: 0

http://stackoverflow.com/q/28260151
score: 1
tagged with: css-float
possible better answer: http://stackoverflow.com/a/28260259
tagged with: absolute
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28260508
answer count: 3
has title: Combine float and absolute position
accepted answer: http://stackoverflow.com/a/28260508
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28260684
upvote count: 1
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28260259
has body: I am creating a calendar where all the events are displayed in a single div. According to the top and height values, the event should be placed in a determinate place. Let me show you. In this image, both events at 6am are at the same vertical alignment. I can solve that behavior using float: left(jsfiddle). If events do not have vertical alignment conflics (the height and top don't collide) then I can emulate this behavior using absolute position(jsfiddle) but NOT float. the issue The real problem comes when I try to place the events at 9am and 9:40am and make them look like the image above. Asume the following properties: 9:00 height: 50px, top: 200px 9:40 height: 50px, top: 230px bottom of 9:00 event: 200px + 50px = 250px top of 9:30 event: 230px Then, they are sharing 20px (250px - 230px) vertically. That is why I tried to do something like this: 9 AM 9:40 AM ...but float property does not work in elements with absolute position. Overview My idea is to treat the top value as a guide to place the event vertically in the calendar according to its hour. For example, 6am -> top: 100px 7am -> top: 150px 8pm -> top: 200px Ways to achieve I tried to solve this by myself using pure ccs, but I do not mind apply javascript. However, I can not show you my attempts with javascript because I do not even can make a considerable css result. As I said before, I am using top property because I thought it could be easy position manipulation, but I could use another method if is necessary. Thank you in advance.

http://stackoverflow.com/a/28171943
answers question: http://stackoverflow.com/q/28170718
type: Answer
has body: you can use the js code like this var wrap = $("#wrap"); wrap.on("scroll", function(e) { if (this.scrollTop &gt; 100) { wrap.addClass("class_name_of_div"); } else { wrap.removeClass("class_name_of_div"); } }); and in .CSS .class_name_of_div{ position: fixed; top: 10px; } try this will work
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/44933750
type: AnswerComment
has text: can you please put some code? How would you arrange it? Sorry, I have tried different arrangements but no result
type: Comment
comment on: http://stackoverflow.com/a/28278513
score: 0

http://stackoverflow.com/q/28148147
accepted answer: http://stackoverflow.com/a/28159720
tagged with: parenscript
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28159720
type: Question
upvote count: 2
answer count: 2
has body: Is there anyway to turn off Parenscript's implicit Return? I'm trying to write the following code: function () = { dialog.show();}; But Parenscript inserts an implicit return: (ps (lambda () (chain dialog (show)))) => function () = { return dialog.show();};
possible better answer: http://stackoverflow.com/a/28150728
has title: Parenscript and implicit Return
has answer: http://stackoverflow.com/a/28150728
tagged with: common-lisp
tagged with: javascript
tagged with: lisp

http://stackoverflow.com/comment/44782608
comment on: http://stackoverflow.com/q/28208378
has text: you should explain more. There is an input ID over there and you have to get it via # selector. if otherwise, you can select latest TD in the certain TR. otherwise, give your full code snippet.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28230548
tagged with: javascript
tagged with: jquery
tagged with: api
answer count: 1
favorite count: 0
has title: How to use Trello JS API to create a card
has comment: http://stackoverflow.com/comment/44843120
type: UnansweredQuestion
tagged with: trello
score: 2
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 2
has body: I've been trying to utilize the Trello API via JSFiddle and haven't been able to get it to work (I have very limited JS/JSON knowledge). I need to create a card under a specific list, using the API. function PostStuff() { $(document).ready(function(){ Trello.authorize({ interactive: true, type: "popup", expiration: "never", name: "surveyrequest", persist: "true", success: function() { onAuthorizeSuccessful(); }, error: function() { onFailedAuthorization(); }, scope: { read: true, write: true} }); function onAuthorizeSuccessful() { Trello.post("cards", { name: "Card created for test", desc: "this is a test", idList: "........", due: null, urlSource: null}); } }); } I have JQuery and the Trello API included. I blanked out the idList in the code for security purposes. I confirmed that the code does execute the onAuthorizeSuccessful() function. How can I modify this to create a Trello card?
has answer: http://stackoverflow.com/a/36033311

http://stackoverflow.com/a/28142141
answers question: http://stackoverflow.com/q/28141271
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28141271
has body: So it looks like i didn't define the name of the json array in my javascript. I ended up just taking the name completely out and returning that instead and it seemed to work fine. {[ { "info":"11111. Some random info here", "lat":40.538800,"lng":-74.555049}, { "info":"11111. Some random info here", "lat":40.543100,"lng":-74.606598}, { "info":"11111. Some random info here", "lat":40.544700,"lng":-74.632273}, { "info":"11111. Some random info here", "lat":40.489900,"lng":-74.586175} ]}

http://stackoverflow.com/comment/44798140
has text: @Jason Here is my head tag. But, Below answer worked for me. Thank you <script src='<%=ResolveClientUrl("~/Scripts/bootstrap.min.js") %>' type="text/javascript">
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28203140
score: 0

http://stackoverflow.com/a/35586860
accepted answer of: http://stackoverflow.com/q/28159744
answers question: http://stackoverflow.com/q/28159744
type: Answer
downvote count: 0
score: 1
has body: Hat-tip to evan, who actually provided the answer in the comments. I simply got tripped by the "auto"-insertion of semicolons by Javascript. The single return statement meant to return from the function, giving it a return value of undefined. the following jsx never got executed. Starting the jsx on the same line as the return ensures that the return is executed as intended.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44895611
type: QuestionComment
has text: And what's the output of `console.log(req.user)` in the route?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28269579

http://stackoverflow.com/q/28241423
accepted answer: http://stackoverflow.com/a/28241550
has answer: http://stackoverflow.com/a/28241541
type: Question
has body: Here is what I have done so far var table = new google.visualization.Table(document.getElementById('report_results')); var view = new google.visualization.DataView(d); var swidth = screen.width; view.setColumns([2,3,4,5,6,7,8,9,10]); var cssClassNames = {'hoverTableRow': 'hover-table-row'}; var swidth = screen.width; table.draw(view, {height: 700,width:swidth,'cssClassNames':cssClassNames}); &lt;style&gt; .hover-table-row{ color: #9a64ff; cursor:pointer; } &lt;/style&gt; Now I have the cursor as pointer in all rows except the last row.How can I achieve that?
has title: change cursor to pointer for all rows of the datatable except the last one
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28241541
tagged with: google-visualization
tagged with: javascript
tagged with: jquery
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/28241550
type: AnsweredQuestion

http://stackoverflow.com/comment/44896381
type: Comment
has text: this is the print function code.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28207854

http://stackoverflow.com/q/28129651
has title: jquery events sticky header
answer count: 0
downvote count: 0
type: UnansweredQuestion
type: Question
score: 1
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: sticky
has body: Hello I'm trying to subscribe to the Jquery event sticky-start but it's not working on the documentation it says To subscribe to events use jquery: &lt;script&gt; $('#sticker').on('sticky-start', function() { console.log("Started"); }); $('#sticker').on('sticky-end', function() { console.log("Ended"); }); &lt;/script&gt; So i attempted to replicate this functionality in a fiddle but it does not console log anything. How do I subscribe to a Jquery event? http://jsfiddle.net/mamq8qe6/6/
has comment: http://stackoverflow.com/comment/44633004

http://stackoverflow.com/q/28133798
score: 0
has comment: http://stackoverflow.com/comment/44641797
tagged with: firefox
answer count: 1
has body: I have used jaquery ajax form post,it works fine in chrome but not in Firefox. any body please help.
tagged with: jquery
has answer: http://stackoverflow.com/a/28134004
has comment: http://stackoverflow.com/comment/44640239
tagged with: ajax
tagged with: php
has comment: http://stackoverflow.com/comment/44640253
has comment: http://stackoverflow.com/comment/44640043
has comment: http://stackoverflow.com/comment/44640275
has comment: http://stackoverflow.com/comment/44640236
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44640271
has comment: http://stackoverflow.com/comment/44640108
tagged with: javascript
has title: Why jquery ajax form post not working in Firefox
accepted answer: http://stackoverflow.com/a/28134004

http://stackoverflow.com/a/28126959
type: Answer
score: 3
downvote count: 0
upvote count: 3
has body: The browser will read the tag inside the string, and assume that you're closing the JavaScript block entirely. So if you write: '; …it is not read as '; But as '; Usually people solve this by just splitting up the tag and concatenating it:
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44628067
accepted answer of: http://stackoverflow.com/q/28126930
answers question: http://stackoverflow.com/q/28126930

http://stackoverflow.com/a/28187451
type: Answer
has body: You should escape (, {, } and . with \: /&lt;script charset="utf-8"&gt;new DGWidgetLoader\(\{"width":[0-9]{3,4},"height":[0-9]{3,4},"borderColor":"#a3a3a3","pos":\{"lat":[0-9]{1,2}\.[0-9]+,"lon":[0-9]{1,2}\.[0-9]+,"zoom":[0-9][0-9]\}/
accepted answer of: http://stackoverflow.com/q/28187300
answers question: http://stackoverflow.com/q/28187300
upvote count: 22
type: AcceptedAnswer
downvote count: 0
score: 22

http://stackoverflow.com/comment/44632231
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28129637
has text: Stop using the non-standard [`innerText`](https://msdn.microsoft.com/en-us/library/ms533899.aspx) and use [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node.textContent)?
score: 0

http://stackoverflow.com/comment/44627951
comment on: http://stackoverflow.com/q/28125229
score: 0
type: QuestionComment
type: Comment
has text: Load jquery from a bootstrap might help you to solve this problem : http://framework.zend.com/manual/1.12/en/learning.view.placeholders.standard.html

http://stackoverflow.com/comment/44940214
comment on: http://stackoverflow.com/a/28264744
type: Comment
score: 0
type: AnswerComment
has text: how about FF? `Custom protocols must start with web+`? and `There is no way to declare this in a manifest` ? how can I write such addon?

http://stackoverflow.com/comment/44764136
type: Comment
comment on: http://stackoverflow.com/a/28198857
has text: @Barmar: How about "more explicit evilness"?
type: AnswerComment
score: 0

http://stackoverflow.com/a/28205056
has comment: http://stackoverflow.com/comment/44776542
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/44775936
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28205026
downvote count: 0
has body: setTimeout() takes a function as a first parameter that is executed after n seconds. This will work: setTimeout(function() { window.location.replace(response.redirect); }, 5000);
answers question: http://stackoverflow.com/q/28205026

http://stackoverflow.com/comment/44840869
type: AnswerComment
score: 0
has text: also my options do not have ID's as they are pulled from a list without them on sharpoint
type: Comment
comment on: http://stackoverflow.com/a/28239720

http://stackoverflow.com/comment/44881564
comment on: http://stackoverflow.com/q/28262285
has text: There's code missing: how is `$user_ok` set?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44885982
comment on: http://stackoverflow.com/a/28260259
type: Comment
score: 0
has text: Actually use `relative` fix the structure a lot :D. But as you said, need to do a very huge work to fill the edges.
type: AnswerComment

http://stackoverflow.com/a/28140176
has body: The event page is loaded when it is "needed", and unloaded when it goes idle again. maybe take a look into Event Pages https://developer.chrome.com/extensions/event_pages.
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28137557
answers question: http://stackoverflow.com/q/28137557
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28172431
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has title: Select TH element of an ID within an iframe
tagged with: selector
has comment: http://stackoverflow.com/comment/44714199
type: Question
tagged with: javascript
score: 0
tagged with: getelementbyid
has comment: http://stackoverflow.com/comment/44763666
has body: I am trying to select a TH element which does not have an ID, so I am using its parent TR element, all of this is within an iframe. The code looks something like this: Link I am able to select it using this jQuery, but the point is to get away from including that lib. $("#gsft_main").contents().find("#hdr_incident th:first-child"); But I can't when I try to do: var main = document.getElementById('gsft_main').contentDocument; main.getElementById('hdr_incident').getElementsByTagName('th')[0]; So I tried to use a querySelector, but no luck: var main = document.getElementById('gsft_main').contentDocument; main.querySelector("#hdr_incident > th"); One might think the "main" variable part is the issue, but I am able to select other elements using this code, so that shouldn't be the issue. var main = document.getElementById('gsft_main').contentDocument; main.getElementById('list_nav_incident'); main.getElementById('page_timing_div'); main.getElementsByClassName('timingDiv')[0]; Does anyone have any idea why it is not working in the iframe? (I am able to get this to work in a jsfiddle without the iframe part).

http://stackoverflow.com/q/28234549
has comment: http://stackoverflow.com/comment/44832191
type: Question
has body: I've downloaded this template: http://themeforest.net/item/-medic-medical-health-and-hospital-html5-theme/8331329 from themeforest. Original template has /plugins/ folder in root folder. I moved this folder into /assets/plugins/ and included it in HTML like this example: &lt;script type="text/javascript" src="/assets/plugins/smooth-scroll.js"&gt;&lt;/script&gt; The javascript files are found, but plugins are still requesting their css files from original folder /plugins and not in /assets/plugins/, for example: http://www.scsppza.local/plugins/royalslider/royalslider.css Failed to load resource: the server responded with a status of 404 (Not Found) I can't found where is path to css files defined for those plugins. Is it possible to fix it somehow?
has answer: http://stackoverflow.com/a/28235355
upvote count: 0
has comment: http://stackoverflow.com/comment/44831442
answer count: 1
tagged with: javascript
tagged with: css
favorite count: 0
accepted answer: http://stackoverflow.com/a/28235355
has title: Plugins cannot find their css styles in folder
tagged with: plugins
tagged with: filepath
type: AnsweredQuestion
tagged with: file-not-found
downvote count: 3
score: -3

http://stackoverflow.com/q/28156526
tagged with: angular-ui-grid
has comment: http://stackoverflow.com/comment/69248861
upvote count: 1
type: Question
has body: As I understand, ui-grid uses the primaryKey grid option to preserve your selection across updates, but this simple plunker shows this is not true: http://plnkr.co/edit/WYXeQShHWKDYDs4MIZnP?p=preview Steps to repro: Click a row to select it Click "click me to reset the data source". This will reset the data source (to a data source that contains exactly the same data as before). Your selection is now gone. The initial data source is: data: [ { id: "item1" }, { id: "item2" } ], With primaryKey: 'id', When you click on the button, here is the handler: $scope.resetDataSource = function() { $scope.gridOptions.data = [ { id: "item1" }, { id: "item2" } ]; $scope.$apply(); }; Removing the $scope.gridOptions.data = line will preserve the selection just fine. The new data source is exactly the same (contents) as the old. What can I do to preserve selection after assigning a new data source?
tagged with: javascript
answer count: 1
has title: How to preserve ui-grid selection after changing data source?
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44684533
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29605190
has comment: http://stackoverflow.com/comment/44688362

http://stackoverflow.com/q/28263428
upvote count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28263594
type: AnsweredQuestion
has title: how to pass an argument jquery and return the function value
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28263623
type: Question
has body: I am just learning the ropes with jQuery and I am trying to create the front end for a simple FizzBuzz game, I have a function as follows... FizzBuzz.prototype.play = function(number){ if (this.isDivisibleByFifteen(number)) { return "FizzBuzz"; } else if (this.isDivisibleByThree(number)) { return "Fizz"; } else if (this.isDivisibleByFive(number)) { return "Buzz"; } else { return number; } } I wish to have a an html form which excepts the param (number) and returns the outcome within a span container... &lt;form id="game"&gt; &lt;input type="text" name = "text" placeholder="Type your number"/&gt; &lt;/form&gt; &lt;span id="outcome"&gt;??&lt;/span&gt;``` Here is what I have so far, tear apart as you please... $(document).ready(function() { $("#outcome").text(function() { fizzBuzz.play( $(this).attr("number") ); }); }); Obviously this doesn't take into account any input from the form, but not really to sure how to do that yet. Many thanks.
answer count: 5
has answer: http://stackoverflow.com/a/28263557
has answer: http://stackoverflow.com/a/28263594
possible better answer: http://stackoverflow.com/a/28263533
has answer: http://stackoverflow.com/a/28263545
has answer: http://stackoverflow.com/a/28263533

http://stackoverflow.com/comment/108904287
comment on: http://stackoverflow.com/a/28243347
type: AnswerComment
has text: Seems to me like react-bootstrap 1.0.1 supports bootstrap 4 nowadays
score: 0
type: Comment

http://stackoverflow.com/q/28136677
has answer: http://stackoverflow.com/a/28136691
tagged with: math
type: Question
tagged with: concatenation
tagged with: javascript
has body: I have this code: var theNumber = Number(prompt("Pick a number", "")); alert("Your number is the sum of " + theNumber + 10); I notice that Javascript tries to convert the 10 into a string (as expected) and I was wondering what should I change within my code for the output the be the actual sum of the value theNumber(that the user will choose) plus the number 10.
has comment: http://stackoverflow.com/comment/44645167
accepted answer: http://stackoverflow.com/a/28136691
score: 0
has answer: http://stackoverflow.com/a/28136812
possible better answer: http://stackoverflow.com/a/28136689
has answer: http://stackoverflow.com/a/28136689
answer count: 4
has title: How can I get the correct output?
has answer: http://stackoverflow.com/a/28136692
type: AnsweredQuestion

http://stackoverflow.com/a/28177116
has body: You can achieve this with a pretty simple regex: var originalstring = "../PeopleImages/GGP/Person_3281.jpg"; var lastpiece = /[^/]*$/.exec(originalstring)[0]; reference
answers question: http://stackoverflow.com/q/28177031
score: 0
type: Answer

http://stackoverflow.com/comment/44692289
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28159244
has text: The latter way would mean you need to guarantee no two modules repeat routes. otherwise you will have two views showing at once.

http://stackoverflow.com/comment/44790159
has text: Yeah, thanks. Was too focused on the disabled check :D
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28213199

http://stackoverflow.com/comment/44858103
type: Comment
has text: Just a suggestion: your code would probably work better if, instead of redirecting, you just did a GET or POST request and did something based on the return.
comment on: http://stackoverflow.com/q/28248981
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44659370
type: AnswerComment
comment on: http://stackoverflow.com/a/28143738
type: Comment
has text: Inside your module they are simply called private variables. Like in any programming language, private variables make sense for internal stuff you don't want to expose your module consumers to. Dependency injection is definitely the way to go in your example, though. You should strive to limit dependencies between your classes as much as possible so it is easier to test and to refactor.
score: 0

http://stackoverflow.com/comment/77603065
comment on: http://stackoverflow.com/a/45295575
score: 2
type: AnswerComment
has text: Every promise can get the previous value, what's your meaning?
type: Comment

http://stackoverflow.com/a/28278278
has body: Using the Highcharts API, when defining the menu you can just add the following code as an element in the exporting.buttons.contextButton.menuItems array: { separator: true } The following code would be added directly inside your chart options and shows how to separate every single item (see it on JSFiddle): exporting: { buttons: { contextButton: { menuItems: [{ textKey: 'printChart', onclick: function () { this.print(); } }, { separator: true }, { textKey: 'downloadPNG', onclick: function () { this.exportChart(); } }, { separator: true }, { textKey: 'downloadJPEG', onclick: function () { this.exportChart({ type: 'image/jpeg' }); } }, { separator: true }, { textKey: 'downloadPDF', onclick: function () { this.exportChart({ type: 'application/pdf' }); } }, { separator: true }, { textKey: 'downloadSVG', onclick: function () { this.exportChart({ type: 'image/svg+xml' }); } }] } } }
has comment: http://stackoverflow.com/comment/44951019
has comment: http://stackoverflow.com/comment/44938033
upvote count: 5
score: 5
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28276592

http://stackoverflow.com/a/28179535
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28179440
downvote count: 0
has body: .getElementsByTagName("td") returns a NodeList, you will have to loop through each td and assign the border individually. You also need to specify the borderWidth and borderStyle properties. function changeBorderColor() { var td = document.getElementById("table_row").getElementsByTagName("td"); for (i = 0; i < td.length; i++) { td[i].style.borderColor = "red"; td[i].style.borderWidth = "1px"; td[i].style.borderStyle = "solid"; } } changeBorderColor() Computers Price Location

http://stackoverflow.com/a/28283192
upvote count: 1
has body: As I stated in my comment, under the hood c3 is using a d3.xhr to retrieve the data. This is an async call meaning that it's outside of your try block. Possible workarounds include: 1.) fix it in the c3 source code At line 1903, you see the error is being dropped. 2.) create a global error handler 3.) don't use c3's url option. Issue your own d3 xhr request (handle the error the proper way there) and if successful, then call c3.generate with the columns option. This is the way I'd do it. d3.csv("path/to/file.csv", function(error, json) { if (error){ // handle error properly return; } c3.generate({ ... }); });
score: 1
has comment: http://stackoverflow.com/comment/44922675
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28262940
type: Answer
answers question: http://stackoverflow.com/q/28262940

http://stackoverflow.com/comment/44781790
score: 0
comment on: http://stackoverflow.com/q/28208512
type: Comment
type: QuestionComment
has text: You can try use this plugin https://github.com/HondaDai/PhoneGap-WifiInfoPlugin

http://stackoverflow.com/comment/44702362
type: QuestionComment
comment on: http://stackoverflow.com/q/28152193
has text: @merso0027 if you wish I can update my code...
score: 0
type: Comment

http://stackoverflow.com/comment/44815302
type: QuestionComment
comment on: http://stackoverflow.com/q/28225990
has text: it calls it once because of the setTimeout call
score: 1
type: Comment

http://stackoverflow.com/comment/44848572
type: AnswerComment
has text: You misunderstand. Some of my ` ` elements will not contain `` elements. I need to apply classes only to ` `s whose child ``s are currently being hovered over.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28243771

http://stackoverflow.com/q/28194518
upvote count: 1
tagged with: php
tagged with: css
has body: How to add images to JQuery autocomplete which also fills hidden data inputs?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44756311
has comment: http://stackoverflow.com/comment/44756939
type: Question
has comment: http://stackoverflow.com/comment/44756413
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
has answer: http://stackoverflow.com/a/28194711
has comment: http://stackoverflow.com/comment/44756446
has answer: http://stackoverflow.com/a/28194956
accepted answer: http://stackoverflow.com/a/28194711
has comment: http://stackoverflow.com/comment/44756057
tagged with: http://stackoverflow.com/tag/html
has title: How to add images to JQuery autocomplete which also fills hidden data inputs?
has comment: http://stackoverflow.com/comment/44756574
possible better answer: http://stackoverflow.com/a/28194956
favorite count: 0
has comment: http://stackoverflow.com/comment/44756274

http://stackoverflow.com/a/28212018
answers question: http://stackoverflow.com/q/28211074
score: 0
type: Answer
has body: The problem is that in your JSON should be fields x and y. Morever values should be number not string as you have. So you should prepare correct JSON structure in your backend or parse it after loading.

http://stackoverflow.com/q/28131026
favorite count: 0
tagged with: raycasting
tagged with: three.js
type: AnsweredQuestion
score: 3
has title: threejs raycasting - intersections between camera and a loaded obj model
upvote count: 3
tagged with: webgl
tagged with: collision-detection
has answer: http://stackoverflow.com/a/28157762
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28157762
has body: I'm moving a camera through a scene that contains an obj I've loaded as a mesh, and I want to detect if the camera has collided with any of the walls of my obj. I've based my code off this threejs example: http://threejs.org/examples/misc_controls_pointerlock.html, and tried to apply your example here: http://stemkoski.github.io/Three.js/Collision-Detection.html - but I can't seem to get a collision. My example is here and the relevant javascript is here: If anyone can point me in the right direction on how to detect a collision, I'd be grateful. Here's the relevant piece of code: var objects = []; var oLoader = new THREE.OBJLoader(); //oLoader.load('models/chair.obj', function(object, materials) { oLoader.load('models/model-for-threejs.obj', function(object, materials) { // var material = new THREE.MeshFaceMaterial(materials); var material = new THREE.MeshLambertMaterial({ color: 0x000000 }); //var material = new THREE.MeshBasicMaterial({wireframe: true}); object.traverse( function(child) { if (child instanceof THREE.Mesh) { //objects.push(child); //MH - not sure if the object needs to be added here or not, but if I do, this really bogs down things down } }); object.position.x = 0; object.position.y = 12; object.position.z = 0; scene.add(object); objects.push(object); }); } var curPos = controls.getObject().position; //gives the position of my camera raycaster.ray.origin.copy( curPos ); //raycaster.ray.origin.y -= 10; raycaster.ray.origin.z +=10; //guessing here, but since I'm moving in 2d space (z / x), maybe I should be moving my ray ahead in z space? var intersections = raycaster.intersectObjects( objects ); // var isOnObject = intersections.length &gt; 0; if (isOnObject){ console.log('collide' }; //MH - nothing happening here
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/44654621
comment on: http://stackoverflow.com/q/28141392
score: 0
type: Comment
type: QuestionComment
has text: So the red square represents the page right? And on actual note page it will work right ?! If so then yes that is what I want

http://stackoverflow.com/q/28194166
has comment: http://stackoverflow.com/comment/44755350
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44756956
tagged with: css
has answer: http://stackoverflow.com/a/28194484
has comment: http://stackoverflow.com/comment/88570403
linked to: http://stackoverflow.com/q/14544481
has body: I'm trying to iterate through CSS styles. For example I get a style like this: document.styleSheets[0].cssRules[10].style That returns a CSSStyleRule which is an object with both integer and string keys. The integer and .length keys can be used to iterate through the property assignments in the style, and each one gives the name of the property, for example: document.styleSheets[0].cssRules[10].style[0] == "max-height" The string keys give access to the actual actual text for the style like this: document.styleSheets[0].cssRules[10].style["maxHeight"] == "100px" So in theory it is easy to iterate through all the properties. But notice the maddening change from max-height to maxHeight! How can I deal with this? How do I even know what this mapping is? Do I just have to write a function that converts every -a to A and so on?
upvote count: 1
tagged with: stylesheet
linked to: http://stackoverflow.com/q/2664045
type: Question
score: 1
has comment: http://stackoverflow.com/comment/44756792
downvote count: 0
answer count: 1
tagged with: javascript
has title: Iterating through CSS styles - style naming inconsistency
linked to: http://stackoverflow.com/q/2531737
favorite count: 0

http://stackoverflow.com/q/28166709
tagged with: jersey
tagged with: javascript
score: 0
tagged with: jpa
answer count: 1
has title: Convert/map inputs of date (day, month, year) into java.time.LocalDate
tagged with: angularjs
has answer: http://stackoverflow.com/a/28166956
has body: This is what we have in the interface: I pasted the parts of the code what I thought that are relevant, but maybe something more is required. How it works When the button is pushed, the userController.js save method is invoked. In the controller there is a $resource and the $save method is "connected" with the create method in UserController.java, and there is persisted. The problem In the interface I have three inputs (dd, mm, yy) and what I want to persist is a User with a java.time.LocalDate. How and where should I do the map/transformation of these three inputs to convert then in a LocalDate? Because obviously, the way the User is defined in the .js and the way is defined in .java are differents. In the frontend user.html Date of Birth Enter Day Enter Month Enter Year userController.js $scope.user = new UserService(); $scope.save = function() { $scope.user.$save(function() { $location.path('/'); }); }; UserService.js return $resource('rest/user/:action', {},.... In the backend UserController.java @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public User create(User user) { LOGGER.info("create(): " + user); return this.userDao.save(user);; } Entity @Column(nullable = false) @Convert(converter = LocalDatePersistenceConverter.class) private LocalDate birthDate;
linked to: http://stackoverflow.com/q/27768866
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28166956
has comment: http://stackoverflow.com/comment/44704902

http://stackoverflow.com/comment/44892802
has text: `slideUp` expects a function. `last` is a function. `last()` calls the function `last`. Not the same thing.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28268338

http://stackoverflow.com/comment/44803850
score: 0
type: QuestionComment
type: Comment
has text: I am inclined to close this question as a duplicate. However, you seem to have done some research. Perhaps this question and answer might help clear the doubts you have: http://stackoverflow.com/q/12930272/783743
comment on: http://stackoverflow.com/q/28220219

http://stackoverflow.com/a/28129585
accepted answer of: http://stackoverflow.com/q/28129486
has comment: http://stackoverflow.com/comment/44632152
has comment: http://stackoverflow.com/comment/44632612
answers question: http://stackoverflow.com/q/28129486
type: AcceptedAnswer
has body: The problem here is that you have a closure variable el that you are overwriting every time display() is called. The hide() function uses whatever is the current value of el at the time it is called, so overwriting el is a problem. If you want to have "static" functionality like this display() method, you need to avoid shared state. As @Bergi points out in the comments, you can eliminate the shared el and modify hide() to take an element as input: var messageHandler = (function(){ var el; // delete this var display = function(a){ var el; // add this function registerClick(el){ el.bind('click', function(){ hide(p_el); }); } function hide(el){ el.css('display','none'); } You could also modify hide to make use of the current event properties, and then just have: function registerClick(el){ el.bind('click', hide); } function hide(event){ $(event.target).css('display','none'); } Cleaned up version including the auto-hide discussed in the comments: var messageHandler = (function(){ var display = function(a){ var el = $('.' + a); el.css('display', 'block'); var hideAction = function () { el.css('display', 'block'); }; var token = setTimeout(hideAction, 5000); el.find('.close').bind('click', function () { hideAction(); clearTimeout(token); }); return this; } return { display: display } })();
downvote count: 0
has comment: http://stackoverflow.com/comment/44632116
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44632500
score: 2
has comment: http://stackoverflow.com/comment/44632377

http://stackoverflow.com/a/28197188
answers question: http://stackoverflow.com/q/28197032
has comment: http://stackoverflow.com/comment/44766273
has body: You are doing almost everything correctly: you are returning a promise generated by $q.all and you are further returning it in the resolve. The bug is that you are not creating an array of promises, but rather you pushed a deferred object into the array. So, change it like so: var promises = []; var teamDefer = $q.defer(); promises.push(teamDefer.promise); UserService.team('me', function(data) { teamDefer.resolve(data); }, function() { teamDefer.reject(); }); Then you can return $q.all() (as you do): return $q.all(promises); Slightly off-topic: promiseData is incorrectly named, in my opinion, that may indicate a misunderstanding. You should name the variable as the name of the result of you will get. This is what will be injected into your controller, which would not care whether it came from a promise or not. So, probably better to name it team (or something like that)
downvote count: 0
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/q/28269846
type: Question
has comment: http://stackoverflow.com/comment/44974040
has answer: http://stackoverflow.com/a/28273676
tagged with: javascript
score: 0
answer count: 1
tagged with: oracle-apex
has body: I need to be able to jump to a location in a base page. The base page contains a &lt;a id='jump_here'&gt;&lt;/a&gt; tag used to define the target location. Then, o the child page, the code below: htp.p('&lt;script language="JavaScript" type="text/javascript"&gt;'); htp.p('// &lt;!--'); htp.p('window.location = "f?p=&amp;APP_ID.' || chr(58) || '401' || chr(58) || '&amp;SESSION.' || chr(58) || chr(58) || '&amp;DEBUG.' || chr(58) || chr(58) || 'P401_ID";' ); htp.p('window.location.hash = "jump_here";'); htp.p('// --&gt;'); htp.p('&lt;/script&gt;'); The problem is this doesn't work. Could someone please let me know what i'm doing wrong? Thank you
has comment: http://stackoverflow.com/comment/44972957
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Jump to page location on base page using JavaScript in ApEx
has comment: http://stackoverflow.com/comment/44901859

typeahead
type: Tag
tags question: http://stackoverflow.com/q/28229348
tag name: typeahead

http://stackoverflow.com/comment/44898133
type: QuestionComment
comment on: http://stackoverflow.com/q/28271314
type: Comment
score: 0
has text: I don't see any PHP code! Is this related to php? -> Show us your php code

http://stackoverflow.com/q/28235851
linked to: http://stackoverflow.com/q/13753539
tagged with: cordova
tagged with: database-connection
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44833560
has title: How to create database in PhoneGap?
has body: I am new in android PhoneGap. &lt;script type="text/javascript" charset="utf-8" src="js/cordova.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var db = window.openDatabase("raddyx", "1.0", "Cordova Demo", 200000); db.transaction(populateDB, errorCB, successCB); } function populateDB(tx) { tx.executeSql('DROP TABLE IF EXISTS DEMO'); tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)'); tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")'); } function errorCB(tx, err) { alert("Error processing SQL: "+err); } function successCB() { alert("success!"); } &lt;/script&gt; I am using above sample code. My database name raddyx. I am unable to create database. Can you please say me how to create raddyx database in PhoneGap? Edit - When i run it in my mobile it says Unfortunately, APP_NAME_HERE has stopped. If i remove my connection code it works fine.
type: Question
linked to: http://stackoverflow.com/q/24862069
has comment: http://stackoverflow.com/comment/44833259
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28236062
tagged with: android
has comment: http://stackoverflow.com/comment/44833332

alert
tags question: http://stackoverflow.com/q/28219858
tags question: http://stackoverflow.com/q/28210487
tags question: http://stackoverflow.com/q/28245541
tags question: http://stackoverflow.com/q/28172526
type: Tag
tags question: http://stackoverflow.com/q/28193744
tags question: http://stackoverflow.com/q/28217125
tags question: http://stackoverflow.com/q/28154180
tag name: alert
tags question: http://stackoverflow.com/q/28249946

http://stackoverflow.com/q/28276628
type: Question
has comment: http://stackoverflow.com/comment/44907739
upvote count: 0
tagged with: javascript
has body: So.. I understand that innerHTML is very buggy (although in my code it's working perfectly) but I prefer to covert my code from innerHTML to appendChild. JSFiddle: http://jsfiddle.net/qrLsjjdg/ Here is my code (which is working perfectly) : attach another file BUT... How do I convert it all to appendChild?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Javascript:: From innerHTML to appendChild
favorite count: 0
tagged with: innerhtml
type: UnansweredQuestion
score: -3
has answer: http://stackoverflow.com/a/28276869
has comment: http://stackoverflow.com/comment/44907718
tagged with: appendchild
downvote count: 3

http://stackoverflow.com/comment/44818332
has text: @JackPattishall Even if you start with zero it didn't work
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28227621

http://stackoverflow.com/comment/44649522
comment on: http://stackoverflow.com/q/28138878
has text: @arkascha I do not want people to copy my work and using it for their own purpose without attribute/licencing.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44862978
comment on: http://stackoverflow.com/q/28251886
type: Comment
has text: beforeEach will get called for every test
type: QuestionComment
score: 1

http://stackoverflow.com/q/28130114
type: Question
score: 21
tagged with: autocomplete
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28130182
tagged with: google-maps-api-3
answer count: 2
tagged with: google-maps
downvote count: 0
favorite count: 0
has title: google.maps.places.Autocomplete language output
possible better answer: http://stackoverflow.com/a/41476640
has answer: http://stackoverflow.com/a/41476640
type: AnsweredQuestion
has body: I am using google.maps.places.Autocomplete object and always get results in Ukrainian language. I am loading library like that http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=ru-RU how to pass parameters to autocomplete language? var autocomplete = new google.maps.places.Autocomplete($("#google_places_ac")[0], {}); google.maps.event.addListener(autocomplete, 'place_changed', function() { var place = autocomplete.getPlace(); $scope.location = place.formatted_address; // at that point $scope.location is in ukrainen, but I want Russian $scope.$apply(); }); I've added image explains the problem. Text that squared with RED - is on Russian, text with Green - is on Ukraine. As you can see there is two different languages on the same map. Also input with Russian, and formatted language with Ukrainian. I believe this is a bug of Google map.s
upvote count: 21
has answer: http://stackoverflow.com/a/28130182

http://stackoverflow.com/comment/44799601
type: QuestionComment
has text: Did you include all of the resource files like this demo: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/color-axis/
score: 0
comment on: http://stackoverflow.com/q/28217575
type: Comment

http://stackoverflow.com/comment/44661587
type: QuestionComment
comment on: http://stackoverflow.com/q/28144858
score: 0
has text: @georg any suggestions for how can I ensure I can always access whatever is in actual_JSON then?
type: Comment

padding
tags question: http://stackoverflow.com/q/28199173
tag name: padding
type: Tag

http://stackoverflow.com/q/28135409
tagged with: meteor
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28136613
upvote count: 1
tagged with: meteor-accounts
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44644027
has comment: http://stackoverflow.com/comment/44644094
type: Question
has title: Why does Meteor.users.findOne({username: "test"}) returns an object but replacing "test" with variable that has the same value returns undefined
tagged with: mongodb
has answer: http://stackoverflow.com/a/28136613
has body: var usr = []; var chatUsers = Session.get("newChatUser"); for ( i in chatUsers ) { var a = chatUsers[i]; var id = Meteor.users.findOne({ username : a }); usr.push({ uid : id._id, name : a }); } Here id becomes undefined when a is "test" but when I run Meteor.users.findOne({ username : "test" }) in browser console, it returns the correct object. Whats wrong with my code?
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44642925
tagged with: javascript
has comment: http://stackoverflow.com/comment/44646455
has comment: http://stackoverflow.com/comment/44643819
favorite count: 0

http://stackoverflow.com/q/28232006
has body: so I have an array which looks like this var graphData = [{ data: [[1, 1300], [2, 1600], [3, 1900], [4, 2100], [5, 2500], [6, 2200], [7, 1800]} What I would like is instead of 1,2,3 etc. in the array to fill it it with the yesterdays weekday and go backwards. So for example today is friday, so first object would be ["thursday", 1300], next object would be ["wednesday",1600] and so on untill all weekdays are selected. And tomorrow the arrays first object would be friday, then thursday etc. What is the best way to do this?
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: Fill an array with current day and continue backwards
favorite count: 0
has answer: http://stackoverflow.com/a/28232254
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/28232254
downvote count: 1

http://stackoverflow.com/a/28140046
answers question: http://stackoverflow.com/q/28139088
accepted answer of: http://stackoverflow.com/q/28139088
upvote count: 1
has body: In your mouseDown handler you need to check if event.target is that draggable element: var mouseDown = function(event){ console.log('mouseDown'); event.preventDefault(); if( event.target === element ) { startX = event.pageX - x; startY = event.pageY - y; $document.on('mousemove', mouseMove); $document.on('mouseup', mouseUp); } }
type: Answer
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28261064
has comment: http://stackoverflow.com/comment/44879432
accepted answer: http://stackoverflow.com/a/28261136
has comment: http://stackoverflow.com/comment/44879274
type: Question
has title: Console.log javascript not working in web browser
downvote count: 0
has comment: http://stackoverflow.com/comment/44879283
tagged with: javascript
has answer: http://stackoverflow.com/a/28261136
answer count: 1
tagged with: console.log
favorite count: 0
upvote count: 2
has body: I am trying to use console log to log the date in the console log but it is not working. Here is my code: setInterval(function(){ console.log(new Date()); },1000); As you see this code is simple and should run because no syntax errors that are there. But when i use Firefox console log i should see the new date popping every 1 second. But i get these errors: SyntaxError: syntax error SyntaxError: syntax error The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44879385
score: 2
has comment: http://stackoverflow.com/comment/44879292

http://stackoverflow.com/comment/44832359
score: 0
has text: Your "cleaned up" fiddle still doesn't have any markers on it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28229673

http://stackoverflow.com/q/28263773
has title: Safe way to check if array element exists?
score: 27
upvote count: 27
tagged with: arrays
has answer: http://stackoverflow.com/a/28264019
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28263837
tagged with: element
tagged with: multidimensional-array
has answer: http://stackoverflow.com/a/64507315
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/64507315
accepted answer: http://stackoverflow.com/a/28263837
type: Question
has body: I have a 2D array. I currently access that array using notation such as: myArray[5][9] (for example). What is the safest way to check whether or not a certain array element exists? For example, let's say I am looping through the array and retrieving a property of each array element like so: myArray[5][9].firstName I then come to myArray[9][11].firstName (for example) which doesn't exist. Clearly this will throw an exception as the element doesn't exist. How can I deal with this? I'm not looping through the entire array (i'm accessing it's contents randomly and say using myArray.lengthin a for loop will not work. Is there a JS function / method for checking whether or not an array element exists? Thanks.
has comment: http://stackoverflow.com/comment/44884342
tagged with: null
has answer: http://stackoverflow.com/a/28263815

http://stackoverflow.com/comment/44624898
has text: You could make some experiments with memcachd.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28125821

http://stackoverflow.com/a/28192256
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28192218
has body: try this var variablename= (e.keyCode ? e.keyCode : e.which); if(code == 13) { //keycode of Enter key alert('enter key pressed'); } if you are using jquery $('input[type=text]').on('keyup', function(e) { if (e.which == 13) { e.preventDefault(); } });
answers question: http://stackoverflow.com/q/28192218

http://stackoverflow.com/comment/44856872
has text: Shouldn't it be `style=display: none` instead of `hidden`?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28248286
type: Comment

http://stackoverflow.com/a/28196923
score: 2
answers question: http://stackoverflow.com/q/28194814
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28194814
type: AcceptedAnswer
downvote count: 0
has body: It's a bug. WEB-13724 is fixed, fix will be included in WebStorm 10
type: Answer

http://stackoverflow.com/q/28140797
has answer: http://stackoverflow.com/a/28140821
accepted answer: http://stackoverflow.com/a/28140821
tagged with: javascript
has title: Same selectors click add and remove
has body: I like to get different content in the same place one at a time. So when the user clicks "Select me 1" it opens Lorem ipsum 1 and if he clicks "Select me 3" the code will remove the display block from the Content1Box. Here is my DOM and JSFIDDLE Lorem ipsum 1 Lorem ipsum 2 Lorem ipsum 3 Select me 1 Select me 2 Select me 3 $('#contentSelection .contentSelect').on('click',function(){ TweenMax.to(("#"+ $(this).attr('id') + "box"), 0.5, {display: "block", delay:0.5}); }); I am using TweenMax for the animation this one.
upvote count: 2
answer count: 1
tagged with: jquery
tagged with: gsap
favorite count: 0
has comment: http://stackoverflow.com/comment/44653509
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
downvote count: 0
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/28227661
type: UnansweredQuestion
type: Question
score: 0
has title: jquery ajax response not loaded into page
has comment: http://stackoverflow.com/comment/44818401
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I'm following http://code.tutsplus.com/tutorials/quick-tip-cross-domain-ajax-request-with-yql-and-jquery--net-10225 . I have a series of buttons on my page . When I click CNN it activates: case "CNN": requestCrossDomain('http://www.cnn.com', function(results) { $('#cnn').html(results); });javasc I have: in my markup. When I click the button I can see the ajax request returning a response but nothing appears on my page. What am I doing wrong?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44818377
answer count: 0

http://stackoverflow.com/a/28129405
score: 2
has body: Node has a built in way to check for valid files function File(file){ if (file instanceof File) return file; if (!(this instanceof File)) return new File(file); if (typeof file !== "string") throw new Error("Useful error." + typeof(file)); var stat = fs.statSync(file); if ( stat &amp;&amp; stat.isFile() ) { this.fullName = file; /*vvvvvvvvvvvv Important Bit vvvvvvvvvvvvvv*/ this.baseName = /.+(?=\.[^.]+)/.exec(file)[0]; this.extension = /[^.]+(?=$)/.exec(file)[0]; } } Node also has a built in way to get extensions and path names var path = require('path'); var basename = path.basename(file); var extension = path.extname(file);
downvote count: 0
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28129272
answers question: http://stackoverflow.com/q/28129272
type: Answer

http://stackoverflow.com/a/28171619
has comment: http://stackoverflow.com/comment/44712521
upvote count: 1
has comment: http://stackoverflow.com/comment/44712779
has comment: http://stackoverflow.com/comment/44713259
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44712736
score: 1
accepted answer of: http://stackoverflow.com/q/28171471
answers question: http://stackoverflow.com/q/28171471
type: Answer
has body: identifierchange your HTML to following &lt;div ng-controller="CustomWidgetCtrl" plumb-item class="item" style=" top: 50px; left: 110px; height: 500px; width: 500px; " ng-repeat="widget in dashboard.widgets" ng-style="{ 'left':widget.sizeX, 'top':widget.sizeY }" data-identifier="{{widget.id}}" resizeable ng-click="resize(widget) &gt; ... ... And you directive to following routerApp.directive('resizeable', function() { return { restrict: 'A', link: function(scope, element, attrs) { var widgetId = attrs.identifier; ... ...
has comment: http://stackoverflow.com/comment/44712973

http://stackoverflow.com/comment/44738753
type: Comment
type: QuestionComment
has text: The `document.write` theoretically should work as this will block the execution of the following script. Might be a problem with the `<\/script>`, but this is a very bad solution anyway. It would be better to add a listen for the `load` even of the script, and put the following code into a function that will be called by the load callback.
comment on: http://stackoverflow.com/q/28184887
score: 0

http://stackoverflow.com/a/28245629
accepted answer of: http://stackoverflow.com/q/28245529
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28245529
type: Answer
has body: You can bind the value of this using the bind() method function Rotation(mass) { this.mass = mass; this.angle = 0; this.velocity = 1; this.handler = null; this.rotate = function () { this.angle = (this.angle + this.velocity) % 360; var transform = "rotate(" + this.angle + "deg)" this.mass.elm.style.webkitTransform = transform; //call bind on this.rotate so we can properly associate this window.requestAnimationFrame(this.rotate.bind(this)); }; this.start = function () { //then just start the animation by using this.rotate() this.rotate(); }; } Working JSFiddle: http://jsfiddle.net/gvr16mcL/
upvote count: 1
has comment: http://stackoverflow.com/comment/44852802
score: 1

http://stackoverflow.com/a/28250706
downvote count: 0
has comment: http://stackoverflow.com/comment/44878749
has comment: http://stackoverflow.com/comment/44880971
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28249386
has body: You can use Angular version of Highcharts It has been highly used Graph API. Below are the steps to configure Angular HighCharts API inside your app Install with bower/npm: bower install highcharts-ng Add references to highcharts/highstocks or var myapp = angular.module('myapp', ["highcharts-ng"]); Add Highcharts to your angular app config
has comment: http://stackoverflow.com/comment/44878736

http://stackoverflow.com/q/28124380
tagged with: javascript
tagged with: sorting
favorite count: 0
has answer: http://stackoverflow.com/a/28124653
tagged with: input
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44622403
has body: I have a simple textarea which I input somthing like: 1,7,5,2,30 then I put the numbers in Array,when I try to sort the Array ,it actually separate 30 into "3" and "0".and give me result of : 0,1,2,3,5,7 . what I want is: 1,2,5,7,30 .how to solve this? Thanks. here is the Code: var textArea = document.getElementById("myTextArea"); var array=[]; var sortedArray=[]; var i=j=len=0; myButton.onclick = function () { myFunc(); } function myFunc() { array = textArea.value; for(i=0,len=array.length ; i&lt;len ; i++) { if(array[i] != ",") { sortedArray[j] = array[i]; ++j; } } console.log( sortedArray.sort(function (a,b) { return a-b; }) ); }
type: AnsweredQuestion
tagged with: numbers
accepted answer: http://stackoverflow.com/a/28124653
has title: How to sort number in a separated by comma in JavaScript?
score: -1
type: Question
has comment: http://stackoverflow.com/comment/44622230
tagged with: arrays
answer count: 1

http://stackoverflow.com/comment/44661186
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28142742
type: Comment
has text: That would be my last option :(

http://stackoverflow.com/comment/44771581
has text: @Sectona -- It's difficult to know for sure without seeing more of your code (and how you chose to implement the inner blocks of the conditionals at the bottom). Are you getting any messages in the console (ex: test in Chrome and use Ctrl+Shift+J)? The only thing I changed with your click handler for the send button was to add `window.localStorage["ldate"] = new Date();` to the success function of your ajax call. I don't think that would hurt anything.
comment on: http://stackoverflow.com/a/28181120
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44788777
has text: `$dom->loadHTML(file_get_contents('http://www.example.com/index.php'));`
comment on: http://stackoverflow.com/q/28212366
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44850706
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28223802
has text: @RickTicky - Yes, I don't see why not.. If you will be doing any calculations that involve the cost you got from the `if` statement, you first need to make sure it is !== "Invalid ID", and then [parseFloat](http://www.w3schools.com/jsref/jsref_parsefloat.asp) it to get it's actual value in digits and not as a string.
type: AnswerComment

http://stackoverflow.com/comment/44849403
has text: Sadly I am not entirely sure what you mean by this. But the span option using the background-img and my path sounds like it would work. Would this be applied to the ?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28243822

http://stackoverflow.com/a/28184255
accepted answer of: http://stackoverflow.com/q/28184177
upvote count: 18
type: Answer
downvote count: 0
has body: First off, IDs must be unique, so why not use classes here instead? Second, if you're using jQuery, then use jQuery. Third, you need to use event delegation when dynamically adding elements, so try the following: $('#myTable').on('click', 'input[type="button"]', function () { $(this).closest('tr').remove(); }) $('p input[type="button"]').click(function () { $('#myTable').append(' ') });
score: 18
has comment: http://stackoverflow.com/comment/44738772
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28184177

http://stackoverflow.com/a/28232397
answers question: http://stackoverflow.com/q/28231105
has comment: http://stackoverflow.com/comment/44827584
has comment: http://stackoverflow.com/comment/44827400
score: 0
has comment: http://stackoverflow.com/comment/44827043
has body: Instead of using plugin for something so simple... why don't you just do something like - if($("#element").css("display") == "none") { .. } or if($("#element").css("visibility") == "hidden") { .. } depending upon what you mean by visibility.
type: Answer

http://stackoverflow.com/a/29777275
answers question: http://stackoverflow.com/q/28240731
downvote count: 0
has body: Why not use absolute paths? &lt;!-- build:js /scripts/main.min.js --&gt; &lt;!-- build:js /scripts/about.min.js --&gt; You would then need to move your index files to the correct locations using other gulp tasks that could depend on the above task. gulp.task('full-build', ['partial-build'], function () { gulp.src('index.html', { base: './' }) .pipe(gulp.dest(buildLocation)); });
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/44899431
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28272026
type: Comment
has text: You should submit `imageData` obtained by calling `export` method, to the server rather than the file selected in the fileinput.

http://stackoverflow.com/comment/44643194
score: 0
has text: is there any way that i could load and append the div in the container. do i need to have any php doing this, in the middle of this process?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28135408

http://stackoverflow.com/comment/44675573
comment on: http://stackoverflow.com/q/28152140
type: Comment
type: QuestionComment
score: 3
has text: Why you need duplicated code and elements ? If you just want to add a class why you don't do that and call it with mediaqueries?

http://stackoverflow.com/comment/44787925
type: Comment
comment on: http://stackoverflow.com/a/28211840
score: 0
type: AnswerComment
has text: @WeaselFox: from what I can see in that link, the available modifications are extremely limited. For what you're trying to do: no.

http://stackoverflow.com/a/28166587
accepted answer of: http://stackoverflow.com/q/28166294
answers question: http://stackoverflow.com/q/28166294
type: Answer
has body: This is a styling issue with inline-block elements. To fix, add vertical-align: bottom style. {{goals}}
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28252637
score: 1
type: AcceptedAnswer
downvote count: 0
has body: There's some uncertainty in what is meant by "legal inputs" in the context of JavaScript. A function can be invoked with any number of arguments, regardless of how it is defined. That said, I don't think JavaScript functions are inherently either. This can't be answered in the general case. Certainly partial functions are easy to produce, but I think total functions (by your definition) are also possible: function total_function(i) { return 1; } Here, all possible inputs yield an output of 1. It doesn't matter whether you invoke the function as total_function() or total_function(1, 2, 3, 4, 5, 6, 7) or total_function('this is a string').
answers question: http://stackoverflow.com/q/28252436
has comment: http://stackoverflow.com/comment/44864365
type: Answer
accepted answer of: http://stackoverflow.com/q/28252436
upvote count: 1

http://stackoverflow.com/a/28756116
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28204517
type: Answer
answers question: http://stackoverflow.com/q/28204517
has body: Finally, I did it the way it is shown in here: http://codepen.io/paulbhartzog/pen/xBFir $scope.options = [ { label: 'one', value: 1 }, { label: 'two', value: 2 } ]; $scope.selected_by_reference = $scope.options[1];

http://stackoverflow.com/q/28187306
answer count: 2
has body: I wrote a short AJAX code which is getting Facebook contents from a PHP file (in the PHP file I have declared class="gallery-img-link" as &lt;a&gt; and class="img-responsive img-thumbnail" as &lt;img&gt;). I have the gallery-img-link on the bottom of site as jQuery script, the problem is when I add those classes by hand its working fine, but when I try to load those by a AJAX get request it seems to doesn't work. Should I use it in a document.ready function? I have tried live as well, but that didn't helped at all. $(document).ready(function(){ $(\'#loading-image\').show(); $.ajax({ method:\'get\', url:\'ajax.php\', success:function(data){ $("#facebook").html(data); }, complete: function(){ $(\'#loading-image\').hide(); } }); });
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44742889
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/28187472
has answer: http://stackoverflow.com/a/28187472
has answer: http://stackoverflow.com/a/28192045
has title: AJAX isn't loading the other js and css style
has comment: http://stackoverflow.com/comment/44743166
has comment: http://stackoverflow.com/comment/44743333
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/44743369
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28192045
has comment: http://stackoverflow.com/comment/44743273
type: Question

http://stackoverflow.com/comment/44638004
has text: You want to store the order of the divs in the DB?
type: QuestionComment
comment on: http://stackoverflow.com/q/28132771
score: 0
type: Comment

http://stackoverflow.com/comment/44730208
comment on: http://stackoverflow.com/q/28180544
type: Comment
has text: 1 What have you tried so far (jquery) and 2 why are you putting a div inside a label?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44785268
type: Comment
comment on: http://stackoverflow.com/q/28210299
score: 0
type: QuestionComment
has text: Posted, please look, thanks

http://stackoverflow.com/comment/44764617
comment on: http://stackoverflow.com/a/28198857
score: 0
type: Comment
has text: @Barmar It's easier to prevent global access from `new Function` than `eval`. You can also prepend wrapper code to hide unwanted variables, or (more practically) modify the scope or `this` of the function to call it in the context of some event or object.
type: AnswerComment

http://stackoverflow.com/comment/44732849
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28180419
score: 0
has text: just updated my answer. now the service will just fetch the new data every interval and the controllers will update the specific values they're listening to.

http://stackoverflow.com/q/28263984
accepted answer: http://stackoverflow.com/a/28264308
has comment: http://stackoverflow.com/comment/44885041
upvote count: 1
possible better answer: http://stackoverflow.com/a/28264051
has comment: http://stackoverflow.com/comment/44885263
has answer: http://stackoverflow.com/a/28264051
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44884754
type: Question
has comment: http://stackoverflow.com/comment/44885153
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44884975
has answer: http://stackoverflow.com/a/28264308
has title: check for hasClass to add class
favorite count: 0
has comment: http://stackoverflow.com/comment/44884787
has body: I have a small panel that slides out from the bottom. It has a chevron up icon. I am building a jquery snippet that bring it up (opens it) and closes it but all it must change the chevron from up to down. The opening and closing is working and the chevron changes when it opens but it doesn't reset back to chevron up when it closes. Something is wrong in my conditional statement. This is what I have so far &lt;script&gt; $("#openchat").click(function(){ $("#floatingmenu").toggleClass("chatbox-open"); if ($(this).hasClass("chatbox-open")) { $(this).removeClass("fa-chevron-up"); $(this).addClass("fa-chevron-down"); } else if (!$(this).hasClass("chatbox-open")) { $(this).addClass("fa-chevron-down"); $(this).removeClass("fa-chevron-up"); } }); &lt;/script&gt; I am attaching a CODEPEN DEMO BTW, my .chatbox-open class is what opens it and closes it. The other classes are simple font-awesome classes for the icons Any help please

http://stackoverflow.com/q/28135388
has body: How do I get the data when there is only a glyphicon in the anchor tag? Below is a demonstration of the problem... http://jsfiddle.net/sua0yp4y/2/ HTML: OUTPUT1 OUTPUT2 OUTPUT3 OUTPUT4 without icon JS: $('body').on('click','a.withIcon',function(e){ e.preventDefault(); $("h1#output1").text($(e.target).data('userid')); $("h1#output2").text($(e.target).data('taskid')); }); $('body').on('click','a.withoutIcon',function(e){ e.preventDefault(); $("h1#output3").text($(e.target).data('userid')); $("h1#output4").text($(e.target).data('taskid')); });
answer count: 4
tagged with: twitter-bootstrap-3
possible better answer: http://stackoverflow.com/a/28135430
has answer: http://stackoverflow.com/a/28135430
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28135532
tagged with: javascript
has title: anchor tag data not accessible when clicking on glyphicons inside the anchor tag
has answer: http://stackoverflow.com/a/28135426
score: 0
accepted answer: http://stackoverflow.com/a/28135426
tagged with: jquery
has answer: http://stackoverflow.com/a/28135443
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/28140217
has body: What I am doing wrong here? I am getting TypeError: items[i] is undefined as the error. var items = []; for(var i = 1; i &lt;= 3; i++){ items[i].push('a', 'b', 'c'); } console.log(items); I need an output as given below, [ ['a', 'b', 'c'], ['a', 'b', 'c'], ['a', 'b', 'c'] ]
favorite count: 0
has answer: http://stackoverflow.com/a/28140243
has title: javascript array format via for loop
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28140243
tagged with: javascript
tagged with: for-loop
tagged with: arrays
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/44867985
type: QuestionComment
comment on: http://stackoverflow.com/q/28252208
type: Comment
has text: Not sure what you mean with "skip back" button but check this in case it helps http://stackoverflow.com/a/28226534/1055987
score: 0

http://stackoverflow.com/q/28200117
tagged with: dom
has body: I have the following code which is not working var Settings = { addConfirmations: function() { var e = document.querySelectorAll(".bg-red"); for (var t = 0; t &lt; e.length; t++) { e[t].addEventListener("click", function() { var e = this.getAttribute("title"); return Settings.confirmation(e) }) } }, confirmation: function(e) { if (e === null || e.toString().length === 0) { e = "Are you sure you want to proceed?" } return window.confirm(e); } } window.onload = Settings.addConfirmations(); This code adds a click event to all button with a "bg-red" class, now this does not work because return false does not cancel an event if added using AddEventListener, I was advised to use event.preventDefault() instead but this is not an option as I don't use jQuery. I only use pure javascript. So, why does return false not work with AddEventListener and is there a pure javascript replacement for event.preventDefault();?
type: Question
tagged with: addeventlistener
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44767525
answer count: 1
tagged with: events
has title: Why does return false not work with AddEventListener and what is Javascript's replacement for preventDefault()?
tagged with: return
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28200240

http://stackoverflow.com/q/28267138
downvote count: 1
type: Question
type: AnsweredQuestion
tagged with: performance
accepted answer: http://stackoverflow.com/a/28267228
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44890468
upvote count: 0
answer count: 1
favorite count: 0
tagged with: android
has answer: http://stackoverflow.com/a/28267228
has body: My name is Kevin and I'm new to this so I'll keep everything short and sweet. I've learned the basics of android app development but I was wondering how I was able to monetise my application? Meaning, I can get regular statistics on how well my application is doing. I don't know if Google offers that but I haven't been able to find anything. I was wondering if anyone had any knowledge of the back-end coding in an android app and if it is possible to connect your own independent server to control all the requests and data-transfers? Sorry guys if to the experts this sounds like a naive question, but I am only 16, not has that much experience or exposure.
has comment: http://stackoverflow.com/comment/44890502
tagged with: java
has comment: http://stackoverflow.com/comment/44890580
has comment: http://stackoverflow.com/comment/44891014
tagged with: mysql
has title: Application development (behind the scenes)

http://stackoverflow.com/comment/44792559
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28214279
has text: but it is not possible in a direct way ,Check my edited answer
type: Comment

http://stackoverflow.com/q/28254150
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question
has answer: http://stackoverflow.com/a/28254396
tagged with: javascript
score: 4
has title: Bootstrap Collapse sidebar menu to dropdown
upvote count: 4
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28254396
has body: I have the left sidebar with vertical menu built with "nav nav-pills nav-stacked" what I want when the screen size is XS (mobile) this menu changes to suitable dropdown menu and start as closed/collapsed. Here is my starting code: http://www.bootply.com/zOy2IJumZO The html code here also Categories 12345 Automotive Vehicles Business-to-Business Community Electronics Events Fashion Freebies Site statistics 1000 Users 200 Online 300 Hidden This is the right content column This is the right content column This is the right content column This is the right content column This is the right content column This is the right content column This is the right content column
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/28197863
has comment: http://stackoverflow.com/comment/44762216
accepted answer of: http://stackoverflow.com/q/28197739
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/55714224
has comment: http://stackoverflow.com/comment/44762183
has body: Use: var queryStringParts = queryString.split('&amp;'); var pairs = queryStringParts.map(function(str) { return str.split('=') }) var rewrittenParts = pairs.map(function(pair){ return 'slides[0].' + pair[0] + '=' + pair[1] }); var newQuerystring = rewrittenParts.join('&amp;'); As was pointed out in the comments, in this specific case we could skip the split into pairs step and just do var queryStringParts = queryString.split('&amp;'); var rewrittenParts = queryStringParts.map(function(part) { return 'slides[0].' + part }); var newQuerystring = rewrittenParts.join('&amp;');
has comment: http://stackoverflow.com/comment/55724624
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44762315
answers question: http://stackoverflow.com/q/28197739
has comment: http://stackoverflow.com/comment/44762246

http://stackoverflow.com/q/28252161
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44863454
has answer: http://stackoverflow.com/a/28252275
has comment: http://stackoverflow.com/comment/44863535
has comment: http://stackoverflow.com/comment/44863801
has comment: http://stackoverflow.com/comment/44863428
has comment: http://stackoverflow.com/comment/44863586
type: Question
has title: select currently focused contenteditable div using jquery
has comment: http://stackoverflow.com/comment/44863694
tagged with: javascript
has comment: http://stackoverflow.com/comment/44863424
has answer: http://stackoverflow.com/a/28252282
accepted answer: http://stackoverflow.com/a/28252282
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/44863743
downvote count: 1
tagged with: jquery
favorite count: 0
has body: hi i would like to select the parent div of currently placed cursor in a contenteditable div. the process is, there are multiple contenteditable div in a page. i'd like to select the div which the caret/ cursor is currently positioned. so that using jquery i could change the css. following is my html code of the div: change color this is my editable paragraph this is my editable paragraph 2 following is my jquery code so far:- $('#changer').click(function(){ document.activeElement.css({'background':'black'}); }); but this gives me the error :- Uncaught TypeError: undefined is not a function edit:- the process is when the user clicks a button a color palette lightbox will appear. on click of any of the color on the color palette. the jquery is going to select the currently focused contenteditable div. and change the css. i want to know how to select the currently focused contenteditable div using jquery.
has comment: http://stackoverflow.com/comment/44863415
possible better answer: http://stackoverflow.com/a/28252275

http://stackoverflow.com/q/28157385
has title: Adding code from a multidimensional javascript array to html page
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28158580
has comment: http://stackoverflow.com/comment/44686620
has comment: http://stackoverflow.com/comment/44686833
answer count: 1
has comment: http://stackoverflow.com/comment/44686899
has comment: http://stackoverflow.com/comment/44686300
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44688255
has comment: http://stackoverflow.com/comment/44686606
has body: I am working on a website that should allow you to filter pictures using javascript. You select a search criteria using an html dropdown list. I now want to insert the code of the image into the html file and honestly have no idea how to do it. Here's an example of a dropdown list: Select Hair Color Brown Fair Black Blue Here's the javascript file: var ika = ["anime1", "female", "blue", "blue", "genki", "<12", ' Ika Musume Shinryaku! Ika Musume ', true]; var hotaru = ["anime2", "female", "brown", "brown", "other", "12-24", ' Hotaru Ichijou Non Non Biyori ', true]; var suguru = ["anime2", "male", "brown", "black", "other", "12-24", ' Suguru Koshigaya Non Non Biyori ', true]; var characters = [ika, hotaru, suguru]; function getCharacters() { var selection = [document.getElementById("Anime").value, document.getElementById("Gender").value, document.getElementById("HairColor").value, document.getElementById("EyeColor").value, document.getElementById("Personality").value, document.getElementById("AgeRange").value]; for(i = 0; i < characters.length; i++){ characters[i][7] = true; for(j = 0; j < selection.length && characters[i][7] != false; j++){ if (characters[i][j] != selection[j] && selection[j] != "default"){ characters[i][7] = false; } } } var count = 0; var output; for(i = 0; i < characters.length; i++){ if(characters[i][7] == true){ output[count] = characters[i]; count++; } } var element = document.getElementById("cards"); for(i=0; i<output.length; i++){ element.innerHTML = output[i][6]; } } I want the code on the six array place to be output in the "cards" div but it doesn't do anything. I also want it to start all over again every time you make a new selection, so that old images don't stay in the div. Can anybody tell me what I did wrong? I honestly have no clue and I am at my wits end. Any help is appreciated. EDIT: Added missing , in one of the character arrays. Still doesn't seem to be working though.
has comment: http://stackoverflow.com/comment/44687286
has comment: http://stackoverflow.com/comment/44687232
type: Question
has comment: http://stackoverflow.com/comment/44687146
has comment: http://stackoverflow.com/comment/44686855
accepted answer: http://stackoverflow.com/a/28158580

http://stackoverflow.com/a/28226874
has body: Add a short timeout to the closing of the popup. Clear the time out when the other div is entered and fire the close when the second div is left.
answers question: http://stackoverflow.com/q/28226800
has comment: http://stackoverflow.com/comment/44818454
score: 0
type: Answer

http://stackoverflow.com/comment/44813677
comment on: http://stackoverflow.com/q/28224122
score: 0
has text: Is the post being sent by an Ajax call? if so how is the Ajax call getting the string that its going to pass to this php script. Is your user is filling out a form and sending a file path they specify if so you may want to rethink that option.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44706594
type: QuestionComment
has text: Why not use [draggable](http://jqueryui.com/draggable/) with [this solution](https://stackoverflow.com/questions/175609/jquery-ui-droppables-changing-the-image-thats-dropped)?
type: Comment
comment on: http://stackoverflow.com/q/28167989
score: 0

http://stackoverflow.com/comment/44803274
has text: `console.log` logs in the browser's console. `document.write` does [nasty things](http://www.w3.org/TR/html5/webappapis.html#document.write%28%29). `alert` pauses script execution and shows an alert.
type: QuestionComment
comment on: http://stackoverflow.com/q/28219858
score: 1
type: Comment

http://stackoverflow.com/a/28155138
has comment: http://stackoverflow.com/comment/44682327
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28151683
score: 2
answers question: http://stackoverflow.com/q/28151683
has body: From the MDN on the keypress event: The keypress event is fired when a key is pressed down and that key normally produces a character value So you have to use keyup or keydown events for certain keys, such as escape or backspace, because they don't produce characters. The keycode for backspace is 8, so your code could look like follows: container.unbind('keyup').bind('keyup',function (e) { ... if(e.keyCode === 8){ // backspace getCharacterDiff(); console.log(totalChar.length-1); if(totalChar.length-1 === 0){ publisher.typeHistory = []; } } ... });

http://stackoverflow.com/comment/44883901
has text: @JamieDixon: Being explicit is better than implicit - so when invoking a constructor, you should always use `new`, regardless whether it does or does not need it. That being said, it's convention in JS to always use array literals instead of the constructor.
comment on: http://stackoverflow.com/q/28262971
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44789092
has text: Is it `\r` AND `\n` AND more than one space, or `\r` OR `\n` OR more than one space, because your question asks for the first but anubhava has provided the regex for the second.
type: Comment
comment on: http://stackoverflow.com/q/28212542
score: 0
type: QuestionComment

http://stackoverflow.com/comment/116104950
score: 1
comment on: http://stackoverflow.com/a/30787284
type: AnswerComment
type: Comment
has text: I am having the exact same issues and I was wondering if you've got it working with 1.3 and if you posted the code anywhere. It would be of much help for me, thanks!

http://stackoverflow.com/q/28184170
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28184563
has answer: http://stackoverflow.com/a/28184270
accepted answer: http://stackoverflow.com/a/28184270
tagged with: php
tagged with: datatable
type: AnsweredQuestion
downvote count: 0
has body: I have been attempting to use Jquery's datatables for the first time and the tutorials available have left me rather confused. I've done the following script trying to incorporate jquery in with my php table display that I knew was working fine. I may have something fundamentally wrong here and now I'm very stuck. Would anyone be able to clear this up? (Just trying to display a basic mysql database with jquery datatables.) Thanks very much in advance. <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "dbname"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT Sid, Fname, Lname, Email, Dtype, Mac, Date FROM StudentDeviceReg"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo " ID First Name Last Name Email Device Mac Address Date "; // output data of each row while($row = $result->fetch_assoc()) { echo " ".$row["Sid"]." ".$row["Fname"]." ".$row["Lname"]." ".$row["Email"]." ".$row["Dtype"]." ".$row["Mac"]." ".$row["Date"]." "; } echo " "; } else { echo "0 results"; } $conn->close(); ?>
score: 1
tagged with: mysql
type: Question
has title: Displaying mysql database with php and Jquery Datatables?
possible better answer: http://stackoverflow.com/a/28184563
tagged with: javascript

http://stackoverflow.com/q/28262202
type: AnsweredQuestion
tagged with: compatibility
tagged with: version
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
has body: So I've got this code that runs inside a HTA... jsv=ScriptEngine()+' v' +ScriptEngineMajorVersion()+'.' +ScriptEngineMinorVersion()+'.' +ScriptEngineBuildVersion() It displays the version of JScript the HTA is using. So... My question is: Can I display the IE Compatibility Mode version, or similar, of the HTA in the same way? And if so... How?!
has answer: http://stackoverflow.com/a/28262258
upvote count: 1
answer count: 1
tagged with: internet-explorer
has title: Can I display the IE compatibility version of a HTA inside itself?
tagged with: hta
accepted answer: http://stackoverflow.com/a/28262258

http://stackoverflow.com/q/28268826
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28268882
has answer: http://stackoverflow.com/a/28268893
type: Question
has answer: http://stackoverflow.com/a/28268905
has comment: http://stackoverflow.com/comment/44893752
tagged with: javascript
has answer: http://stackoverflow.com/a/28268937
favorite count: 0
score: 0
answer count: 5
possible better answer: http://stackoverflow.com/a/28268937
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44893767
has body: in my html files I have something like this: &lt;p class="image"&gt; &lt;img src="images/20.jpg" alt="20!" width="90" height="125" border="0"&gt; &lt;img src="images/19.jpg" alt="19!" width="90" height="125" border="0"&gt; &lt;img src="images/18.jpg" alt="18!" width="90" height="125" border="0"&gt; &lt;img src="images/17.jpg" alt="17!" width="90" height="125" border="0"&gt; &lt;img src="images/16.jpg" alt="16!" width="90" height="125" border="0"&gt; &lt;img src="images/15.jpg" alt="15!" width="90" height="125" border="0"&gt; &lt;img src="images/14.jpg" alt="14!" width="90" height="125" border="0"&gt; &lt;img src="images/13.jpg" alt="13!" width="90" height="125" border="0"&gt; &lt;img src="images/12.jpg" alt="12!" width="90" height="125" border="0"&gt; &lt;img src="images/11.jpg" alt="11!" width="90" height="125" border="0"&gt; &lt;/p&gt; Is there possibility to replace repetetive codes with any loop script? I am totally new in this :)
has comment: http://stackoverflow.com/comment/44894312
has answer: http://stackoverflow.com/a/28269129
accepted answer: http://stackoverflow.com/a/28268905
has title: JavaScript instead of repetitive HTML lines
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44893753

http://stackoverflow.com/comment/44767814
has text: I actually wanted to do it without having to use a database but looks like it is impossible, thanks.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28200686
type: Comment

http://stackoverflow.com/q/28181346
has title: Half speed AudioContext from microphone when written to server
score: 0
has answer: http://stackoverflow.com/a/28971295
tagged with: audiocontext
has comment: http://stackoverflow.com/comment/44733768
tagged with: pcm
tagged with: node.js
type: AnsweredQuestion
has body: I am trying to write a microphone recording on client javascript, transfer it to server then convert it to silk. I have the audio playing back on server using the Speaker module using these settings var speaker = new Speaker({ channels: 1, bitDepth: 16, sampleRate: 44000, signed: true }); but when it gets converted to silk it sounds half speed. I believe its the conversion to silk using a C class that i didn't write that causes the slow down since it sounds fine as a pcm file. The C file has these settings #define FRAME_LENGTH_MS 20 #define SAMPLE_RATE_KHZ 16 #define SILK_BITRATE 14000 #define FRAME_SAMPLES (FRAME_LENGTH_MS * SAMPLE_RATE_KHZ) I'm using BinaryJS to write the code to the server as a Int16array. I would copy the code here but i almost copied it verbatim from this tutorial. http://blog.groupbuddies.com/posts/39-tutorial-html-audio-capture-streaming-to-node-js-no-browser-extensions Also would love to know what exactly im getting from audioContext in terms of bitrate, samplerate and how to downsample the samplerate if i have to for the silk codec. EDIT: I did (kinda) solve the half speed by modifying the on onaudioprocess where i converted the float32 to Int16 by removing half the samples. l = buffer.length; point = Math.floor(l/2); buf = new Int16Array(Math.floor(l/2)); for (var x = l; x &gt; 0;) { var average = (buffer[x] + buffer[x-1]) / 2; buf[point] = Math.min(1, average)*0xFFFF; point -= 1; x -= 2; } return buf.buffer; However, the audio pitch is still half.
type: Question
has comment: http://stackoverflow.com/comment/44735020
accepted answer: http://stackoverflow.com/a/28971295
answer count: 1
tagged with: websocket
tagged with: javascript

http://stackoverflow.com/comment/44872046
type: Comment
comment on: http://stackoverflow.com/a/28256918
has text: For this particular task, yes, it might be overkill, but for a project (or website) that involves more DOM manipulation, in the end it's cheaper spending computer power than developer's time.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28177117
accepted answer: http://stackoverflow.com/a/28177389
has comment: http://stackoverflow.com/comment/44723401
favorite count: 0
downvote count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/44723322
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28177389
tagged with: mysql
type: Question
has title: How to Update MySQL with PHP and AJAX without REFRESHING the PAGE
upvote count: 0
score: -2
answer count: 1
has body: Ok here is my question I have MySQL with the following order: ids - radio - link - time - artist - title - disliked ids is the ID of the Media from page LISTEN.php I have random selection of video from the Database. I have already created in LISTED.php to SHOW THE ID of the Video also the Artist and Title. **I need to have a button on LISTEN.php where when somebody clicks it for example the name of the button - > Dislike so if someone clicks it AJAX or SOMEHOW not to refresh the page but in the same time when the DISLIKE button is clicked to Update in the MySQL (once again without refreshing the page) to Disliked - 1, (when this button is pressed again for the same video to update to 2 / 3 / 4 and so on. Right now all of my videos are 0. I need to be able to View not LIKED videos, for example select * from RANDOM where DISLIKED is Higher number then >0** I am not a very good in PHP so please help me, one more time the PAGE SHOULD NOT REFRESH. Your help would be greatly appreciated.
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/44619390
type: Comment
type: QuestionComment
has text: Two problems there: 1) my app does not know the URL. and 2) I want the user to be able to highlight text in the browser before hitting my app's hot key. I have Javascript to do these things, but I want to avoid requiring the user to install a bookmarklet or extension.
comment on: http://stackoverflow.com/q/28122342
score: 0

http://stackoverflow.com/comment/44740840
type: Comment
type: QuestionComment
has text: @David So there's no point in trying other methods to accomplish a true keystroke, correct? As a side question, would the same happen when I try to use commands such as copy & paste?
comment on: http://stackoverflow.com/q/28185778
score: 0

http://stackoverflow.com/q/28267961
tagged with: javascript
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 3
tagged with: google-drive-realtime-api
has answer: http://stackoverflow.com/a/28330146
upvote count: 3
has body: I am building a web app that interfaces with a Google Sheets spreadsheet. I can successfully read data by consuming the JSON formatted version of the sheet. I can successfully create new rows by posting to the /formResponse associated with the sheet. However, I am trying to figure out how to update or delete an existing row. Is this exposed anywhere? I can not find any examples to do this. Note: The sheet in question contains a field that is unique, so I do have something to match against should there be a way to update or delete it.
type: Question
tagged with: google-sheets
has title: Delete row from Google Sheet
answer count: 1

http://stackoverflow.com/a/28270275
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44906183
answers question: http://stackoverflow.com/q/28233531
has comment: http://stackoverflow.com/comment/59541121
has comment: http://stackoverflow.com/comment/45937104
downvote count: 0
has body: cordova (and some cordova plugins, particularly the FileSystem plugin) use some features of WinJS, such as Promises and Ajax calls. We ended up forking cordova.js and stripping out all the WinJS stuff... makes the app load a lot faster!
has comment: http://stackoverflow.com/comment/45960584
type: Answer
has comment: http://stackoverflow.com/comment/59580293

http://stackoverflow.com/comment/44869036
comment on: http://stackoverflow.com/q/28255284
score: 0
type: Comment
type: QuestionComment
has text: I guess the browser handles the cookie headers by itself.

http://stackoverflow.com/q/28264825
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/34843754
type: Question
tagged with: javascript
has title: Find, hide and replace text with picture in textarea using keywords unhide onclick
has body: I am learning javascript and jQuery, so I don't know many features yet, looking for your advice. On the high level I want to create little script allowing me to do several things with the text, here how I see pseudo code: User type text in the text area provided. User highlights words to be changed OR enter words to be changed in input field (in this case I have a question if I need many input fields or I can create string using only one?) By pressing a button words in the text become hidden and replaced with lets say this sign - (...). User click on (...) and unhide word. I would really appreciate any help you could provide. At the moment I have a text area + as many input fields (no more than 10) as needed automatically generated after drop down menu selection. I found this example http://james.padolsey.com/javascript/find-and-replace-text-with-javascript/ but I don't know how to change it for a string so perhaps you know another way? Or maybe there are methods to do it easy apple, banana, orange, apple, banana, orange --Select No Of Forms to Display-- 1 2 3 4 5 6 7 8 9 10 And my Javascript // http://www.formget.com/create-multiple-form-fields-based-on-selection-jquery/ $(document).ready(function () { $('select#select_btn').change(function () { var sel_value = $('option:selected').val(); if (sel_value == 0) { $("#form_submit").empty(); // Resetting Form $("#form1").css({ 'display': 'none' }); } else { $("#form_submit").empty(); //Resetting Form // Below Function Creates Input Fields Dynamically create(sel_value); // Appending Submit Button To Form $("#form_submit").append($(" ", { type: 'submit', value: 'Accept' })) } }); function create(sel_value) { for (var i = 1; i <= sel_value; i++) { $("div#form1").slideDown('slow'); $("div#form1").append($("#form_submit").append($(" ", { id: 'head' }).append(), $(" ", { type: 'text', placeholder: 'Keyword' + i, name: 'keyword' + i }), $(" "))) } } });
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/30423804
score: -3
downvote count: 3
has body: "columnDefs": [ { // The `data` parameter refers to the data for the cell (defined by the // `data` option, which defaults to the column being worked with, in // this case `data: 0`. "render": function ( data, type, row ) { return '&lt;img src="'+data+'" style="width=300px;height=300px;" /&gt;'; }, "targets": 1 // column index } ]
answers question: http://stackoverflow.com/q/28152698
upvote count: 0
type: Answer

http://stackoverflow.com/comment/44771118
has text: ok thanks for the clarification. What if I need it to move through all three planes
score: 0
comment on: http://stackoverflow.com/q/28201126
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28233725
favorite count: 0
has body: I'm trying to make a dictionary to translate a website. The problem is I can't find a way to catch strings with variables in it! For example: Something 52 something else where 52 is a variable and could be any number. What I was hoping for is something like this: "Something * something else":"blabla * blablabla bla" Any ideas how to make this work?
has comment: http://stackoverflow.com/comment/44829650
type: UnansweredQuestion
upvote count: 1
tagged with: dictionary
has comment: http://stackoverflow.com/comment/44829652
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/28234304
has comment: http://stackoverflow.com/comment/44829504
score: -2
has title: How to handle strings with variables when translating an HTML website?
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44801978
type: Comment
has text: even though moment.js is indeed an incredible library, it's kinda heavy and also this isn't an answer to the question and should in face be a comment
comment on: http://stackoverflow.com/a/28219091
score: 0
type: AnswerComment

http://stackoverflow.com/q/28139163
score: 0
accepted answer: http://stackoverflow.com/a/28148654
has body: I currently have a problem with form validation and milliseconds. I guess time in milliseconds is not a valid date format in angular, as e.g. angular.isDate(1418645071000) is returning false. But what to change in my code, so that the form validation is working? I do not have any restriction with the server - meaning a date in the format "Sat Feb 03 2001 00:00:00 GMT+0100 (CET)" is also being acceptable. Here is the code: http://plnkr.co/edit/lZZh5VvCzH6yYh1t8xVM?p=preview
tagged with: angularjs
has title: Angular form validation - transforming milliseconds to valid date object
has comment: http://stackoverflow.com/comment/44650007
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28139516
possible better answer: http://stackoverflow.com/a/28139516
answer count: 2
tagged with: validation
has answer: http://stackoverflow.com/a/28148654
tagged with: javascript
linked to: http://stackoverflow.com/q/22639485

http://stackoverflow.com/comment/44835554
has text: I have deleted the madam. It was more the ninja avatar :) Sorry my connecting genders to Indian(?) name skill is not that good.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28236646

http://stackoverflow.com/q/28235720
tagged with: php
tagged with: css
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/44833147
has answer: http://stackoverflow.com/a/60171499
score: 3
type: Question
upvote count: 4
has title: PHP - HTML and CSS3 to PDF (and mPDF VS DOMpdf)
answer count: 1
has comment: http://stackoverflow.com/comment/44833048
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44832847
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
has body: I've played with a lot of php html to pdf converters and got really sick of it. I liked the most DOMpdf with which I've worked for 2 months. Yesterday I tested mPDF, it was basically the same but much faster. The problem is that I have an HTML file with internal CSS and external images, and if I use the advanced stuff, things like float, overflow, round-corners, shadows etc, then things just fall apart. Is there ANY way just to convert HTML and CSS into PDFs without any hassle and for free? I don't even care how anymore. It can be JavaScript conversion. It can be an external site conversion, it can even be some kind of software (if that is possible in my hosting), a browser plugin (Not CutePDF, I need costum height adn width controls), a plugin for any CMS. as long as it's not over complicated and I don't have to waste time on re engineering the design Any solutions for any kind of design with HTML + CSS so that I don't have to censored around with the design?

http://stackoverflow.com/a/31271177
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28175978
has body: The Browserify can find module by parse string "require". If you want to use both side client and server, use rfr for server side and browserify-rfr for browserify's transform. In my opinion, the "rfr" is the best because this module does not override original require. ------- Notice! Additional Information, As today browserify-rfr version leaves my local file path to bundle.js. This may cause another problem, so I chose requirish. Since the requirish changes behavior of original require by pushing a new path to module.paths, you always notice that and alert your coworker! thanks! https://www.npmjs.com/package/requirish

http://stackoverflow.com/comment/44764976
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28197405
has text: Who said manual DOM manipulation would need to replace the divs? I'd just assign new values to the two text nodes if I'd care for speed.
score: 0

http://stackoverflow.com/comment/44763124
has text: Sorry MrYoshiji , I mean about without writing several lines of code according checkboxes, if I have more checkboxes the code will be too long, and i think is not the correct way need to make it more dynamic
comment on: http://stackoverflow.com/q/28197894
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44660016
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28143955
has text: I also use these scripts

http://stackoverflow.com/a/28186637
answers question: http://stackoverflow.com/q/28186557
has body: Note: If you can change the original markup instead of fixing it using javascript that will be better. In this case it is not the input element's text, it is the contents of a text node so var $input = $('label input'), elTxt = $input[0].nextSibling; elTxt.nodeValue = elTxt.nodeValue.replace(/^(\s)?y/, '$1') y2012
downvote count: 0
score: 1
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44742068

http://stackoverflow.com/a/35084238
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28151974
upvote count: 3
type: Answer
has body: I have changed the line 356 in the owl.carusel.js from base.maximumItem = base.itemsAmount - base.options.items; to base.maximumItem = Math.ceil(base.itemsAmount - base.options.items); and it works fine for me

microsoft-dynamics
tag name: microsoft-dynamics
tags question: http://stackoverflow.com/q/28166926
type: Tag

http://stackoverflow.com/comment/44835641
comment on: http://stackoverflow.com/a/28236201
type: AnswerComment
score: 0
type: Comment
has text: This will give me a lot of returnvalues which I don't want when quering for Key = text I'll think I need to debug this - thanks in Advance.

http://stackoverflow.com/a/28279478
answers question: http://stackoverflow.com/q/28279162
has body: Sample form: Upload CoffeeScript: $(document).on 'submit', '#car-form', (e) -> fileInput = $('.file-fields .file-field')[0] for i = 0 i < fileInput.length i++ file = @files[i] imageType = /image.*/ if !file.type.match(imageType) return false return true This checks if the input has images. If one isn't correct fail the submit. Else submit and let Rails take over.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44837040
score: 1
has text: unfortunately it seems to be an internal problem, my company all have the same FF (plugins inc) and computers. so testing on a colleagues computer shows the same flash of white. I will have to work around it by removing the timer and just setting to update every 5 minutes. Thanks for your help anyway, much appreciated
comment on: http://stackoverflow.com/q/28237370
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28149686
has body: A regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. — https://developer.mozilla.org/en/docs/Web/HTML/Element/Input So pattern="[a-z]" is equivalent to /^[a-z]$/.test('foo');
answers question: http://stackoverflow.com/q/28149635
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28149635
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 3

http://stackoverflow.com/comment/44633394
type: Comment
comment on: http://stackoverflow.com/a/28130127
type: AnswerComment
score: 0
has text: @Mouser: The global `user1` is just for example, you might not do it like this in practise. It depends a lot on what you want to do when the condition is not met, and whether you expect that at all.

http://stackoverflow.com/q/28184127
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 1
accepted answer: http://stackoverflow.com/a/29090165
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Print wide html table using HTML/css/javascript (with responsive design)
favorite count: 0
has answer: http://stackoverflow.com/a/29090165
has body: I have tried the code from the article to print my wide table in a single page, that worked great only for Google Chrome. Couldn't get it working on IE as mentioned in the article and comments. Below is my sample code with IE I tried almost for hours and couldn't get the issue. function printGrid() { var gridElement = $('#grid'), printableContent = '', win = window.open('', '', 'scrollbars=1,resizable=1,width=1150,height=650,left=0,top=0'), doc = win.document.open(), dataSource = $("#grid").data("kendoGrid").dataSource; var htmlStart = '&lt;!DOCTYPE html&gt;' + '&lt;html&gt;' + '&lt;head&gt;' + '&lt;meta charset="utf-8" /&gt;' + '&lt;link href="../Content/kendo/2014.1.318/kendo.common.min.css" rel="stylesheet" /&gt;' + '&lt;style&gt;' + 'html { font: 11pt sans-serif; }' + '.k-grid { border-top-width: 0;}' + '.k-grid, .k-grid-content { height: auto !important;}' + '.k-grid-content { overflow: visible !important; }' + 'div.k-grid table { table-layout: fixed; border:1px solid #000000; width: 100% !important; }' + '.k-grid .k-grid-header th { border-top: 1px solid; border:1px solid #000000;}' + '.k-grid td {border:1px solid #000000;} ' + '.k-grid-toolbar, .k-grid-pager &gt; .k-link { display: none; }' + '@media only screen and (max-width: 760px),(min-device-width: 768px) and (max-device-width: 1024px) {table, thead, tbody, th, td, tr { display:block;width:100%;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;float:left;clear:left;}' + 'thead tr {position: absolute;top: -9999px;left: -9999px;}' + 'tr {border: 1px solid #ccc;}' + 'td {border: none;border-bottom: 1px solid #eee;position: relative;padding-left: 50%;height:10px;}' + 'td:before {position: absolute;top: 6px;left: 6px;width: 45%;padding-right: 10px;white-space: nowrap;}' + 'td:nth-of-type(1):before {content: "Column1";}' + 'td:nth-of-type(1):before {content: "Column2";}' + 'td:nth-of-type(1):before {content: "Column3";}' + 'td:nth-of-type(1):before {content: "Column4";}' + 'td:n…

http://stackoverflow.com/q/28143391
accepted answer: http://stackoverflow.com/a/28143605
has body: I am having trouble attaching a timing event to my function I want this to on execute the function after 25 seconds. what am I doing wrong? setTimeout("ajaxTimeout();", 25000); $(document).on({ //open popup here 'pageshow': function ajaxTimeout(){ $('#askforsomething').popup('open'); } }, '#homepage');
score: 1
upvote count: 1
tagged with: timing
type: Question
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/28143605
has answer: http://stackoverflow.com/a/28143634
downvote count: 0
favorite count: 0
has title: Execute JqueryMobile Popup on Jquery timing event
possible better answer: http://stackoverflow.com/a/28143634
has comment: http://stackoverflow.com/comment/44658640
type: AnsweredQuestion

http://stackoverflow.com/q/28224473
has comment: http://stackoverflow.com/comment/44813163
has comment: http://stackoverflow.com/comment/44813584
has answer: http://stackoverflow.com/a/28225386
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44812964
score: 1
has comment: http://stackoverflow.com/comment/44813702
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44812119
linked to: http://stackoverflow.com/q/21020360
answer count: 2
has title: Angular http post on loops
has comment: http://stackoverflow.com/comment/44813650
tagged with: javascript
has body: I am trying to use angular http post inside a loop using angular forEach as advised here- Angular HTTP Get on loop and Angularjs loop trought $http.post but the solution is not working in my case. The http post always returns result with respect to the last item in LifeBenefitTRAD but I want the result for each item in the loop. e.g. If I have 4 items in the list of LifeBenefitTRAD, my post method is executing 4 times but w.r.t the fourth item in the list. The execution always happens with respect to last object.Please tell me what am I doing wrong here?- $scope.GenerateAllTradQuote = function () { var TRADPlanDetails = {}; console.log(LifeBenefitTRAD); //for (var i = 0; i &lt; LifeBenefitTRAD.length; i++) { LifeBenefitTRAD.forEach(function (trad) { TRADPlanDetails.QuoteName = "TradQuote_" + trad.LifeBenefitValue; TRADPlanDetails.LifeBenefitId = trad.LifeBenefitId; TRADPlanDetails.LifeBenefitValue = trad.LifeBenefitValue; console.log(TRADPlanDetails); $http({ url: key_Url_GenerateTradQuote, method: key_String_HttpPost, // async: true, params: TRADPlanDetails }).then(function (result) { $scope.TRAD_PlanDetails.TRAD_DisplayFlag = true; if (result.data != key_String_Zero) { $scope.TRAD_PlanDetails.TRAD_DisplayMsg = key_Confirm_Successful_Quote; } else { $scope.TRAD_PlanDetails.TRAD_DisplayMsg = key_Confirm_failed_Quote; } }); }); // } };
favorite count: 0
has comment: http://stackoverflow.com/comment/44812245
has comment: http://stackoverflow.com/comment/44813896
has comment: http://stackoverflow.com/comment/44812502
downvote count: 1
possible better answer: http://stackoverflow.com/a/28226242
has comment: http://stackoverflow.com/comment/44813481
has answer: http://stackoverflow.com/a/28226242
accepted answer: http://stackoverflow.com/a/28225386
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44812084
linked to: http://stackoverflow.com/q/24064976

dynamic
tags question: http://stackoverflow.com/q/28244204
tag name: dynamic
tags question: http://stackoverflow.com/q/28270696
tags question: http://stackoverflow.com/q/28235927
tags question: http://stackoverflow.com/q/28210961
tags question: http://stackoverflow.com/q/28225742
tags question: http://stackoverflow.com/q/28139011
tags question: http://stackoverflow.com/q/28252436
tags question: http://stackoverflow.com/q/28185881
tags question: http://stackoverflow.com/q/28260546
tags question: http://stackoverflow.com/q/28158899
type: Tag

http://stackoverflow.com/comment/44724616
type: QuestionComment
has text: You could probably get away with CSS3 however you're already using jQuery. Either way maybe [CSS3 Keyframes](http://www.w3schools.com/cssref/css3_pr_animation-keyframes.asp) can help.
comment on: http://stackoverflow.com/q/28177625
score: 0
type: Comment

http://stackoverflow.com/comment/44635954
comment on: http://stackoverflow.com/a/28131338
score: 0
type: AnswerComment
has text: That is why you are the expert. Thank you!
type: Comment

http://stackoverflow.com/comment/44664855
score: 0
has text: can you explain this simply ? ...I am a student
comment on: http://stackoverflow.com/q/28146363
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44706675
has text: I see, I only have unique ID for the nav element, no id's for the lis. The <a tag, have onclicks, should I remove the load function from body, and only use the code you supplied?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28167836
type: Comment

ui-select2
tags question: http://stackoverflow.com/q/28263248
tag name: ui-select2
type: Tag
tags question: http://stackoverflow.com/q/28146868

http://stackoverflow.com/comment/44644208
has text: @Roamer-1888: it is, my bad
score: 0
comment on: http://stackoverflow.com/q/28135370
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28258800
has body: How do you get the this value of a function from outside the function, without having to call it? For example, the following doesn't work, but illustrates the idea: // window is this, currently function foo() {} console.log(foo.this) // would log the window object. The MDN documentation for Function.bind() reports that bind() "creates a new function that, when called, has its this keyword set to the provided value". This implies that each function has a "this" associated with it from the ery start. The question is whether or not that "this" is accessible from outside the function call, because presumably it's "this" reference already exists based on thos MDN docs. Try this in your console: var foo = function() {} var bar = foo.bind(this) console.log(foo === bar) The result is false, meaning you now have two functions, not one, and each one has it's own this. Some have mentioned that the "callsite" determines the this of a function, which doesn't seem to be true. If you run var obj = {} function foo() { console.log(this) } function Obj(func) { console.log(this) func() } new Obj(foo) Then the callsite for foo is inside a new Obj but it still logs the Window object. If you run var obj = {} function foo() { console.log(this) } foo() foo.call(obj) foo.bind(obj) foo() Then you'll notice that the this of the original foo function has not changed. Based on this fact, and the MDN docs for bind, call, and apply, we can confidently assume that the this for a Function can never be changed.
has comment: http://stackoverflow.com/comment/44875938
favorite count: 0
has comment: http://stackoverflow.com/comment/44875988
has comment: http://stackoverflow.com/comment/44876075
has comment: http://stackoverflow.com/comment/44876187
has comment: http://stackoverflow.com/comment/44876002
has comment: http://stackoverflow.com/comment/44875813
has comment: http://stackoverflow.com/comment/44876155
has comment: http://stackoverflow.com/comment/44875525
has answer: http://stackoverflow.com/a/28259252
has comment: http://stackoverflow.com/comment/44876275
has comment: http://stackoverflow.com/comment/44875526
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28258817
has comment: http://stackoverflow.com/comment/44875626
has comment: http://stackoverflow.com/comment/44875885
has answer: http://stackoverflow.com/a/28258817
has comment: http://stackoverflow.com/comment/44891226
score: -4
has comment: http://stackoverflow.com/comment/44876085
has answer: http://stackoverflow.com/a/28258819
has comment: http://stackoverflow.com/comment/44875957
has comment: http://stackoverflow.com/comment/44875948
type: Question
has title: How do you get the "this" of a function?
accepted answer: http://stackoverflow.com/a/28259252
has comment: http://stackoverflow.com/comment/44876125
tagged with: javascript
has comment: http://stackoverflow.com/comment/44875575
has comment: http://stackoverflow.com/comment/44875834
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/44875951
tagged with: function
upvote count: 0
tagged with: this
has comment: http://stackoverflow.com/comment/44875880

angular-strap
tag name: angular-strap
tags question: http://stackoverflow.com/q/28213488
type: Tag
tags question: http://stackoverflow.com/q/28263396
tags question: http://stackoverflow.com/q/28214209

http://stackoverflow.com/q/28195351
has comment: http://stackoverflow.com/comment/44757937
has title: how to dynamically read in local files?
tagged with: web
has answer: http://stackoverflow.com/a/28195865
has comment: http://stackoverflow.com/comment/44757814
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5694385
type: Question
has answer: http://stackoverflow.com/a/28195668
tagged with: javascript
has body: I made an image slideshow of sorts for a website. Right now each slideshow image is a list item stored in a unordered list and I use javascript and naming conventions to write each list item out. Example: for (j = 0; j&lt;imageFileLength; j++){ $('ul#Slider').append('&lt;li&gt;&lt;img src="'+fileName+'/0'+j+'.png" /&gt;&lt;/li&gt;');} //write list items for each image }); This worked for awhile but now I can't hardcode it like this anymore. Anyone needs to be able to drop files into my folder, favorably with any name, and they will automatically be added as a list item to the unordered list. I am required to use IE 8 which is a bit of a problem. It doesn't support the HTML File API, and it also doesn't support using PHP, but I might be able to get this turned on. Any ideas? Or, if PHP is a good way to go about it, how it would be done? Maybe java via netbeans? thank you
possible better answer: http://stackoverflow.com/a/28195668
accepted answer: http://stackoverflow.com/a/28195865
has comment: http://stackoverflow.com/comment/44757885
score: 0
answer count: 2

http://stackoverflow.com/a/28236409
has comment: http://stackoverflow.com/comment/44834903
type: Answer
has comment: http://stackoverflow.com/comment/44834302
has comment: http://stackoverflow.com/comment/44836271
has comment: http://stackoverflow.com/comment/44840771
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44834514
has comment: http://stackoverflow.com/comment/44836629
answers question: http://stackoverflow.com/q/28236128
has comment: http://stackoverflow.com/comment/44836541
has body: As people have mentioned, you are massively overusing and overcomplicating this code. It's quite simple if you try it like this: Please choose... OPTION 1 OPTION 2 OPTION 3 GO TO URL DOWNLOAD Note that I've added data-action to your buttons, so I can recognise which button does what. I've also changed your values of the select to the actual values you want them to represent, instead of placeholders you have to change. Just to be correct, I've also 'disabled' your first option so it can't be reselected, and I've removed its value as it shouldn't have one. I've added an id to the form element, as it allows me to do all without to many classes, and I removed all your classes. I've also ommitted the ="selected" as you don't need it (unless you are using XSL Transforms, which is just... Blurgh.) $("#myForm button").click(function(event){ event.preventDefault(); var url = $("#myForm select").val() || false; var action = $(this).data("action"); if(action === "follow" && url){ /* Follow the link */ window.location.href = url; /* While testing, you could use alert instead of window.location.href * as such: * alert(action + " " + url) */ } else if(action === "download" && url){ /* Do the download thing, since I don't know how you're doing that, heres a fictional one: */ window.location.href = "http://www.link.com/download.php?url=" + url; /* While testing, you could use alert instead of window.location.href * as such: * alert(action + " " + url) */ } }); Now all we need to do is see what button your pressed (tying this to all buttons and then reading the data-action) and then executing whatever you wanted to execute. Note that I'm using the line var url = $("#myForm select").val() || false; to select either a value or assign it false - this is to prevent your 'default' option from triggering the function (I later check if url has a value in the if statement).
has comment: http://stackoverflow.com/comment/44834227
accepted answer of: http://stackoverflow.com/q/28236128
has comment: http://stackoverflow.com/comment/44838992
has comment: http://stackoverflow.com/comment/44837631
upvote count: 1
has comment: http://stackoverflow.com/comment/44837867
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44839144

http://stackoverflow.com/comment/44915022
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28279656
has text: @Mouser because this is not a question about *how should I rewrite my inline `onclick` function*. I've answered the question asked, but decided not to go above and beyond the call of duty as the question you're wanting me to answer has been answered countless times here.

http://stackoverflow.com/comment/44635633
type: Comment
type: QuestionComment
has text: `$("#container").append(box.clone());` would work. More efficient doing this as string though
comment on: http://stackoverflow.com/q/28131409
score: 0

http://stackoverflow.com/comment/44623554
comment on: http://stackoverflow.com/q/28125120
score: 0
type: Comment
type: QuestionComment
has text: When I remove form tag then uploadfile button works but Submit button does not.

http://stackoverflow.com/comment/44865815
type: Comment
has text: @T.J.Crowder yeah, I suppose you're right. It's more like its not doing what he thinks it is doing.
comment on: http://stackoverflow.com/q/28253540
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44875849
score: 1
comment on: http://stackoverflow.com/q/28258989
type: Comment
has text: This code is a mess. Don't echo your JavaScript with PHP like that. Maintain it separately. Also make sure you're escaping any data you do need to pass with `json_encode()`. And, why define that function in a loop anyway? Don't do that! It's crazy and completely unnecessary.
type: QuestionComment

http://stackoverflow.com/q/28184514
has answer: http://stackoverflow.com/a/28184541
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28184541
tagged with: css
has comment: http://stackoverflow.com/comment/44738128
type: AnsweredQuestion
has title: Jquery event only works on element in the page, not the one coming from server using ajax
type: Question
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
tagged with: jquery
has body: i have some images in my page, inside a UL, and some is taken from server with a ajax call and appended on to the list. they all have same class and the jquery click event is given to elements with that class. but only the ones already in the page is triggered, and the ones coming from server is not. JS // when document gets ready(DOM tree initialized) $(document).ready(function(){ // ********************************************variable declarations var baseUrl = "http://192.168.0.11/mvc/"; // server address var length1 = 0; //length from server to be stored. var b=3; //end point var a=1; //start poing var img=null; var num=0; // ********************************************first AJAX call to get total number of Images in server $.ajax({ type: "POST", dataType: "json", url: baseUrl+"imageListService.ashx?length=0", }) .done(function(data) { length1=data; console.log(length1); }) .fail(function() { console.log("error"); }) // ******************************************** Display modal on load // $('#testModal').modal('show'); // ******************************************** Image Gallery Popup $(".imageGallery").click(function(){ console.log(img+"first"); img = $(this).attr("name"); //image source console.log(img+"second"); num = $(this).attr("alt"); //image name $('#popup').html(" Photo No: "+num+" "); $("#popup p").addClass("popupName"); $("#popup img").addClass("popupImg"); $("#popup div").addClass("popupNameBg"); $('#popup').slideDown("300",function(){ }) }) $('#popup').click(function(){ $('#popup').slideUp("300"); // img = 0; // $('#popup img').remove(); console.log(img+"third"); // return false; }) // ********************************************On scroll load images function. $(window).scroll(function() { if($(window).scrollTop() === $(document).height() - $(window).height()){ // Second AJAX call to load images based on start(a) and end points(b) if(b>length1)return; // stop loading once images in server are all loaded. console.log($(window).scrollTop()); console.…
tagged with: ajax
duplicate of: http://stackoverflow.com/q/203198

http://stackoverflow.com/comment/71771374
type: Comment
score: 3
has text: Data URI's don't work on all browsers. Especially even recent versions of IE.
comment on: http://stackoverflow.com/a/35550491
type: AnswerComment

http://stackoverflow.com/a/28207162
has body: I don't see you actually "passing" anything there, but if you need your object to be in the global scope, you can assign it to a property on window: $(function () { // ... window.MasterTmsUdo = { }; }); Of course, this will still be a problem if your third-party library tries to look for this object before DOM ready has run. We'd need to know how your third -party library works to be able to provide any assistance beyond this.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44779513
answers question: http://stackoverflow.com/q/28207084

http://stackoverflow.com/q/28160619
has title: Input box that accepts only a certain email domain and button that acts as submit and email domain
has comment: http://stackoverflow.com/comment/44692573
has comment: http://stackoverflow.com/comment/44692923
has comment: http://stackoverflow.com/comment/44692959
has comment: http://stackoverflow.com/comment/44694384
type: Question
has body: I realize the title is long and confusing, so let me clarify. I'm trying to create a sign up input form where the user signs up with their email. But I'm only accepting emails with a certain domain, for example "blah@abc.com" I would like to create an input form that allows the user to type in the unique portion of their email ("blah") and create a button that acts as a submit button and adding the "@abc.com" portion of the email. When the user finishes typing, they can hover over that button (button:hover) and only then does it turn into a clickable button. In short, the user doesn't have to input the @whatever.com part of the email. I'm relatively new to programming/web dev and I know this task will involve some Python/Javascript. If you have the time, let me in on the details as to how this can be accomplished. Thanks in advance! What I have so far: Welcome About Contact
tagged with: javascript
tagged with: jquery
tagged with: python-2.7
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: email
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28192721
has answer: http://stackoverflow.com/a/28192855
has answer: http://stackoverflow.com/a/28192999
has body: Hi I am trying to change the images in my gallery when the page loads. I am trying to do it the way that has been most posted about on here function changeImg(){ var img1 = document.getElementById("wows1_0"); img1.src = "WOWSlider/data1/images/ContactSupport.jpg"; } then on calling it here and here is the code of my gallery But every time I call the function The images are never changed. I would be very grateful if anyone could provide any guidance or assistance.
has comment: http://stackoverflow.com/comment/44753027
type: Question
has comment: http://stackoverflow.com/comment/44755848
has answer: http://stackoverflow.com/a/28192922
tagged with: javascript
tagged with: image
score: 0
has comment: http://stackoverflow.com/comment/44752726
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: gallery
has title: Changing Img Src through JavaScript
type: UnansweredQuestion

http://stackoverflow.com/a/28195684
answers question: http://stackoverflow.com/q/28195536
score: 0
type: Answer
has body: The problem is that the content of the first parameter needs to go between quotes or wrapped in a function. If you change what you have: &lt;body onload="setInterval(anim(document.getElementById('test'), 'left', 'px', 140, 300, 500), 500);"&gt; and wrap the "anim" call in single quotes: &lt;body onload="setInterval('anim(document.getElementById(\'test\'), \'left\', \'px\', 140, 300, 500)', 500);"&gt; It looks ugly, but it works just fine. You can see it in this jsfiddle: http://jsfiddle.net/rwowf5j8/1/

gmail
type: Tag
tag name: gmail
tags question: http://stackoverflow.com/q/28251496

http://stackoverflow.com/comment/44814064
comment on: http://stackoverflow.com/q/28225390
score: 0
type: QuestionComment
type: Comment
has text: Also worth mentioning that in your code block you x'd out the numbers in that line, but in your post above it the numbers are present. Don't know if it is important that those are hidden, but they're there.

http://stackoverflow.com/comment/44912795
comment on: http://stackoverflow.com/q/28279346
type: Comment
type: QuestionComment
has text: The whole design looks overly complicated. You should probably simply keep the context in closure instead of setting functions in data.
score: 1

http://stackoverflow.com/a/28262727
score: 4
answers question: http://stackoverflow.com/q/28262715
upvote count: 4
has comment: http://stackoverflow.com/comment/44882286
accepted answer of: http://stackoverflow.com/q/28262715
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Change your regex to, /(foo{)[^{}]*(}bar)/ OR /(foo{)[\s\S]*?(}bar)/ so that it would match also a newline character. [^{}]* matches any character but not of { or }, zero or more times. [\s\S]*? matches any space or non-space characters, zero or more times non-greedily.

http://stackoverflow.com/comment/44838348
score: 0
type: Comment
has text: @aduch it did already, but yet, I've made it even more clear.
comment on: http://stackoverflow.com/a/28238547
type: AnswerComment

d3.js
tags question: http://stackoverflow.com/q/28259167
tags question: http://stackoverflow.com/q/28221121
tags question: http://stackoverflow.com/q/28156682
tags question: http://stackoverflow.com/q/28186109
tags question: http://stackoverflow.com/q/28148169
tags question: http://stackoverflow.com/q/28195197
tags question: http://stackoverflow.com/q/28179576
tags question: http://stackoverflow.com/q/28249941
tags question: http://stackoverflow.com/q/28227738
tags question: http://stackoverflow.com/q/28200628
tags question: http://stackoverflow.com/q/28276964
tags question: http://stackoverflow.com/q/28156873
tags question: http://stackoverflow.com/q/28201029
tags question: http://stackoverflow.com/q/28270988
tags question: http://stackoverflow.com/q/28209417
tags question: http://stackoverflow.com/q/28269139
tags question: http://stackoverflow.com/q/28173084
tags question: http://stackoverflow.com/q/28201934
tags question: http://stackoverflow.com/q/28267604
tags question: http://stackoverflow.com/q/28169982
tags question: http://stackoverflow.com/q/28235034
tags question: http://stackoverflow.com/q/28266642
tags question: http://stackoverflow.com/q/28173908
tags question: http://stackoverflow.com/q/28164952
tags question: http://stackoverflow.com/q/28240796
tags question: http://stackoverflow.com/q/28276226
tags question: http://stackoverflow.com/q/28191373
tags question: http://stackoverflow.com/q/28231327
tags question: http://stackoverflow.com/q/28197121
tags question: http://stackoverflow.com/q/28259440
type: Tag
tags question: http://stackoverflow.com/q/28238349
tags question: http://stackoverflow.com/q/28205166
tags question: http://stackoverflow.com/q/28136410
tags question: http://stackoverflow.com/q/28268342
tags question: http://stackoverflow.com/q/28179214
tags question: http://stackoverflow.com/q/28249386
tags question: http://stackoverflow.com/q/28185165
tags question: http://stackoverflow.com/q/28215705
tags question: http://stackoverflow.com/q/28145660
tags question: http://stackoverflow.com/q/28129412
tags question: http://stackoverflow.com/q/28199445
tags question: http://stackoverflow.com/q/28222864
tags question: http://stackoverflow.com/q/28190910
tags question: http://stackoverflow.com/q/28150592
tags question: http://stackoverflow.com/q/28157447
tags question: http://stackoverflow.com/q/28265857
tags question: http://stackoverflow.com/q/28232422
tags question: http://stackoverflow.com/q/28246202
tags question: http://stackoverflow.com/q/28244405
tags question: http://stackoverflow.com/q/28266047
tags question: http://stackoverflow.com/q/28152150
tags question: http://stackoverflow.com/q/28190215
tags question: http://stackoverflow.com/q/28241553
tags question: http://stackoverflow.com/q/28129615
tags question: http://stackoverflow.com/q/28232333
tag name: d3.js
tags question: http://stackoverflow.com/q/28243431
tags question: http://stackoverflow.com/q/28262940
tags question: http://stackoverflow.com/q/28214569
tags question: http://stackoverflow.com/q/28173902
tags question: http://stackoverflow.com/q/28199173
tags question: http://stackoverflow.com/q/28146254
tags question: http://stackoverflow.com/q/28185101
tags question: http://stackoverflow.com/q/28256004
tags question: http://stackoverflow.com/q/28242022
tags question: http://stackoverflow.com/q/28133543
tags question: http://stackoverflow.com/q/28199330
tags question: http://stackoverflow.com/q/28163639
tags question: http://stackoverflow.com/q/28125053
tags question: http://stackoverflow.com/q/28232205
tags question: http://stackoverflow.com/q/28167871
tags question: http://stackoverflow.com/q/28183376
tags question: http://stackoverflow.com/q/28217217
tags question: http://stackoverflow.com/q/28192560
tags question: http://stackoverflow.com/q/28156176
tags question: http://stackoverflow.com/q/28270818
tags question: http://stackoverflow.com/q/28122408
tags question: http://stackoverflow.com/q/28164666
tags question: http://stackoverflow.com/q/28278476

http://stackoverflow.com/q/28193048
has answer: http://stackoverflow.com/a/28193264
has title: bootstrap-datepicker from/to range by month
tagged with: twitter-bootstrap
score: 0
possible better answer: http://stackoverflow.com/a/28193140
answer count: 3
accepted answer: http://stackoverflow.com/a/28193264
tagged with: javascript
tagged with: date
has body: I'm using the https://github.com/eternicode/bootstrap-datepicker My form is consisting of a From Date and a To Date input (#fromdate/#todate). The minViewMode is set to months for both. Once a From Date is selected, the user should be able to select ONLY from the #fromdate value PLUS one month. Ie. if user selects March in From Date, only April and forwards should be selectable in the To Date .datepicker. Disabling months prior to #fromdate for #todate is handled like so: $("#fromdate").datepicker({ minViewMode: 1 }).on('changeDate', function(ev){ $("#todate").datepicker('setStartDate',ev.date); }); I am probably missing something obvious, but I can't seem to get a grip on "adding" 1 month to the setStartDate method.
has answer: http://stackoverflow.com/a/43354473
type: AnsweredQuestion
tagged with: jquery
type: Question
tagged with: datepicker
has answer: http://stackoverflow.com/a/28193140

http://stackoverflow.com/comment/44798871
type: Comment
comment on: http://stackoverflow.com/a/28206919
type: AnswerComment
has text: Your HTML is invalid. You can't have ` ` around ` `, ` ` has to be a child of ` ` or ` `.
score: 0

http://stackoverflow.com/q/28211406
tagged with: datetime
answer count: 1
has answer: http://stackoverflow.com/a/28211552
has body: I'm trying to find the difference between two Date arrays and then separate all different dates into another array of dates for later use. Also there is a little more functionality I want it to do. There is a variable diffDates. It should have to be an array because it can hold index of more than one months. With the help of that diffDates I want to populate selectDiffDates. Please review this code to make it better and possibly faster and any ideas to implement the above mentioned last functionality in this piece of code. Thanks. Link to fiddle. Array.prototype.diff = function(a) { return this.filter(function(i) { return (a.indexOf(i) &lt; 0); }); } var monthIndex = [0,1,2,3,4,5,6,7,8,9,10,11]; var dMarked=[], dFiltered=[], selectDiffDates = []; dMarked=["Thu Jan 01 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Feb 05 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Mar 05 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Apr 02 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Jun 04 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Jan 01 2015 00:00:00 GMT+0500 (Pakistan Standard Time)"]; dFiltered=["Thu Jan 08 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Feb 12 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Mar 12 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Apr 09 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu May 07 2015 00:00:00 GMT+0500 (Pakistan Standard Time)", "Thu Jun 11 2015 00:00:00 GMT+0500 (Pakistan Standard Time)"]; var dMarkedMonths = [], dFilteredMonths = []; for(var i=0; i&lt;dMarked.length; i++){ dMarkedMonths.push( monthIndex[new Date(dMarked[i]).getMonth()]); } for(var i=0; i&lt;dFiltered.length; i++){ dFilteredMonths.push( monthIndex[new Date(dFiltered[i]).getMonth()]); } console.log(dMarkedMonths); console.log(dFilteredMonths); var diffDates = dFilteredMonths.diff( dMarkedMonths ); console.log("Difference: "+diffDates); for(var d=0; d&lt;dFiltered.length; d++){ if(new Date(dFi…
tagged with: arrays
tagged with: javascript
tagged with: date
has title: Finding difference between two arrays of Dates in JavaScript
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28211552
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/28139015
type: Question
upvote count: 2

http://stackoverflow.com/a/28198805
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/28198707
has comment: http://stackoverflow.com/comment/44763983
type: Answer
accepted answer of: http://stackoverflow.com/q/28198707
upvote count: 4
has body: When you use the following line: console.log( "JSON Data: " + json ); The code casts the entire object as a string, which is usually not a very useful things as it replaces anything that is an object with this nice [object Object] you're getting. You could either log the object itself in a separate parameter: console.log( "JSON Data: ", json ); Or dump the JSON representation of the object: console.log( "JSON Data: ", JSON.stringify(json)); But you'll probably see that your json variable is already what you expected.
type: AcceptedAnswer

http://stackoverflow.com/q/28151450
tagged with: instance
has comment: http://stackoverflow.com/comment/44674239
tagged with: methods
type: Question
has comment: http://stackoverflow.com/comment/44674374
has title: Subclassing String in JavaScript
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: string
favorite count: 0
has body: I have a string method String.prototype.splitName() that splits an author's name (a string) in first name(s) and a last name. The statement var name = authorName.splitname(); returns an object literal name with name.first = "..." and name.last = "..." (properties of name have string values). Recently I was told that it is unwise to have splitName() as a method of the public String() class, but that I should make a private subclass of String and extend the subclass (instead of the public class) with my function. My question is: how do I perform subclassing for strings so that after I assign authorName to the new subclass name = authorName.splitname(); is still a valid statement? And how would I assign authorName to the new private subclass of String?
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44674212
has answer: http://stackoverflow.com/a/28188150
score: 3

http://stackoverflow.com/a/28265600
upvote count: 1
type: AcceptedAnswer
has body: An imitation of the supplied code seems to work: HTML Click to trigger Fancybox jQuery $(document).ready(function () { $('.fancybox').fancybox({ padding: 0, type : 'image', openEffect : 'none', closeEffect : 'none' }); }); See this demo. So things you should try to get it working: Use the latest version of jQuery and the latest version of fancybox. Sometimes there are problems with the versions. Make sure that fancybox.js is actually loaded Specify your image links in the full http://.. format I think if you follow all these points, it'll work. Otherwise, check if any of the other plugins cause problems with fancybox.
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28263875
answers question: http://stackoverflow.com/q/28263875
has comment: http://stackoverflow.com/comment/44891081
has comment: http://stackoverflow.com/comment/44890021

http://stackoverflow.com/comment/44648326
has text: You forgot to tell us what this code is supposed to do.
comment on: http://stackoverflow.com/q/28134271
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28161752
linked to: http://stackoverflow.com/q/25093276
has title: NodeJS command "npm install express --save" raising exception
tagged with: node.js
type: Question
has comment: http://stackoverflow.com/comment/44694881
has comment: http://stackoverflow.com/comment/44694835
has body: I have NodeJS installed and am trying to do this tutorial for making a NodeJS chat app: http://socket.io/get-started/chat/ I created the package.json file in it's own dedicated folder, and executed in the windows command prompt this npm command from the tutorial I linked. npm install --save express@4.10.2 The error I receive is as follows: Error: ENOENT, stat 'C:\Users\david\AppData\Roaming\npm' So I wemt to the ExpressJS page, tried the command they list on their site, which is. npm install express --save And I receive the same error. Anyone know how to fix this, please?
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/44699169
has comment: http://stackoverflow.com/comment/44695654
answer count: 0
has comment: http://stackoverflow.com/comment/44694833
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44712039

http://stackoverflow.com/q/28166652
tagged with: ng-hide
tagged with: angularjs-ng-click
upvote count: 0
has answer: http://stackoverflow.com/a/28166764
type: Question
has comment: http://stackoverflow.com/comment/44703517
tagged with: javascript
has title: Hiding individual divs in ng-repeat loop
downvote count: 3
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44703750
type: UnansweredQuestion
score: -3
has body: I have a ng-repeat loop, which displays individual panels (one for each loop iteration). In each panel I have a 'mark as read' button that has a ng-click event. I want to be able to hide the panel that the mark as read button is clicked on, but so far I can only get all the panels to show and hide, not the individual selected panel. How can I get the ng-click to hide the selected panel? Thanks Sorry here is some code of what I am doing now: The panel section: {{item.title}} {{item.text}} Mark As Read And this is my controller function: $scope.msgRead = true; $scope.markAsRead = function (id) { $scope.msgRead = $scope.msgRead === false ? true : false; }; Stephen

http://stackoverflow.com/a/49966779
answers question: http://stackoverflow.com/q/28279305
type: Answer
score: 4
accepted answer of: http://stackoverflow.com/q/28279305
has body: First, lets do a simple experiment (tested on Jasmine 2.0): it("sandbox playground", function() { var twin1 = jasmine.createSpy('twin brother').and.returnValue({}); var twin2 = jasmine.createSpy('twin brother').and.returnValue({}); var unnamed = jasmine.createSpy(undefined).and.returnValue({}); var skipped = jasmine.createSpy().and.returnValue({}); expect(twin1).toHaveBeenCalled(); expect(twin2).toHaveBeenCalled(); expect(unnamed).toHaveBeenCalled(); expect(skipped).toHaveBeenCalled(); }); Results: Firefox 56.0.0 (Windows 7 0.0.0) Sample Tests. sandbox playground FAILED Expected spy twin brother to have been called. @tests/sampleTests.spec.js:37:9 Expected spy twin brother to have been called. @tests/sampleTests.spec.js:38:9 Expected spy unknown to have been called. @tests/sampleTests.spec.js:39:9 Expected spy unknown to have been called. @tests/sampleTests.spec.js:40:9 So, to answer your questions: It is for meaningful message when some assertions fail. As we can see, the framework itself doesn't check them, so formally there aren't any. But anyway I would suggest to introduce some conventions for yourself to have readable and meaningful test results to minimize effort of debugging failed test cases. As we can see, it is possible. But as mentioned, I would suggest not to do it.
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28138610
answers question: http://stackoverflow.com/q/28138228
downvote count: 0
has comment: http://stackoverflow.com/comment/44649454
has comment: http://stackoverflow.com/comment/44649417
score: 1
has body: nrSlide=3; function Load(){ nrShown = 0; vect = new Array(nrSlide + 1); vect[0] = document.getElementById("slide1"); vect[0].style.visibility = "visible"; for (var i = 1; i < nrSlide; i++) { vect[i] = document.getElementById("slide" + (i+1)); } ShowNextPrev(nrShown); } function next(){ nrShown++; if(nrShown == nrSlide) { nrShown=0; } ShowNextPrev(nrShown); Effect(); } function prev(){ nrShown--; if(nrShown == -1) { nrShown = nrSlide -1; } ShowNextPrev(nrShown); Effect(); } function ShowNextPrev(nrShown) { var nrShown2 = nrShown == nrSlide-1 ? -1 : nrShown; document.querySelector(".next").querySelector("input").style.backgroundImage = "url("+document.querySelector(".slider").querySelectorAll("img")[nrShown2+1].src+")"; document.querySelector(".next").querySelector("input").style.backgroundSize = "contain"; var nrShown3 = nrShown == 0 ? nrSlide : nrShown; document.querySelector(".prev").querySelector("input").style.backgroundImage = "url("+document.querySelector(".slider").querySelectorAll("img")[nrShown3-1].src+")"; document.querySelector(".prev").querySelector("input").style.backgroundSize = "contain"; } // Effect function Effect(){ for (var i=0; i < nrSlide; i++){ vect[i].style.opacity = "0"; vect[i].style.visibility = "hidden"; } vect[nrShown].style.opacity = "1"; vect[nrShown].style.visibility = "visible"; } Load(); .ctrl > div { display: inline-block; } .slides > img { height: 40px; } This approach should do it. In plain JavaScript using querySelector() and querySelectorAll. You just need the code. The CSS and HTML are just altered to make it work for the example.
has comment: http://stackoverflow.com/comment/44648931
has comment: http://stackoverflow.com/comment/44649385
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28138228
type: Answer

http://stackoverflow.com/q/28257726
type: AnsweredQuestion
has title: Dropzone.js fade on removeFile()
downvote count: 0
has body: I'm using dropzone.js and my "remove when it's finished" code looks like this: Dropzone.options.myAwesomeDropzone = { init: function () { this.on("success", function (file) { this.removeFile(file); }); } }; It works as expected, but the section is removed instantly. What I'd like is for that to take a second and fade out so that the user can actually see that the image completed before it's gone. How can I add some kind of transition to removeFile?
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
tagged with: dropzone.js
has answer: http://stackoverflow.com/a/29928251
accepted answer: http://stackoverflow.com/a/29928251
upvote count: 4

http://stackoverflow.com/comment/44794463
type: Comment
has text: http://i62.tinypic.com/do8jrm.jpg - Site at UIWebView http://i59.tinypic.com/2r5t6jd.jpg - Site at Safari
comment on: http://stackoverflow.com/q/28213390
score: 0
type: QuestionComment

http://stackoverflow.com/q/28130861
tagged with: diff
type: AnsweredQuestion
has title: Display Git diff on client side in javascript as html
has answer: http://stackoverflow.com/a/28131892
type: Question
has comment: http://stackoverflow.com/comment/75231578
downvote count: 0
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/28131892
tagged with: patch
has comment: http://stackoverflow.com/comment/44635454
has body: So, in short, I'm basically looking for some info on: a way to convert Git's diff format (that it gives you with the github api) into some kind of html format, like on the actual github website. If there's nothing like that, I would like to have some information on the format of git's diff file, so I can write my own.
score: 8
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/121064803
linked to: http://stackoverflow.com/q/28111035
tagged with: git

http://stackoverflow.com/a/28141418
answers question: http://stackoverflow.com/q/28139690
type: Answer
has comment: http://stackoverflow.com/comment/44656719
has comment: http://stackoverflow.com/comment/44657127
has body: My bad, it does work. I learn something new. My old solution is fine, I think: $(document).ready(function () { $('#dwa').click({nowa: "k"}, nowa); $('#jeden').css({ "filter": "blur(10px)", "transition": "2s" }); }); but the mistake in your code is not that. You should change the blurRad function to: function blurRad(e) { $(this).css({ "-webkit-filter": "blur(" + e + "px)", "filter": "blur(" + e + "px)", "-moz-filter": "blur(" + e + "px)", "-o-filter": "blur(" + e + "px)", "-ms-filter": "blur(" + e + "px)" }); }; and it works like a charm.
has comment: http://stackoverflow.com/comment/44656179
accepted answer of: http://stackoverflow.com/q/28139690
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/44814810
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28225622
has text: @zerkms we really have to separate between syntax and values here.
score: 0

http://stackoverflow.com/q/28187381
has answer: http://stackoverflow.com/a/28187462
score: -1
has answer: http://stackoverflow.com/a/28187487
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I would like to know in what way passing data from a form to a php file is best? I have used ajax to retrieve a page and load into a div tag on the "master page", now there is a form on this sub page that needs to upload a file. So far i have got it to upload and the form posts to a new .php file where the data is handled. When the data is handled and the page then navigates back to the master page, i noticed upon form submission when it is directed to the new php page, it shows blank white while the code executed and then redirects to the master page, my question is: In order to eliminate the white page while code is being executed, is there a better way to go about this or is this sufficient and what can i do to not show the white page? Thanks in advance. Warren
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44743034
accepted answer: http://stackoverflow.com/a/28187487
tagged with: php
has title: Html with php and ajax
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28187462
type: AnsweredQuestion

http://stackoverflow.com/comment/44847594
comment on: http://stackoverflow.com/q/28237111
type: QuestionComment
type: Comment
has text: can you also include your folder structure? the url_for is assuming the scan.jpeg is here: flask_app/uploaded_file/user/user-1/scan.jpeg
score: 0

http://stackoverflow.com/comment/44755010
type: Comment
comment on: http://stackoverflow.com/a/28194040
has text: isNaN will no check Interger but Number (float and int): so alert(!isNaN(10.6)); is not correct for an age.
score: 1
type: AnswerComment

http://stackoverflow.com/a/28195657
type: Answer
answers question: http://stackoverflow.com/q/28195465
downvote count: 0
has body: This works fine: AngularJS Plunker content here content here I've added a fiddle: http://plnkr.co/edit/S06ufeHI2j5lKs5LxbRT?p=preview I have also fixed your fiddle there were a number of things wrong http://jsfiddle.net/97nkv1v1/4/
score: 1
has comment: http://stackoverflow.com/comment/44759726
upvote count: 1

http://stackoverflow.com/comment/44630664
type: AnswerComment
score: 0
has text: It works, but when I can use input.data('price') instead of input.value it doesn't work
type: Comment
comment on: http://stackoverflow.com/a/28128743

http://stackoverflow.com/q/28226227
answer count: 1
has answer: http://stackoverflow.com/a/28250318
tagged with: javascript
tagged with: asp.net
tagged with: email
has comment: http://stackoverflow.com/comment/44837885
type: AnsweredQuestion
has title: submitting form via email with dynamic fields
has comment: http://stackoverflow.com/comment/44817342
has body: Thank you in advance. The code now works exactly as I need it too but I'm not sure how to go about passing each new line to my .asp mail handler if all the input names are the same. Where exactly in my code would I index the input boxes so that I can call them uniquely during submission and email themwith .asp mail handler? Thank you to the stackoverflow community for helping me troubleshoot the code I've written thus far! HTML Item Quantity: Width: Height: Remove Add More... CSS ul { list-style: none; display:inline-block; margin:0 0 5px; } ul li { display: inline-block; } .remove-line { display:inline-block; } I have this code set up http://jsfiddle.net/KeithDickens/afqh4a5o/2/ $(document).ready(function () { var max_fields = 10; //maximum input boxes allowed var x = 1; //initlal text box count $('.catalog-fieldset').each(function () { var $wrapper = $('.catalog-wrapper', this); $(".add-field", $(this)).click(function (e) { e.preventDefault(); if (x < max_fields) { //max input box allowed x++; //text box increment $('.catalog-items:first-child', $wrapper).clone(true).appendTo($wrapper).find('input').val('').focus(); } }); $('.catalog-items .remove-line', $wrapper).click(function () { x = x - 1; //initlal text box count if ($('.catalog-items', $wrapper).length > 1) $(this).parent('.catalog-items').remove(); }); }); });
type: Question
accepted answer: http://stackoverflow.com/a/28250318
score: 0

http://stackoverflow.com/comment/44701440
score: 3
comment on: http://stackoverflow.com/q/28165534
type: QuestionComment
has text: no you cannot access that in second controller but if you want something like this to share function b/w controllers create a angular service .
type: Comment

http://stackoverflow.com/comment/44808702
has text: IMO, in general, JS is usually better thought of as a scheme/functional language than a OO language. Due to that, how you approach designing the software differs, and the fundamental premise of this question is kind of broken
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28221501

http://stackoverflow.com/q/28134588
tagged with: http://stackoverflow.com/tag/html
answer count: 1
linked to: http://stackoverflow.com/q/302122
tagged with: timer
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44641413
tagged with: css
has answer: http://stackoverflow.com/a/28134629
has comment: http://stackoverflow.com/comment/44641509
has comment: http://stackoverflow.com/comment/44641347
score: 0
has comment: http://stackoverflow.com/comment/44641392
type: Question
tagged with: javascript
tagged with: jquery
has body: My question is: what is the most intelligent way to use a for loop which affects CSS via jQuery and a timer together? Here's a fiddle: http://jsfiddle.net/j6jLh2dn/ Below is my attempt at implementing a timer which defines a certain amount of time that you can either press the enter key, or not press the enter key, and depending on the situation, it will push a value to an array. setTimeout(function(){ if(e.which == 13){ choice = 1; } else { choice = 0; } if(nBack == randomNumber){ if(choice == 1){ correct.push(0); } else if(choice == 0){ incorrect.push(0); } } else { if(choice == 0){ correct.push(0); } else if(choice == 1){ incorrect.push(0); } } }, 1000 * i * y)(); and here's the portion which should select a certain css id, then edit it based on a random number being chosen: randomNumber = Math.floor( Math.random() * (m+1) ); while(randomNumber === history[i-1]){ randomNumber = Math.floor( Math.random() * (m+1) ); } $("." + randomNumber).css({ "background-color": "#ffe"}); history[i] = randomNumber; I have gotten it running without the timer with just alerts, and I have also gotten the timer to work, but upon trying to integrate the two and have it affect CSS, it won't work.
has title: JQuery changing CSS in for loop with timer
has comment: http://stackoverflow.com/comment/44641356

http://stackoverflow.com/comment/44873980
score: 0
type: Comment
has text: Doesn't matter, that's just an example, I've now replace the string html with the url of this SO question
comment on: http://stackoverflow.com/a/28245982
type: AnswerComment

http://stackoverflow.com/q/28172243
has title: How to disable promise manager in selenium-webdriver
possible better answer: http://stackoverflow.com/a/46781183
tagged with: selenium
has answer: http://stackoverflow.com/a/28199313
has answer: http://stackoverflow.com/a/46781183
type: Question
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28199313
downvote count: 0
has body: As detailed in https://code.google.com/p/selenium/wiki/WebDriverJs#Promises, selenium-webdriver uses an automatic promise manager to keep people from having to do repetitive promise chaining. However, in some cases the assumption made by the promise manager, that successive calls should be chained is wrong, and it should be deactivated. An example would be: var isLoaded = function (browser) { var waitForJS = waitForElement(browser, By.css('body.js')); var waitForMobile = waitForElement(browser, By.css('#mobile_landing_page')); return Promise.any([waitForJS, waitForMobile]); }; Here I want to create a generic function, that no matter whether it is on a mobile landing page or the desktop site waits until any of those two conditions is fulfilled. The way the promise manager interprets it though is var isLoaded = function (browser) { var waitForMobile = waitForElement(browser, By.css('#mobile_landing_page')); var waitForJS = waitForElement(browser, By.css('body.js')).then(function () { return waitForMobile; }); return Promise.any([waitForJS, waitForMobile]); }; This can obviously never resolve for the non-mobile case, since only one of those can be true at a time. Is there a way to completely disable the promise manager and manually schedule all calls? Here's the definition of waitForElement var waitForElement = function (browser, element, timeout) { return browser.wait(until.elementLocated(element), timeout); };
favorite count: 0
tagged with: selenium-webdriver
type: AnsweredQuestion
score: 2
upvote count: 2

http://stackoverflow.com/a/28230620
has comment: http://stackoverflow.com/comment/44823803
type: Answer
has comment: http://stackoverflow.com/comment/44823748
score: 3
answers question: http://stackoverflow.com/q/28230586
upvote count: 3
has comment: http://stackoverflow.com/comment/44823715
has comment: http://stackoverflow.com/comment/44823816
has comment: http://stackoverflow.com/comment/44823930
has body: It's an anonymous function, so you'd need to call it immediately and assign the results to a variable if you want to work with it. var theOutput = function() { return { width: document.documentElement.clientWidth; height: document.documentElement.clientHeight; }; }(); After the edit, it is no longer anonymous, so to call it: var theOutput = getViewport(); console.log('The width is: ' + theOutput.width);
downvote count: 0
has comment: http://stackoverflow.com/comment/44823901

http://stackoverflow.com/comment/44635921
score: 0
has text: Have you considered using the image moments instead or fitting to a circle? The idea would be that a circle has a lot of primary moment but not much secondary. See, eg, "Hu moments" or http://en.wikipedia.org/wiki/Image_moment
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28131557

http://stackoverflow.com/a/28160996
has body: If you want the user to input a date, use: &lt;input type="date" /&gt; Supporting browsers will provide a calendar for the user to select from in all convenience. On the server-side, you will receive a date in the standard YYYY-MM-DD format.
has comment: http://stackoverflow.com/comment/44694031
has comment: http://stackoverflow.com/comment/44693970
answers question: http://stackoverflow.com/q/28160918
type: Answer
has comment: http://stackoverflow.com/comment/44693168
has comment: http://stackoverflow.com/comment/44693217
score: 0

http://stackoverflow.com/comment/44764681
type: Comment
type: QuestionComment
has text: Some alternatives: a) Let the DBMS do it. b) Check the database for clashes. c) Use UUID. d) ...
comment on: http://stackoverflow.com/q/28199100
score: 0

http://stackoverflow.com/q/28233985
has answer: http://stackoverflow.com/a/28234094
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
score: -4
has comment: http://stackoverflow.com/comment/44829992
has body: I have a list of links that are by default sorted alphabetically. For example Aeroplanes Books Cars Diggers This list is auto generated and in real life about has about 30 links, how can I easily order these with little overhead using javascript/jquery. The order will be changing often to boost categories depending on season/popularity a number of other deciding factors.
accepted answer: http://stackoverflow.com/a/28234094
downvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44829887
has title: Custom order list of links

http://stackoverflow.com/comment/44705845
comment on: http://stackoverflow.com/q/28167980
score: 0
has text: Can you tell as any details about the `500 Internal Server Error`? At some place you should find some details (server error log, event viewer, ...).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28210667
linked to: http://stackoverflow.com/q/9329446
type: Question
has comment: http://stackoverflow.com/comment/44800016
has answer: http://stackoverflow.com/a/28210893
has comment: http://stackoverflow.com/comment/44793243
has comment: http://stackoverflow.com/comment/44793061
tagged with: arrays
answer count: 1
tagged with: javascript
has title: Javascript. Creating Array-like objects. Is it possible to make .length autoincrement?
has comment: http://stackoverflow.com/comment/44789017
upvote count: 3
has comment: http://stackoverflow.com/comment/44799460
has comment: http://stackoverflow.com/comment/44785860
favorite count: 0
has comment: http://stackoverflow.com/comment/44786166
has comment: http://stackoverflow.com/comment/44785863
has body: There is so much about creating and inheritance of Array-like objects, but one of my questions remains unanswered: is it possible somehow to add a auto-incrementing .length property to the object? Sample script: function ArrayLike(){ this.length=0; this.splice=[].splice; } var Arr=new ArrayLike(); Arr[0]=0; Arr[1]=1; alert(Arr.length); //alerts "0" instead of "2" Of course, i can add some method like: function ArrayLike(){ this.length=0; this.splice=[].splice; this.push=function(toadd){ this[this.length++]=toadd; } } But this is not what I'm trying to do. So is it possible to increment .length when I add something to the object in a way Arr[N]='blah-blah-blah'?
tagged with: object
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44788363
downvote count: 0
accepted answer: http://stackoverflow.com/a/28210893
has comment: http://stackoverflow.com/comment/44793673
has comment: http://stackoverflow.com/comment/44788196

http://stackoverflow.com/q/28260972
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: My thanks in advance for the assistance , The problem I have is as follows : I am trying to create a movable model in three.js , and would like to create a model hierarchy using the JSON variable "model" , function stackerMove(){ var models = [ {"File Name":"bogie.js","variable":"bogie","Type":"part","Parent":"modelParent","Description":"none"}, {"File Name":"swivel.js","variable":"swivel","Type":"part","Parent":"Pivot1","Description":"none"}, {"File Name":"boom.js","variable":"boom","Type":"part","Parent":"modelParent","Description":"none"}, {"File Name":"bucket.js","variable":"bucket","Type":"part","Parent":"modelParent","Description":"none"}, {"File Name":"","variable":"Pivot1","Type":"pivot","Parent":"modelParent","Description":"none"} ]; // This is overall model storage array for the model. modelParent = new THREE.Object3D(); modelLoader(models) scene.add(modelParent) } function modelLoader(models){ for (var i = 0; i &lt; models.length; i++) { // Load in the mesh and add it to the scene. if (models[i]["Type"]=="part") { var loader = new THREE.JSONLoader(); loader.load( "models/"+ models[i]["File Name"], function(geometry){ var material = new THREE.MeshLambertMaterial({color: 0x336699}); temp = new THREE.Mesh(geometry, material); //*********(here is the issue )********* //console.log(models[i]["File Name"]) does not work here //window[models[i]["File Name"]].add(temp) does not work modelParent.add(temp) }); } else{ //all of the pivots would load here..... }; }; at the point marked above *****here is the issue **** , I would like to load each model into the "parent" element of the JSON (models) , however the model json variables do not parse into the loader .load() function , to begin with , is this a suitable way to approach this .... or is there a way to parse model(the variable above) element into the array ? Thanks again
has comment: http://stackoverflow.com/comment/44977592
tagged with: three.js
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44879582
type: Question
tagged with: http://stackoverflow.com/tag/json
has title: Loading Three.js models (.js files) into a hierarchy
tagged with: 3d

http://stackoverflow.com/a/28232667
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28232102
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: To answer your question directly, you can't because this inside a generator function is not the generator instance, it is the context of the function call. You could do: function find(next) { process.nextTick(function() { next(1); }); }; var it = (function* main() { var k = yield find(it.next.bind(it)); console.log(k); })(); it.next(); but that's pretty hard to follow. Generally this would be accomplished with a coroutine library like co. With that, you would yield a promise, and when the promise is resolved, co will call .next with the value that the promise resolved with. var co = require('co'); function find(){ return new Promise(function(resolve){ process.nextTick(function(){ resolve(1); }); }); } co(function * (){ var k = yield find(); console.log(k); });
accepted answer of: http://stackoverflow.com/q/28232102

http://stackoverflow.com/comment/44619462
score: 0
type: Comment
type: QuestionComment
has text: Oh I see. But do you know how to format the array into the desired string format?
comment on: http://stackoverflow.com/q/28122750

http://stackoverflow.com/q/28174335
has answer: http://stackoverflow.com/a/28174396
favorite count: 0
type: AnsweredQuestion
has title: Take string from data-bind inside a link
accepted answer: http://stackoverflow.com/a/28174396
upvote count: 1
type: Question
score: 1
tagged with: knockout.js
has body: I am new to JavaScript and I am having this issue. Maybe I am asking something very dumb but I can't find a solution. I have this: I need to take the string from data-bind, replace the spaces for a + symbol and and put it inside a link. I need something like this: click So like this I end up creating a search link with the value of data bind. Also I need to target iframe2 because my site is divided into two iframes. I hope somebody can help me. Thanks!
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28222770
answers question: http://stackoverflow.com/q/28222587
score: 0
type: Answer
has body: That's because you call the ajax() function within the loop. It's asynchronous call made in a loop statement and by the time the response arrives back to the client the loop is already over and hence the user_l_s[i] will be undefined. Change the response format to return which user has failed to login.

http://stackoverflow.com/q/28204683
has answer: http://stackoverflow.com/a/28204810
has body: I am trying to inject my factory into my unit test. I have something in my file like //inside my 'testCtrl' I have $scope.getProduct = function() { //other codes.. myFactory.getProduct() .then(function(obj){ $scope.product.id = obj.id; }) } my factory file angular.module('myApp').factory('myFactory', function($http, $q) { //codes... }) my test file. describe('unit test here', function(){ beforeEach(module('myApp')); beforeEach(module('myFactory')); beofreEach(inject(function(_$controller_, _$rootscope_) { scope._$rootScope.$new(); testCtrl = _$controller_('testCtrl', { $scope:scope }) }) //I got a Module 'plannerFactory' is not available error //How do I inject myFactory into my test file here and how do I //use it? }) I have been searching on the web and couldn't find any useful info. Could anyone help me about it? Thanks a lot!
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28205179
tagged with: angularjs
type: UnansweredQuestion
has title: How to inject factory into unit test
tagged with: unit-testing
type: Question
has answer: http://stackoverflow.com/a/28214204
tagged with: javascript

http://stackoverflow.com/a/28245829
accepted answer of: http://stackoverflow.com/q/28245792
answers question: http://stackoverflow.com/q/28245792
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44852974
type: Answer
has body: In events you want to set value to ReactiveVar object. In helpers you simply return that value of this object, helpers behaves like Tracker.autorun, they are reactive. Template.myTemplate.helpers({ edit: function () { console.log('helper'); // helpers are wrapped with Tracker.autorun, so any ReactiveVar.get() // inside this function will cause to rerun it return Template.instance().value.get() } }); Template.myTemplate.events({ 'click .edit_button': function (e, tmpl) { console.log('click'); // here you save value tmpl.value.set(newValue) } }); Template.myTemplate.created = function () { this.value = new ReactiveVar(); }

http://stackoverflow.com/a/28204349
answers question: http://stackoverflow.com/q/28204074
has comment: http://stackoverflow.com/comment/44801060
has comment: http://stackoverflow.com/comment/44801450
accepted answer of: http://stackoverflow.com/q/28204074
has comment: http://stackoverflow.com/comment/44801545
type: Answer
score: 2
has body: Use capturing groups to capture the text which are present inbetween {{ and }} &gt; var str = "what if there are multiple {{this}} and {{that}}" undefined &gt; var re = /\{\{(.*?)}}/g; undefined &gt; var s = [] undefined &gt; var m; undefined &gt; while ((m = re.exec(str)) != null) { ... s.push(m[1]); ... } 2 &gt; s [ 'this', 'that' ]
upvote count: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28172837
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44714839
has comment: http://stackoverflow.com/comment/73561878
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28172552
answers question: http://stackoverflow.com/q/28172552
has comment: http://stackoverflow.com/comment/44715066
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/116537564
has body: This is untested code, from a previous project that I worked on: var express = require('express') var app = express(); var io = require('http').Server(app); var socket = require('socket.io')(io); socket.on('connect',function(socket){ console.log('got a connection') }); io.listen(3000) Please try if these changes work for you..

http://stackoverflow.com/comment/44635750
type: AnswerComment
comment on: http://stackoverflow.com/a/28130759
score: 0
type: Comment
has text: The OP's green div does not have a specified height, so the `calc` function would not work in this case, most unfortunate. Time for me to lean about the flexbox! All the best!

http://stackoverflow.com/comment/44881172
has text: (index):259 Uncaught ReferenceError: sendRequestToFriends is not defined
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28261718
type: Comment

http://stackoverflow.com/q/28167989
has title: Animation cards Javascript and CSS
has comment: http://stackoverflow.com/comment/44706716
has comment: http://stackoverflow.com/comment/44718205
tagged with: javascript
has comment: http://stackoverflow.com/comment/44706266
upvote count: 1
has comment: http://stackoverflow.com/comment/44705884
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I would move cards on click and put them on the green table with animation of transition; then when cards are on the table, when i click on them, they must show their front face, and then return with back face. The code doesn't work, i see the back cards on the left of the page but when i click on nothing happens. var card_value = ['1B', '2B', '3B', '4B', '5B', '6B']; var card_left = []; var card_top = []; for (i = 0; 1 & lt6; i++) { card_left = 70 + 100 * (i % 4); card_top = 15 + 120 * Math.floor(i / 4); } var started = false; function moveToPlace(id) { var el = document.getElementById("card_" + id); el.style["z-index"] = "1000"; el.style["left"] = card_left[id] + "px"; el.style["top"] = card_top[id] + "px"; el.style["z-index"] = "0"; } function hideCard(id) { var el = document.getElementById("card_" + id); el.firstChild.src = "http://placehold.it/100x150/44F/000.png&text=Back"; el.style["WebkitTransform"] = "scale(1.0)"; } $(".table div").click(function() { if (started) { var el = document.getElementById("card_" + id); el.firstChild.src = card_value[id] + ".gif"; el.style["WebkitTransform"] = "scale(1.2)"; setTimeout("hideCard(" + id + ")", 1000); } else { card_value.sort(function() { return Math.round(Math.random()) - 0.5; }); for (i = 0; i < 6; i++) { setTimeout("moveToPlace(0" + i + ")", i * 100); } started = true; } }) .page { border: 1px solid #ccc; perspective: 1000; } .table { position: relative; margin: 0 0 0 200px; height: 500px; background: green; } .table div { position: absolute; left: -140px; top: 100px; -moz-transition: 0.5s ease-in-out; -o-transition: 0.5s ease-in-out; transition: 0.5s ease-in-out; -webkit-transition-property: left, top, -webkit-transform; -webkit-transition-duration: 0.5s; -webkit-transition-timing-function: ease-out, ease-out, ease-in-out; }
has comment: http://stackoverflow.com/comment/44706018
tagged with: css
tagged with: webkit-animation
answer count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44706594

http://stackoverflow.com/comment/44747060
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28188366
type: Comment
has text: <lightbulb> Thanks for the clear explanation. Those API docs will make more sense now!

http://stackoverflow.com/q/28225554
has title: Autocompleting XML values and attributes in Ace editor
accepted answer: http://stackoverflow.com/a/75629365
possible better answer: http://stackoverflow.com/a/28307882
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
has body: I'm looking to autocomplete XML tags and attributes. The valid values will come from the server. For example, If I have a tag such as, and my cursor is inside the open and closing tags, I'd like to hit control + space and have only valid values appear in the drop-down. Such as: ok, error, warning, ... Similarly for attributes, ok If my cursor has focus inside the quotes I'd like only valid audiences to appear in the drop-down when hitting control + space. Here's what I have so far. This completer completes words I'm typing. I just can't figure out how to know what kind of tag I'm inside and how to send specific values for that tag or attribute. Any ideas or examples to point me to? Thanks, /w function loadEditor() { var langTools = ace.require("ace/ext/language_tools"); editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true, enableLiveAutocompletion: true, enableSnippets: true, }); editor.getSession().setMode("ace/mode/xml"); var myCompleter = { getCompletions: function(editor, session, pos, prefix, callback) { if (prefix.length === 0) { callback(null, []); return; } $.getJSON("completions.php?a=completions&prefix=" + prefix + "&content=" + session, function(json) { callback(null, json.map(function(c) { console.log("value: " + c.value); return {value: c.value, caption: c.caption, meta: c.meta, score:c.score}; })); }) } }; langTools.addCompleter(myCompleter); }
tagged with: ace-editor
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/75629365
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28307882

http://stackoverflow.com/comment/44636593
type: Comment
type: QuestionComment
has text: @sabithpocker You're right - event delegation is the answer. Thanks!
comment on: http://stackoverflow.com/q/28131912
score: 0

http://stackoverflow.com/q/28227405
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15484729
has answer: http://stackoverflow.com/a/28227836
tagged with: javascript
tagged with: channel-api
accepted answer: http://stackoverflow.com/a/28268711
score: 0
has answer: http://stackoverflow.com/a/28242109
answer count: 3
possible better answer: http://stackoverflow.com/a/28227836
has body: I'm trying to follow this example by Dan Ristic for RTCDataChannel browser p2p communication with Google's Channel API for signaling. It seems to be failing silently - I can't get the RTCDataChannel.onopen, RTCPeerConnection.onicecandidate, or RTCPeerConnection.ondatachannel events to fire. Client JS/HTML: I AM HOST I AM CLIENT App Engine Python: from google.appengine.api import channel from django.shortcuts import render from django.http import HttpResponse import json def init(request, browser_id): token = channel.create_channel(browser_id); return HttpResponse(json.dumps({'token':token})) def send(request, browser_id): channel.send_message(browser_id, request.body) return HttpResponse() Browser Consoles: [HOST] received from google: Object {data: "{"sdp":"v=0\r\no=- 6804947085651458452 2 IN IP4 12…5000 webrtc-datachannel 1024\r\n","type":"offer"}"} test.html:34 signal receive: Object {sdp: "v=0 ↵o=- 6804947085651458452 2 IN IP4 127.0.0.1 ↵s…id:data ↵a=sctpmap:5000 webrtc-datachannel 1024 ↵", type: "offer"} test.html:22 signal send: RTCSessionDescription {sdp: "v=0 ↵o=- 600524556593905006 2 IN IP4 127.0.0.1 ↵s=…id:data ↵a=sctpmap:5000 webrtc-datachannel 1024 ↵", type: "answer"} [CLIENT] signal send: RTCSessionDescription {sdp: "v=0 ↵o=- 6804947085651458452 2 IN IP4 127.0.0.1 ↵s…id:data ↵a=sctpmap:5000 webrtc-datachannel 1024 ↵", type: "offer"} test.html:82 received from google: Object {data: "{"sdp":"v=0\r\no=- 600524556593905006 2 IN IP4 127…000 webrtc-datachannel 1024\r\n","type":"answer"}"} test.html:34 signal receive: Object {sdp: "v=0 ↵o=- 600524556593905006 2 IN IP4 127.0.0.1 ↵s=…id:data ↵a=sctpmap:5000 webrtc-datachannel 1024 ↵", type: "answer"}
tagged with: webrtc
has answer: http://stackoverflow.com/a/28268711
has title: RTCDataChannel with Google Channel API
tagged with: rtcdatachannel
tagged with: google-app-engine

http://stackoverflow.com/comment/44815285
has text: Thank for your time. Well i guess you awnser my question by switching them to absolute poition to move them. The elements do need a position to be moved arround. So i will have to do the maths.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28224099
type: Comment

http://stackoverflow.com/a/28219135
type: Answer
has body: The vertical-align property applies to inline level and table-cell elements; and div's display property is block by default, so vertical-align property is ignored. Use line-height: 32px(same as the height) instead. function checkTime(i) { if (i < 10) { i = "0" + i; } return i; } function startTime() { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); // add a zero in front of numbers<10 m = checkTime(m); s = checkTime(s); document.getElementById('time').innerHTML = h + ":" + m + ":" + s; t = setTimeout(function() { startTime() }, 500); } time
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28219087
answers question: http://stackoverflow.com/q/28219087

http://stackoverflow.com/a/28135020
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28134986
downvote count: 0
type: Answer
has body: HTML is basically used for Static Contents.If u want to have dynamic content then pages must be dynamic and there must be source to provide data like database.You can generate html files using dynamic source like php.

http://stackoverflow.com/q/28171115
type: Question
answer count: 2
has body: So I am trying to add a class to a clickable area depending on where in that area the user clicks. I have created this example: http://jsfiddle.net/aocgrp06/ now, the problem is with this bit of code: if (coordinates.x &lt; height/2 &amp;&amp; coordinates.x &lt; width-coordinates.y &amp;&amp; coordinates.x &lt; coordinates.y) { alert("top triangle"); } if (coordinates.y &gt; width/2 &amp;&amp; coordinates.x &gt; width-coordinates.y &amp;&amp; coordinates.x &lt; coordinates.y) { alert("right triangle"); } if (coordinates.x &gt; height/2 &amp;&amp; coordinates.x &gt; width-coordinates.y &amp;&amp; coordinates.x &gt; coordinates.y) { alert("bottom triangle"); } if (coordinates.y &lt; width/2 &amp;&amp; coordinates.x &lt; width-coordinates.y &amp;&amp; coordinates.x &gt; coordinates.y) { alert("left triangle"); } it isn't working as I had hoped. As you can see from the fiddle, the square has coloured edges and then a center square. What I am trying to do is add a class the the element based on the click position. For example, if the user clicks the center square, then it will add the center class. Similarly, if they click the top border, it will add the top class to the element. Has someone done something similar to this before? If so, could you please help me figure out the correct algorithm? Update So, now we have a new fiddle thanks to A. Rama. http://jsfiddle.net/aocgrp06/5/ this works fine, apart from the centre box. Naeem Shaikh suggested putting an extra div inside the box which doesn't allow propagation which would work, but it would also stop the link from working. I would prefer a pure javascript / jQuery solution, so if anyone can think of one, that would be awesome. Update 2 So, because this hasn't been explained fully, I have created a new fiddle: http://jsfiddle.net/wxca0o78/ This is the exact source code I am currently using. As you can see on the rectangle, The bottom is not detected. If I add the centre square I get an issue too.
has answer: http://stackoverflow.com/a/28171216
accepted answer: http://stackoverflow.com/a/28171216
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44713382
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28171345
has title: javascript clickable area inside a square
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28171345

http://stackoverflow.com/q/28244039
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44849039
has body: What I am trying to achieve is when I click on my class "menu" my with the class "nav" appears, and when its clicked again, it toggles so that its not visible. HTML Home Prices About Contact JavaScript $('line').click(function(){ $('ul.nav').slideToggle(); })
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/28244202
has comment: http://stackoverflow.com/comment/44849239
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44848894
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/44848990
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44848961
has title: Toggle my menu when you click my nav button

http://stackoverflow.com/comment/44863152
type: Comment
comment on: http://stackoverflow.com/q/28198933
has text: again; when you load the page on a web browser, click on 'view source' and make sure that all the proper files have been loaded (or use firefox/firebug).
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44703038
type: QuestionComment
comment on: http://stackoverflow.com/q/28166097
has text: @paul see http://jsfiddle.net/arunpjohny/b5rcLo7n/1/
score: 0
type: Comment

http://stackoverflow.com/a/28214206
has body: I found a workaround for this.Put focus on the child div and disable scrolling.
answers question: http://stackoverflow.com/q/28211912
score: 0
type: Answer

http://stackoverflow.com/comment/44857868
type: QuestionComment
comment on: http://stackoverflow.com/q/28248900
has text: Is it showing any error in the console
score: 0
type: Comment

http://stackoverflow.com/a/28264868
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28264620
has body: First of all: The load event is deprecated in version 1.8 of jQuery. click here The second: i agree with chanchal yadav about that.

http://stackoverflow.com/q/28204466
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Excessive Latency on CORS AJAX Request to Local WSGI Server in Chrome
favorite count: 0
has answer: http://stackoverflow.com/a/29305192
possible better answer: http://stackoverflow.com/a/28599879
tagged with: python
upvote count: 7
has answer: http://stackoverflow.com/a/28599879
tagged with: http
accepted answer: http://stackoverflow.com/a/29305192
type: AnsweredQuestion
score: 7
type: Question
answer count: 2
has body: Setup Two WSGI servers running locally on different ports. One server returns an html page containing javascript that does a cross-origin ajax request to the other WSGI server using jQuery. origin_server.py Serves the html at http://localhost:9010. #!/usr/bin/env python from wsgiref.simple_server import make_server def origin_html(environ, start_response): status = '200 OK' response_headers = [('Content-Type', 'text/html')] start_response(status, response_headers) f = open('./index.html', 'rb') return [f.read()] httpd = make_server('localhost', 9010, origin_html) httpd.serve_forever() cors_server.py Serves the cross-origin resource that the javascript will request. #!/usr/bin/env python from wsgiref.simple_server import make_server import json def cors_json(environ, start_response): status = '200 OK' response_headers = [ ('Content-Type', 'application/json'), ('Access-Control-Allow-Origin', '*') ] start_response(status, response_headers) return [json.dumps({'foo': 'bar'})] httpd = make_server('localhost', 9011, cors_json) httpd.serve_forever() index.html The page served by origin_sever.py. Beep boop. Code above on github here: https://github.com/thatjpk/local-wsgi-cors-ajax Versions of stuff for reference: Mid 2012 MacBook Pro, OS X 10.10 Python 2.7.6 wsgiref 0.1.2 Chrome 40.0.2214.93 (Extensions disabled and settings reset for testing.) Firefox 35.0.1 Problem Given the above I can open up two terminals, start origin_server.py in one, and cors_server.py in the other, then open a browser tab and point it to the origin server at http://localhost:9010/. This loads the page, and does the cross-origin request. Ideally, the latencies should all be very low because it's all local. However, I'm consistently seeing latencies for the cross-origin request of well over ten seconds. What's bizzarre is I've only ever seen this in Chrome in a non-incognito window. Firefox, curl, httpie, and Chrome incognito tabs on the same machine all complete the cross-origin request in sub-10ms,…
tagged with: wsgi

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/28231029

http://stackoverflow.com/comment/44937091
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28273271
score: 0
has text: Thanks. I modified hostname from bing.com to google.com, compress the three files to .zip, and rename it to .xpi, and it works.

http://stackoverflow.com/comment/44653703
comment on: http://stackoverflow.com/q/28140728
score: 0
has text: @minseong: I guess the OP does something like `arr[0].getConnectorPosition()`, which doesn't work since `getConnectorPosition` is a string.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28200502
score: 9
has answer: http://stackoverflow.com/a/28200591
tagged with: node.js
has answer: http://stackoverflow.com/a/28200859
upvote count: 9
has body: I'm trying to create a schema in Mongoose that have a map (object, associative array, key-value pairs), but no success so far. The documents of my schema must be something like this: { "_id": ObjectId("..."), "groups" { "groupA": { "value1": "...", "value2": "..." }, "groupB": { "value3": "...", }, "groupC": { "value4": "...", "value5": "...", }, ... } } groups is as object with a variable number of keys. I don't know those keys ahead of time as it'll be create by the user. Every entry in groups is another object. As before, I don't know the key identifiers, but I know that the values are String (or Boolean, or Number, doesn't matter). Of course, those keys are Strings. Is it even possible (is there anyway to build such schema/model) in Mongoose?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28200591
tagged with: mongodb
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/51190918
downvote count: 0
tagged with: mongoose
has answer: http://stackoverflow.com/a/51190918
has answer: http://stackoverflow.com/a/37957183
favorite count: 0
has title: Map in Mongoose
type: Question

http://stackoverflow.com/a/28239916
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44841539
type: Answer
answers question: http://stackoverflow.com/q/28239603
upvote count: 1
has comment: http://stackoverflow.com/comment/44841420
has body: The click event has nothing to do with c#, because it happens in the clients browser. You can react to the user event with js. If you want to do something serverside (after the user clicked), you have to create an ajax call and send the clicked-value via a postback. jQuery... What is the target with your serverside script containing the clicked table cell? Manipulating data in a database? Please specify....

http://stackoverflow.com/a/28219477
downvote count: 1
has comment: http://stackoverflow.com/comment/44919153
score: -1
answers question: http://stackoverflow.com/q/28219238
has body: I recommend you to use something different than dot for field name, because you may have problems, see What characters are allowed in the HTML Name attribute inside input tag?
upvote count: 0
has comment: http://stackoverflow.com/comment/44918305
has comment: http://stackoverflow.com/comment/44803894
type: Answer

http://stackoverflow.com/q/28146044
has comment: http://stackoverflow.com/comment/44663929
has title: Saving html form data to file
tagged with: forms
has comment: http://stackoverflow.com/comment/44664118
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/49995670
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/44663734
favorite count: 0
has answer: http://stackoverflow.com/a/28146094
has answer: http://stackoverflow.com/a/49995670
accepted answer: http://stackoverflow.com/a/28146094
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44663784
tagged with: php
has comment: http://stackoverflow.com/comment/44664028
type: AnsweredQuestion
has body: I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found that This would be possible with php etc. But I don't know How to. As a beginner at this time, I would like to save only text information in text-file simply from html form. Below I am writing simple example with simple html form and JavaScript function (without any action) &lt;html&gt; &lt;form name=myform&gt; &lt;input type=text name=mytext&gt; &lt;input type=button value=save onClick=saving()&gt; &lt;/form&gt; &lt;script&gt; function saving() { } &lt;/script&gt; &lt;/html&gt; Now I want to save text from mytext to text-file file, say mytext.txt. All data/files are accessed locally on my PC. So, How can I do that? With PHP or JavaScript?; then How? (give me some basic script/information). Also Suggest me external resource for learning interaction html form with database.
score: 2
has comment: http://stackoverflow.com/comment/44663907
linked to: http://stackoverflow.com/q/2010892
upvote count: 3

http://stackoverflow.com/comment/44900330
type: QuestionComment
comment on: http://stackoverflow.com/q/28272580
has text: Nothing, the `return alert("para")` works perfectly fine. I just want to know why the above one doesn't work.
score: 0
type: Comment

http://stackoverflow.com/q/28228663
has body: I'm trying to get sequential values from a dynamically generated array of numerical values, and add those sequential values together in pairs, in sequence. The generated array will always have an even number of values. As an example, let's say the array comes out to myArray = [2, 23, 45, 128, 92, 3]. How can I use jQuery to iterate over the generated array and get values like this? val1 = myArray[0] + myArray[1]; val2 = myArray[2] + myArray[3]; val3 = myArray[4] + myArray[5]; The array is dynamically generated, and as the list of items may increase or decrease, I don't want to hardcode existing key/values. I need to come up with a formula that will take into account the future addition or subtraction of the sequential pairs. Any help would be greatly appreciated!
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28228691
tagged with: arrays
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28228721
has title: jQuery array iteration
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28228710
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28228710
has answer: http://stackoverflow.com/a/28228719
has answer: http://stackoverflow.com/a/28228721

http://stackoverflow.com/comment/44909903
comment on: http://stackoverflow.com/q/28277763
has text: use this to get 1-6 numbers Math.floor(Math.random() * 6) + 1, I would also try to avoid all this "if" and use map array will make it very simple
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28169455
has comment: http://stackoverflow.com/comment/44708969
tagged with: javascript
tagged with: functional-programming
has title: Is branching a required feature of currying?
has comment: http://stackoverflow.com/comment/44709315
answer count: 1
has comment: http://stackoverflow.com/comment/44709015
favorite count: 0
has comment: http://stackoverflow.com/comment/44708512
upvote count: 2
has comment: http://stackoverflow.com/comment/44708859
has comment: http://stackoverflow.com/comment/44708592
type: AnsweredQuestion
has body: When writing an implementation of a curry function, is it a requirement to be able to branch? Usage example in Javascript: var foo = function (a, b) { console.log(a, b); }, x = curry(foo), y = x('bar'); // An example of branching x('baz'); // -&gt; 'bar baz' y('qux'); // - &gt; 'bar qux' The example here is showing that we call our curried function the first time with the value bar and store the resulting function in variable y. My question then is: Should we be able to operate on y (passing new arguments) independently from further operations applied to x (in this case passing baz as the next argument). If you're unsure what currying is, here's what Wikipedia has to say: In mathematics and computer science, currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument (partial application). http://en.wikipedia.org/wiki/Currying Update: Another way of asking this question is to say: Should a curried function simply maintain it's current state and return no value other than when the final argument is applied, or should each call result in the return of a new function encapsulating all previously applied arguments?
score: 1
has answer: http://stackoverflow.com/a/28169828
accepted answer: http://stackoverflow.com/a/28169828
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44708717
tagged with: currying

http://stackoverflow.com/q/28126187
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28126245
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28126250
possible better answer: http://stackoverflow.com/a/28126245
linked to: http://stackoverflow.com/q/5796718
has title: Json serialization: how to send c# data to javascript script. Error: Invalid character
score: 1
has body: I'm trying to send data from Entity Framework database to js script on my webpage. This is my MVC Controller: public ActionResult Index() { var wordsToShow = db.Words.Where(w =&gt; w.OwnerName == User.Identity.Name); // &amp;&amp; DateTime.Compare(w.NextReview, DateTime.Now) &lt;= 0 ViewBag.wordsToShow = HttpUtility.HtmlDecode(new JavaScriptSerializer().Serialize(wordsToShow)); var test = ViewBag.wordsToShow; return View(); } And in index.cshtml I've put this code: &lt;script&gt; var wordsJson = "@ViewBag.wordsToShow.ToString()"; var wordsAsObject = JSON.parse(wordsJson); &lt;/script&gt; The problem is, javascript says: Invalid character In the line where I'm parsing json to javascript object. The reason is: json string doesn't look like it should. This is part of what's inside "wordsJson" variable in web browser: What can I do to make it work?
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/28126250
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#
answer count: 2

http://stackoverflow.com/comment/44707734
comment on: http://stackoverflow.com/a/28169067
type: Comment
has text: x and/or p wont be null if the input exists
score: 0
type: AnswerComment

http://stackoverflow.com/q/28277718
has title: Validate user login through JS and ajax
has answer: http://stackoverflow.com/a/28277862
tagged with: php
score: 0
has answer: http://stackoverflow.com/a/28277943
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44909894
tagged with: ajax
answer count: 3
has comment: http://stackoverflow.com/comment/44909944
has body: im not sure how to go about it but want to validate user login through: &lt;form onsubmit="return validateLogIn()" &gt; and &lt;script&gt; function validateLogIn() { $.ajax({ url: 'login.php', //checking the login in data: "", dataType: 'json', success: function(data) { continue to crud.html } else do an alert("please lgo in again"); }); } &lt;/script&gt; will i have something like the above?
has answer: http://stackoverflow.com/a/28277834
type: Question

http://stackoverflow.com/q/28135468
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28136673
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/28136673
has answer: http://stackoverflow.com/a/28136213
tagged with: angularjs
score: 1
has comment: http://stackoverflow.com/comment/44643091
upvote count: 1
has body: The json I'm working with goes something like this: { nameofProduct: { Alive: { ImServer1: { status: "low", title: "ImServer1" }, ImServer2: { status: "high", title: "Imserver2" }, ImServer3: { status: "medium", title: "ImServer3" } I'm trying to display the name ImServer1, ImServer2, ImServer3 and their status and title inside. My angular js. js file looks like this var app = angular.module("nameofproduct", []); app.controller("MainController", function($scope, $http) { $scope.loading = true; $http.get('https://jsonp.nodejitsu.com/?url=http://jsonp.jit.su/?url=httpfakeurl.com'). success(function(data, status, headers, config) { $scope.Servers = data; $scope.loading = false; }). error(function(data, status, headers, config) { console.log(data); }); }); Currently I have my html set up like this: {{server.nameofServer.Alive}} {{server.status}} But at the moment is just displays all the data, and doesn't split it apart. I'm not sure what I'm missing and how to proceed.
has title: Display Data from JSON that doesn't have a name with Angular JS
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28136213

http://stackoverflow.com/q/28136231
type: Question
has comment: http://stackoverflow.com/comment/44645154
score: 1
has comment: http://stackoverflow.com/comment/44645781
possible better answer: http://stackoverflow.com/a/28212092
has title: AngularJS controller is caching in Firefox and IE: how to disable?
has answer: http://stackoverflow.com/a/28212540
has answer: http://stackoverflow.com/a/28212092
has comment: http://stackoverflow.com/comment/44645289
tagged with: angularjs
answer count: 2
has body: In my angular application I have the following controller (I have deleted some methods due privacy policy): .controller('ArticleCtrl', ['$http', '$scope', '$location', '$localStorage', '$q', '$templateCache', 'authService', 'uploaderService', 'settings', function($http, $scope, $location, $localStorage, $q, $templateCache, authService, uploaderService, settings) { $scope.isAuth = authService.checkAuthStatus() || false; if ($scope.isAuth == false) { $location.path('/signin'); } $scope.username = $localStorage.authStatus.userName; $scope.getCompany = function(id) { $http.get(settings.apiBaseUri + '/app/' + id, { headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache' } }) .success(function(response) { $scope.company = response; $scope.company.Email = $scope.username; }) .error(function(data, status, headers, config) { console.log('operation failed, status: ' + data); $location.path('/signin'); }); $scope.$apply(); }; if ($scope.isAuth == true) { $scope.company = $localStorage.selectedCompany; $templateCache.removeAll(); $scope.getCompany($localStorage.selectedCompany.Id); } } ]); I have spend a lot of time, but still I don't understand why does only this contoller gets cached (other controllers were made via copy-paste). But when this method is called for the first time: all is ok, in debugger I see that it goes to server via GET method, but when I refresh the page, and then go again to this controller - in Firefox and IE I see that there are no new requests to the server. But why? Only when I refresh the page with Ctrl + F5 all is ok. But users will do not do that, I need working application... Maybe somebody knows how to fix this issue? How to disable angularjs view and controller caching? UPD: I see that after update my localstorage isn't changing in IE and Firefox. Why?
upvote count: 1
accepted answer: http://stackoverflow.com/a/28212540
has comment: http://stackoverflow.com/comment/44645187
has comment: http://stackoverflow.com/comment/44645877
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/44783515
has comment: http://stackoverflow.com/comment/44645140
tagged with: caching
has comment: http://stackoverflow.com/comment/44645864
has comment: http://stackoverflow.com/comment/44645172
type: AnsweredQuestion
tagged with: firefox
downvote count: 0
has comment: http://stackoverflow.com/comment/44645820
tagged with: javascript
has comment: http://stackoverflow.com/comment/44814297
has comment: http://stackoverflow.com/comment/44645196
favorite count: 0
has comment: http://stackoverflow.com/comment/44645116

http://stackoverflow.com/a/28272351
type: Answer
answers question: http://stackoverflow.com/q/28271977
score: 0
has body: This worked for me: var $scroll = $(window).scrollTop(); var $doch = $(document).height(); var $divh = $(".mainrow").innerHeight(); if ($scroll &gt; ($doch-$divh)){ $Something; } else{ $SomethingElse; }

http://stackoverflow.com/comment/44649171
type: QuestionComment
comment on: http://stackoverflow.com/q/28138364
score: 1
has text: Aren't you using `RequireJS`? The question should be tagged that too. Never used Coffeescript, but when I compare your Cs with regular JS [here](http://js2coffee.org/) you should start by fixing the indentation, which seems crucial for Cs, then read [Knockout and AMD modules](http://knockoutjs.com/documentation/amd-loading.html#loading-knockoutjs-a-binding-handler-and-a-viewmodel-class-via-requirejs), and [this Stackoverflow question](http://stackoverflow.com/questions/11389803/example-of-using-coffeescript-classes-and-requirejs-or-curljs-or-similar-for-c) & probably also learn OO JS concepts.
type: Comment

webrtc
tags question: http://stackoverflow.com/q/28122545
tags question: http://stackoverflow.com/q/28138573
tags question: http://stackoverflow.com/q/28225743
tags question: http://stackoverflow.com/q/28162121
type: Tag
tags question: http://stackoverflow.com/q/28227405
tag name: webrtc
tags question: http://stackoverflow.com/q/28228905

http://stackoverflow.com/a/28382275
upvote count: 2
has body: It is not possible to use transitions with height:auto. The trick with max-height is a pretty good solution but has some inconvenience, especially a weird delay if max-height is much higher than the real height. Here is the trick I use : http://jsfiddle.net/g56jwux4/2/ Basically it is two imbricated DIVs translating in opposite directions. Take a look a the code at jsfiddle because my english is not good enough to explain it clearly. HTML part: Technicaly this dropdown menu looks like a simple height transition. But this pure css code also works this a variable number of choices in menu, working around the "height:auto" not taken into account by css transitions. Click on me ! Choix 1 Choix 2 Choix 3 très très long pour voir la taille finale du menu Choix 4 Choix 5 Choix 6 CSS Part : body { font-family: sans-serif; } #menuOpen { display: none; } #bouton { position: absolute; left: 100px; top: 100px; width: 200px; height: 30px; background-color: lightgray; cursor: pointer; } #bouton > span { color: black; padding: 6px; line-height: 30px; } #menu { position: absolute; top: 100%; overflow: hidden; min-width: 100%; transition: transform 0.3s linear 0s, visibility 0.3s linear 0s; transform: translateY(-100%); visibility: hidden; color: white; } #menuOpen:checked + #bouton > #menu { transform: translateY(0%); visibility: visible; transition: transform 0.3s linear 0s, visibility 0s linear 0s; } #menuOpen:checked + #bouton > #menu > #masque { transform: translateY(0%); } #masque { position: relative; background-color: gray; transform: translateY(100%); transition: transform 0.3s linear 0s; } .choix { white-space: nowrap; padding: 3px 6px; } .choix:hover { background-color: darkgray; }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28160326
score: 2

http://stackoverflow.com/a/28179062
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28163514
downvote count: 0
has body: Another version using underscore: var result = _.chain(jsonObj) .where({ name: 'AAATest' }) .pluck('links') .flatten() .where({ rel: 'self'}) .pluck('href') .value();

http://stackoverflow.com/q/28151203
tagged with: jquery
has title: Save and Get all cookies in table
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28151318
tagged with: cookies
has body: I'm trying to save the current location of the user when click in the button save, i am using the plugin "jquery.cookie.js" HTML Save cookie saved 1 cookie saved 2 cookie saved 3 ... jQuery // Save cookie $("#popup-saveSearch button").on('click',function(){ var location = $("#locationName").val(); var pathUrl = window.location.href; $.cookie('name',location); $.cookie("currentPath", pathUrl); }); Now need to know how to make a each, with the saved cookie and show the table.
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/44866854
comment on: http://stackoverflow.com/q/28254079
type: Comment
type: QuestionComment
score: 1
has text: What does this have to do with jQuery?

http://stackoverflow.com/q/28198062
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: asp.net
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: We have a web application that uses asp.net and VB.net for the code behind. I am learning javascript. I have 2 div's side by side. The first div contains ASP dropdowns and texboxes such as (camp name, registration fee, start and end dates). On the second div, I have a preview of those new camp that is being created, with labels that indicate the camp name, start and end dates etc on it. My question is, how can I use JavaScript (ajax and JQuery are fine also) to fill in the information entered on the first div to the second div in real time? For example when somebody enters the camp name on the first div and then clicks outside or tabs out of the camp name text-box, the appropriate label on the brochure div gets filled out? In other words, when the Camp name text-box loses focus, the Camp name label on the second div should get filled. It would be preferable if I used as little code behind as possible and accomplish this entirely on the client side.
has answer: http://stackoverflow.com/a/28198341
accepted answer: http://stackoverflow.com/a/28198341
has comment: http://stackoverflow.com/comment/44768474
has comment: http://stackoverflow.com/comment/44762882
has comment: http://stackoverflow.com/comment/44762751
has title: Need to fill a brochure preview in real time with a form
type: AnsweredQuestion

http://stackoverflow.com/a/28145937
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28145820
has body: I figured it out! You must update the matrix before merging Geometry plane.updateMatrix(); mapGeo.merge(plane.geometry, plane.matrix);
upvote count: 2
type: Answer

http://stackoverflow.com/q/28204074
has comment: http://stackoverflow.com/comment/44774210
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44774261
type: Question
accepted answer: http://stackoverflow.com/a/28204349
upvote count: 0
has comment: http://stackoverflow.com/comment/44774483
score: -2
answer count: 1
tagged with: javascript
has body: I'm terrible with regular expressions! I've never been able to get my head around them. I am currently using JQuery to get a string of the HTML between two tags. What I require I need to be able to find all matches of angular style tags like so {{sample}}. I need an array returned so that I can loop through it. Any help would be appreciated.
tagged with: regex
has title: Regular expressions help need pattern
favorite count: 0
has answer: http://stackoverflow.com/a/28204349
downvote count: 2

http://stackoverflow.com/a/43830980
has comment: http://stackoverflow.com/comment/112304381
has body: There is a modern API dedicated for this purpose - Broadcast Channel It is as easy as: var bc = new BroadcastChannel('test_channel'); bc.postMessage('This is a test message.'); /* send */ bc.onmessage = function (ev) { console.log(ev); } /* receive */ Data sent to the channel is serialized using the structured clone algorithm. That means you can send a broad variety of data objects safely without having to serialize them yourself. It is supported on all major browser, but you can find a polyfill that uses localStorage.
has comment: http://stackoverflow.com/comment/131937808
has comment: http://stackoverflow.com/comment/85198931
has comment: http://stackoverflow.com/comment/75712240
has comment: http://stackoverflow.com/comment/89417395
has comment: http://stackoverflow.com/comment/110403303
has comment: http://stackoverflow.com/comment/111656767
has comment: http://stackoverflow.com/comment/137788891
type: Answer
has comment: http://stackoverflow.com/comment/96144955
has comment: http://stackoverflow.com/comment/111654988
score: 230
has comment: http://stackoverflow.com/comment/116472461
answers question: http://stackoverflow.com/q/28230845
downvote count: 0
has comment: http://stackoverflow.com/comment/112318896
upvote count: 230

http://stackoverflow.com/comment/44618607
score: 0
type: AnswerComment
type: Comment
has text: Hi! Thank your for helping me. For some reason, with foreach I don't even get a map - so I'm still using while, but the count "function" is not working... :-(
comment on: http://stackoverflow.com/a/28122022

http://stackoverflow.com/a/28170775
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28170538
has body: With simple javascript and RegExp: var onlyDigits = function(box) { box.value = box.value.replace(/\D/g, ''); //replace all other than digit }; EIN &lt;input type='text' onkeypress='onlyDigits(this)' onkeyup='onlyDigits(this)' maxlength='2' /&gt; &lt;br/&gt;Only Digit &lt;input type='text' onkeypress='onlyDigits(this)' onkeyup='onlyDigits(this)' /&gt;

http://stackoverflow.com/q/28188196
has body: The RequireJS is not resolving dependency properly when the routes is of multiple levels as in http://www.example.com/profile/view. If I just have http://www.example.com/view, the controller dependency is resolved properly. My bootstrap.js require.config({ baseUrl : 'res/js', paths: { routeResolve: 'routeResolve', 'domReady': 'lib/domReady', angular: 'lib/angular', angularRoute: 'lib/angular-route', angularResource: 'lib/angular-resource', angularSanitize: 'lib/angular-sanitize', cssPath : '../css' }, map: { '*': { css: 'lib/require-css/css.min' } }, shim: { 'angular': {'exports': 'angular'}, 'angularRoute': {deps : ['angular']}, 'angularResource': {deps : ['angular']}, 'angularSanitize': {deps : ['angular']} }, priority: ['angular'] }); Folder structure: -rootdir - public - res - js - css When I use this route http://www.example.com/profile/view, all the dependency modules are resolved with base url as http://www.example.com/profile/res/js/controller.js, which does not exist in this path http://www.example.com/profile. If I change the route to http://www.example.com/view (just one level), dependencies are resolved with this base url http://www.example.com/res/js/controller.js There should be a configuration issue which I am missing, but I could not find a solution for this.
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28195942
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/22627806
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/44763138
tagged with: requirejs
has title: requirejs with angular - not resolving controller dependency with nested route
score: 2
type: AnsweredQuestion
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/28195942

sqlite
tags question: http://stackoverflow.com/q/28195925
tags question: http://stackoverflow.com/q/28242257
type: Tag
tags question: http://stackoverflow.com/q/28253379
tags question: http://stackoverflow.com/q/28176068
tags question: http://stackoverflow.com/q/28152166
tags question: http://stackoverflow.com/q/28129063
tags question: http://stackoverflow.com/q/28278503
tags question: http://stackoverflow.com/q/28206834
tags question: http://stackoverflow.com/q/28140636
tags question: http://stackoverflow.com/q/28140341
tag name: sqlite

http://stackoverflow.com/comment/44661523
type: Comment
type: QuestionComment
has text: You could use a regex to remove anything that is not a [whitespace](http://stackoverflow.com/questions/5963182/how-to-remove-spaces-from-a-string-using-javascript) or an [alphanumeric](http://stackoverflow.com/questions/9364400/remove-not-alphanumeric-characters-from-string-having-trouble-with-the-char) character....
score: 1
comment on: http://stackoverflow.com/q/28144740

http://stackoverflow.com/comment/127841180
score: 0
type: Comment
has text: NWJS v0.64 - gui.Window.open('/some/path') returns `undefined`, so newWindow in this example will be `undefined` and you'll get an error when trying to postMessage from it. Need to get newWindow from the callback, see @fusionstream 's example.
comment on: http://stackoverflow.com/a/28212333
type: AnswerComment

http://stackoverflow.com/comment/66984052
has text: @sriramsudhakar r u working on EDPMS and IDPMS ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28213293

http://stackoverflow.com/comment/44619937
type: Comment
comment on: http://stackoverflow.com/a/28123006
score: 0
type: AnswerComment
has text: Thank you for the response. However, this works somewhat, but I am getting the following error in the console which is causing the page to stop working completely. Here is the error: `[Error] TypeError: undefined is not an object (evaluating 'e.replace') (anonymous function) (jquery-1.8.3.min.js, line 2) PSEUDO (jquery-1.8.3.min.js, line 2) ht (jquery-1.8.3.min.js, line 2) compile (jquery-1.8.3.min.js, line 2) vt (jquery-1.8.3.min.js, line 2) vt (jquery-1.8.3.min.js, line 2) nt (jquery-1.8.3.min.js, line 2)`

http://stackoverflow.com/a/28194208
downvote count: 0
has comment: http://stackoverflow.com/comment/44756705
answers question: http://stackoverflow.com/q/28193993
has comment: http://stackoverflow.com/comment/44758138
has comment: http://stackoverflow.com/comment/44757039
has comment: http://stackoverflow.com/comment/44756047
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/44761256
has comment: http://stackoverflow.com/comment/44756230
has body: As far as I know, this don't work because of security matters to previne xss attacks. But you can create a filter to trust the url like: angular.module('filters', []).filter('trustThisUrl', ['$sce', function($sce) { return function(val) { return $sce.trustAsResourceUrl(val); }; }]); And then call it as filter of the url in src &lt;iframe ng-src=""&gt;&lt;/iframe&gt;
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28193993
type: AcceptedAnswer

http://stackoverflow.com/comment/44847894
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28240186
type: Comment
has text: Yea sorry, I was just whipping up a quick example, so there are some errors in the code, I tried to clean it up to make it more clear.

http://stackoverflow.com/a/28169360
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44708998
has comment: http://stackoverflow.com/comment/44708596
has comment: http://stackoverflow.com/comment/44709119
answers question: http://stackoverflow.com/q/28169146
has body: Had same issue and solved by doing this. write ready() function. and then place the window resize functions in the initialize method itself (before initializing the map). It will help.

http://stackoverflow.com/a/28261394
has body: How about: if ((!SL || SM) &amp;&amp; (!TL || TM)) ... ie: the source must be empty or take multiple lines and the target must be empty or take multiple lines
accepted answer of: http://stackoverflow.com/q/28261210
answers question: http://stackoverflow.com/q/28261210
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44880633
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44678137
score: 0
comment on: http://stackoverflow.com/a/28153118
type: Comment
has text: @bmurrell30: I should also have advised to use `console.log` for debugging click events and not `alert` :)
type: AnswerComment

http://stackoverflow.com/comment/44843927
score: 0
type: AnswerComment
type: Comment
has text: @ruffin, I am not entirely sure what you mean. I just want a tool that can scour all the lines of code I have to detect something like this: function test(x){ if(x=10){ //do something } }
comment on: http://stackoverflow.com/a/28224282

http://stackoverflow.com/comment/44755959
score: 0
type: AnswerComment
type: Comment
has text: I figured it out, not without help from you! Check the edit in my question to see where I was failing, and hopefully you can use the code in the future. Cheers!
comment on: http://stackoverflow.com/a/28166546

http://stackoverflow.com/comment/44769688
comment on: http://stackoverflow.com/a/28181081
has text: This is great! Thanks. ${detail.encodeAsJSON()} did the job.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44694288
score: 0
has text: Constructor is used by the chrome developer tools and can be used by the programmer (this.constructor) you should not create an instance of Parent to be used as prototype of Child. It shows a lack of understanding of the roles the constructor and prototype play. More info here: http://stackoverflow.com/a/16063711/1641941
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28159784

http://stackoverflow.com/q/28145189
has title: Background images to change when all image have downloaded
tagged with: javascript
tagged with: jquery
score: 0
has body: I am using following script to show background image for a div element. Problem with this is that images are large around 1MB each and they don't quickly so that background effect can be smooth. I wrapper function in `$(window).load(function () {}); but it didn't made any difference. how can i delay background image download so that it only starts when all images are downloaded. jQuery(function ($) { var body = $('.hmcarousel'); var backgrounds = new Array( "url(soml_slider_1.jpg)", "url(soml_slider_2.jpg)", "url(soml_slider_3.jpg)", "url(soml_slider_4.jpg)", "url(soml_slider_5.jpg)" ); var current = 0; function nextBackground() { body.css( 'background', backgrounds[current = ++current % backgrounds.length] ); setTimeout(nextBackground, 5000); } setTimeout(nextBackground, 5000); body.css('background', backgrounds[0]); });
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28145212
answer count: 1
linked to: http://stackoverflow.com/q/1977871
type: UnansweredQuestion
tagged with: css
type: Question
has comment: http://stackoverflow.com/comment/110104003

http://stackoverflow.com/q/28220098
has comment: http://stackoverflow.com/comment/44803448
possible better answer: http://stackoverflow.com/a/28222163
has comment: http://stackoverflow.com/comment/44811987
has comment: http://stackoverflow.com/comment/44810084
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44837761
has comment: http://stackoverflow.com/comment/44838112
has comment: http://stackoverflow.com/comment/44809953
has comment: http://stackoverflow.com/comment/44812577
has comment: http://stackoverflow.com/comment/44803578
type: Question
accepted answer: http://stackoverflow.com/a/28239440
has body: I have a button that when I click it more than once it is adding elements from the previous click. It works fine the first time through. We are using jQuery 1.11.1. $(function() { $('a[name="generateReport"]').bind('click', function() { $(this).attr('href', $(this).attr('href') + '?est=' + est.value + '&amp;prodcd=' + prodcd.value + '&amp;startDate=' + startDate.value + '&amp;endDate=' + endDate.value + '&amp;tracking=' + tracking.value); }) }) What I am seeing is that the URL past to the server is adding the fields from the prior click. This of course causes issues when it gets to the server. Does this need to be cleared out after each click? This is the code that calls it from our Grails app(2.4.3) &lt;g:link class="btn btn-primary" name="generateReport" controller="generateTTLReport" action="renderOutput"&gt; &lt;i class="icon-print icon-white"&gt;&lt;/i&gt; Generate Report &lt;/g:link&gt; Thanks, Tom
has answer: http://stackoverflow.com/a/28222163
tagged with: javascript
tagged with: grails
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28239440
has comment: http://stackoverflow.com/comment/44803642
has comment: http://stackoverflow.com/comment/44809970
tagged with: jquery
has comment: http://stackoverflow.com/comment/44803644
has title: jQuery bind click not adding elements
has comment: http://stackoverflow.com/comment/44807263

http://stackoverflow.com/comment/44639017
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28133047
has text: @TimMarshall window.location.replace replaces the current history item so you can't go back to it. use window.location.href instead
score: 0

http://stackoverflow.com/q/28154798
has body: In the code attached, I'm trying to display some pictures that I have in my database once I click on any of the markers on google maps. Each marker is related to a picture. My problem relies on the last part of the code, on the las "for" loop. When I console.log(content) I see all my image tags displayed with the correct image url, but when I click on any of the markers I only see the last picture on the array picturesForMarkers. Does anybody know what am I doing wrong? Javascript var addresses = []; var picturesForMarkers = []; var divPictureLatitude = $('.pictures'); $.each(divPictureLatitude, function (i, val) { addresses.push(val.children[1].value + ", " + val.children[2].value); picturesForMarkers.push(val.children[0].src); }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (var x = 0; x &lt; addresses.length; x++) { $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=' + addresses[x] + '&amp;sensor=false', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); var marker = new google.maps.Marker({ position: latlng, map: map }); }); } for (var x = 0; x &lt; picturesForMarkers.length; x++) { google.maps.event.addListener(marker, 'click', (function (marker, x) { return function () { var content = '&lt;img src="' + picturesForMarkers[x] + '" style="width:300px;"&gt;'; console.log(content) infowindow.setContent(content); infowindow.open(map, marker); } })(marker, x)); }
favorite count: 0
has comment: http://stackoverflow.com/comment/44682725
has title: Info window when clicking on a marker google maps ap
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28155834
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44683343
score: -1
possible better answer: http://stackoverflow.com/a/28155681
has answer: http://stackoverflow.com/a/28155681
answer count: 2
tagged with: google-maps
upvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28155834
tagged with: google-maps-api-3

http://stackoverflow.com/comment/44814203
score: 0
has text: look into document.createEvent() or the newer MouseEvent() constructor.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28225452

http://stackoverflow.com/q/28201454
possible better answer: http://stackoverflow.com/a/31805715
has answer: http://stackoverflow.com/a/31805715
type: Question
tagged with: google-analytics
has body: I'm using google analytics (analytics.js) to track a couple of buttons and facebook and twitter for social part but the problem is since the last Saturday that I configured the analytics code, can't see my events registered in my dashboard and it's strange because If I open the developers console of Chrome or Firefox can see the request and is returning 200 OK so, I don't know what's the exactly error. Index.html Document My button My Facebook Button main.js $(function() { $('#my_button').on('click', function(e) { e.preventDefault(); ga('send', 'My button', 'button', 'click', 'My button!'); }); $('#my_facebook_button').on('click', function(e) { e.preventDefault(); FB.ui({ method: 'feed', name: 'The name', link: 'http://mywebsite.com', picture: 'http://thepicture.png', caption: 'The caption', description: 'The description' }, function(response) { } ); }); }); Actually, Facebook and twitter open the popup to share or tweet but facebook is not detecting the FB.Event.subscribe. So, my errors are: I don't know if my GA events are wrong but the request return 200 OK and I can't see the events in my dashboard. Facebook is not detecting the Event.subscribe to once the user share, record the event I hope someone knows what are the issues with my code. Thank you in advance.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28201585
answer count: 2
has title: Google Analytics not tracking the events correctly
tagged with: facebook-javascript-sdk
accepted answer: http://stackoverflow.com/a/28201585
tagged with: facebook
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/44825454
score: 0
type: AnswerComment
type: Comment
has text: @dandavis regarding pre-existing localSotrage data while considering data limit, this is very important point, thank you. However if the limit is reached then even sending 'a postcard' won't be possible. Thus it is on the programmer to ensure that he doesn't have other things in localStorage which would fill up the space.
comment on: http://stackoverflow.com/a/28230846

http://stackoverflow.com/q/28225792
has answer: http://stackoverflow.com/a/28557982
type: Question
has title: AWQL (AdWords Query Language) Seeking Multiple Range Query (of sorts)
downvote count: 0
accepted answer: http://stackoverflow.com/a/28557982
has body: Ok, this may be quite the "what are you actually asking" question so bear with me a bit. As a rule, I'm a .NET and SQL developer. I'm working with AWQL trying to get an adwords script to make a tailored report. Short version, I need to pull from separate date ranges and I'm having issues figuring out how the "compiler" they have deals with it or if even possible to do. In a nutshell I need the data from two months separately compiled into one report. Right now I'm thinking syntax error, but not sure. End goal in geek terms is to the effect of "WHERE(IMPRESSIONS_FROM_THIS_MONTH > IMPRESSIONS_FROM_LAST_MONTH) AND (IMPRESSIONS_FROM_LAST_MONTH > MONTH_BEFORE_THAT). In theory all in the same output (don't care if it's logger or straight to a google doc. I do have the code to put this into a spreadsheet and email me the link), but currently struggling to get it to pull the data. And by struggling I mean a few days of failing lol. "SELECT KeywordText, ConversionValue, Id, QualityScore " + "FROM KEYWORDS_PERFORMANCE_REPORT " + "WHERE " + "Id = " + kw + " AND CampaignId = " + id + " AND AdGroupId = " + gName + " AND Impressions" + " (DURING 20150101, 20150131) &gt; IMPRESSIONS (DURING 20141201, 20141231)" ); (the variables like gName are there in the full code btw and working until I try compound logic) I'm not sure if the best approach is to query it all at once, or to query separately and somehow splice the results into a single report. AdWords scripting seems to be a lot more restricted than I'm used to and some of the rules it has aren't well documented or explained. Any links or code chunks relevant to this anywhere? Thanks in advance for any help!
tagged with: javascript
answer count: 1
tagged with: reporting
tagged with: dynamic-queries
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: mysql

http://stackoverflow.com/comment/44764878
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28198933
has text: also, have you checked that the rendered page has all the correct javascript files loaded in order required.

http://stackoverflow.com/q/28189958
tagged with: javascript
score: 0
tagged with: asp.net
type: UnansweredQuestion
has body: Using the RadSchedular, a RadWindow appears when moving an appointment in a series of recurring appointments asking me if I want to move them al or just the current appointment. No matter what I choose an error is thrown telling me that object 'this' does not contain a method called 'get_owner'. The Telerik.Web.UI dll's are on version 2014.2.724.40 and the project is an ASP.NET project. The error occurs in a dynamic blank script and looks like this: _onAppointmentMoveCallback:function(j,h){h.Scheduler._raiseRecurrenceActionDialogClosedEvent(h,false,b.RecurrenceAction.Move); var k={appointment:h.Appointment,newStartTime:h.NewStart,editingRecurringSeries:j,targetSlot:h.TargetSlot,isAbortedByUser:false}; var i=a.raiseCancellableControlEvent(h.Scheduler,"appointmentMoveEnd",k); //Error in next if() if((this.get_owner().get_groupBy()!==g)&amp;&amp;this.get_owner()._webServiceSettings.get_isEmpty()&amp;&amp;h.Appointment.get_resources().indexOf(h.SourceSlot.get_resource())==-1){i=true; }if(!i){h.Scheduler.moveAppointment(h.Appointment,j,h.SourceSlot,h.TargetSlot); }else{h.Appointment._abortDrag(); }} If I understand correctly, this is Telerik's internal code and I can't do anything about it? Is there anyone who encountered the same problem? These two images reflect on the debugger state:
tagged with: telerik
answer count: 0
has comment: http://stackoverflow.com/comment/44946733
has title: Javascript error when moving recurring appointments
has comment: http://stackoverflow.com/comment/44747935
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44747879
tagged with: radscheduler

http://stackoverflow.com/a/28219165
score: 0
has comment: http://stackoverflow.com/comment/44801902
has comment: http://stackoverflow.com/comment/44801838
has comment: http://stackoverflow.com/comment/44801973
type: Answer
has body: No, it is not possible to implement a sleep in javascript in the traditional sense, as it is a single-threaded event based model. The act of sleeping this thread will lock up the browser it is running in and the user is presented with a message either telling them the browser has stopped responding (IE) or allowing them to abort the currently running code (Firefox).
answers question: http://stackoverflow.com/q/28218863

http://stackoverflow.com/a/28140369
type: Answer
has body: if you would do it on the client side using jquery you could do it like this $('#mydiv').load("http://localhost/mypage.html"); var firstH1 = $('#mydiv').children('h1:first-child'); console.log(firstH1);
score: 0
answers question: http://stackoverflow.com/q/28140084

http://stackoverflow.com/a/28165053
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28164843
upvote count: 1
has body: Your Java code should be in a servlet, you should then add your lat/lng results to a container and serialize to JSON, example with GSON: class Result { double lat; double lng; Result(double l, double ll) { this.lat = l; this.lng = ll; } } List&lt;Result&gt; results = new ArrayList&lt;&gt;(); while (rs.next()) { results.add(new Result(rs.getInt("latitude"), rs.getInt("longitude"))); } final TypeToken&lt;List&lt;Result&gt;&gt; resultsType = new TypeToken&lt;List&lt;Result&gt;&gt;() {}; response.getWriter().write(new Gson().toJson(results, resultsType.getType())) And then in your javascript, assuming this was called with Ajax, you can consume the json: var markers = []; for (var i = 0; i &lt; responseJSON.length) { markers.push(responseJSON[i].lat + ', ' + responseJSON[i].lng) }
type: Answer

http://stackoverflow.com/comment/44722012
type: QuestionComment
type: Comment
has text: Change `$` to `jQuery` and see if that helps. Basically, the error is trying to help you – `$` really isn't a function, so you'll need to verify that jQuery has been loaded on the page above the script tag that you've included here.
score: 3
comment on: http://stackoverflow.com/q/28176444

http://stackoverflow.com/comment/44812534
comment on: http://stackoverflow.com/q/28224177
has text: `$('div').forEach(function(index) { $(this).click(function() { cb(index * 2); }); });` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28234698
score: 2
has title: Handling missing images without jQuery
upvote count: 2
tagged with: http-status-code-404
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28234974
has answer: http://stackoverflow.com/a/28234974
has answer: http://stackoverflow.com/a/28234788
answer count: 2
accepted answer: http://stackoverflow.com/a/28234788
downvote count: 0
has body: I would like to create a clean solution for handling missing image on the client using &lt;img src="image.gif" onerror="handleErrors()"&gt; so far the handleErrors looks like this: function handleErrors() { image.onerror = ""; image.src = "/images/noimage.gif"; return true; } But I feel this is not scalable enough and the no image is also not accessible for screen readers. What could be a more scalable and accessible solution for this problem?
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44831054

http://stackoverflow.com/comment/44678239
type: Comment
has text: Some browsers handle the CSS differently so it could just be a specific issue with Chrome.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28153251

mining
type: Tag
tag name: mining
tags question: http://stackoverflow.com/q/28248602

http://stackoverflow.com/comment/54927500
score: 1
type: AnswerComment
has text: For those coming to this answer, take a look at @JeremyWeir's answer, which utilizes a directive instead. Either answer will work, but his is more robust and elegant overall.
type: Comment
comment on: http://stackoverflow.com/a/28206506

http://stackoverflow.com/a/29459784
has body: My solution: Ext.define('Overrides.grid.filters.Filters', { override: 'Ext.grid.filters.Filters', onReconfigure: function(grid, store, columns, oldStore) { var me = this; me.sep = Ext.destroy(me.sep); if (me.menuItems &amp;&amp; me.menuItems[grid.id]) { me.menuItems[grid.id].destroy(); } me.callParent(arguments); } });
upvote count: 1
answers question: http://stackoverflow.com/q/28178097
score: 1
accepted answer of: http://stackoverflow.com/q/28178097
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/55812133
type: QuestionComment
has text: You say you can get this element with commands. But when i try to get all page source, it says enable js. Without seeing page, how can it take the element. It cant take when i try
type: Comment
comment on: http://stackoverflow.com/q/28173638
score: 0

http://stackoverflow.com/comment/44913085
score: 0
type: Comment
has text: Thanks Ken. It does indeed seem to work with document.body in your jsfiddle, but I can't seem to make this work using a node like dom.byId('buttonId') though. The :not really seems to cause issues.
comment on: http://stackoverflow.com/a/28248903
type: AnswerComment

http://stackoverflow.com/a/28153645
answers question: http://stackoverflow.com/q/28153447
has body: You can call the grabID function and within it return the ID, then pass the result of the call to your drawGraph function: function grabID(dataObj) { for(var i=0; i&lt; dataObj.length; i++) { var id = dataObj[i]['id']; if(typeof(id) == 'string') //take that id and use it in the function below this one return id; else continue; } // return null if no ID was retrieved return null; } function updateData(dataObj) { for (var i = 0; i &lt; dataObj.length; i++) { var id = dataObj[i]['id']; } var id = grabID(dataObj); if(id !== null) drawGraph(id); } function drawGraph(grabbedId) { var id = grabbedId; //the id grabbed in the grabID function //use this id for drawing purposes }
accepted answer of: http://stackoverflow.com/q/28153447
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44761196
has text: write one directive.. put this code inside directive..inject `$window` dependancy and use it instead of `window`
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28197316
type: QuestionComment

http://stackoverflow.com/q/28169897
has comment: http://stackoverflow.com/comment/44709473
has body: So I'm currently working on a small styleguide application and part of the functionality is that there is a sandbox area where certain modules get loaded into an iframe (to be able to simulate media queries). Now this content is inserted dynamically after the iframe is created along with the relevant styling and scripts. The non event handler scripts work fine for example an alert box but the click handlers don't seem to be functional. Jquery is loaded in just fine so I've ruled that out. This is a sample of the code being inserted Most popular Why your CCTV could land you in jail How to measure performance of SMEs How to measure performance Most recent Why your CCTV could land you in jail How to measure performance of SMEs How to measure performance Recommended Why your CCTV could land you in jail How to measure performance of SMEs How to measure performance Just to clarify, the code is being put directly inside the iframe's HTML, I'm not calling it from it's parent. The code responsible for inserting the html/js into the iframe: iframePreview.contents().find('html').html( libraryScripts + '\n' + moduleHtmlAndJs); Any idea how I can make these click handlers functional?
tagged with: dom
linked to: http://stackoverflow.com/q/6532644
type: Question
has answer: http://stackoverflow.com/a/28170150
answer count: 3
has comment: http://stackoverflow.com/comment/44709477
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28172654
tagged with: http://stackoverflow.com/tag/html
score: 0
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/28170106
has title: Click handler inside Iframe is not working after content is being inserted
has comment: http://stackoverflow.com/comment/44709417

http://stackoverflow.com/comment/44893141
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28261416
has text: That is not AJAX, that is just asset pipeline rendering the `@atag` into your JS.
score: 0

http://stackoverflow.com/a/28290014
answers question: http://stackoverflow.com/q/28241263
score: 0
type: Answer
has body: In order to set your mesh in the correct place before cutting, you can perform a matrix transform on the geometry itself. platform.platform = new Physijs.BoxMesh(geometry, material, 0); platform.platform.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, -i * 300, 0 ) ); It's possible a bug is preventing THREEBSP to use the position attribute (does Physijs mess with this? I have never used it).

http://stackoverflow.com/comment/44731122
type: Comment
has text: [getComputedStyle](https://developer.mozilla.org/en-US/docs/Web/API/window.getComputedStyle) This will return all applied styles to an element
comment on: http://stackoverflow.com/q/28180921
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44754890
has text: Works fine for me as well, made a fiddle: http://jsfiddle.net/legolandbridge/cx1a1g23/
comment on: http://stackoverflow.com/q/28193973
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28261997
tagged with: google-maps
answer count: 1
downvote count: 1
favorite count: 0
has title: difference between (html) google maps search results and maps/places api calls (fewer results)
has answer: http://stackoverflow.com/a/28269361
accepted answer: http://stackoverflow.com/a/28269361
linked to: http://stackoverflow.com/q/19097952
type: AnsweredQuestion
upvote count: 0
tagged with: google-places-api
linked to: http://stackoverflow.com/q/9274768
type: Question
has body: I want to get restaurants in German cities to embed and process in a web page. I identify those cities through lat/long and radius (for approximation). When doing an online search on google maps, I see 100s of results. google maps restaurant search duesseldorf My attempt at an implementation (mostly based on samples found here) only returns a lot less results (you can copy to .html page). I also tried adding API key, which I removed for here. (I think where it says "request" is the interesting for the search results.) I also tried variations on type/keyword, using restaurant and food. Results dont become either better or more frequent. How to get more results? (I want to give users a reasonable choice of places to eat, not just 4 for a city of 500k people (and 100s of restaurants, that google also knows and are returned for the maps search).) Similar questions (with no helpful answers): Why do some results show up in Google Maps but not in Places API results? Different results in Google Places API and Google Maps Different results in Google Places API and Google Maps https://stackoverflow.com/questions/21230939/places-api-returning-fewer-results
linked to: http://stackoverflow.com/q/28159392
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/44881511

http://stackoverflow.com/q/28141452
has comment: http://stackoverflow.com/comment/44655048
has comment: http://stackoverflow.com/comment/44654543
has comment: http://stackoverflow.com/comment/44654613
type: Question
has comment: http://stackoverflow.com/comment/44654586
has comment: http://stackoverflow.com/comment/44654506
tagged with: javascript
has comment: http://stackoverflow.com/comment/44654526
tagged with: browser
downvote count: 3
has answer: http://stackoverflow.com/a/28141583
has comment: http://stackoverflow.com/comment/44654509
tagged with: cdn
answer count: 1
favorite count: 0
has title: Pre-compiled versions of often used scripts in browsers
has comment: http://stackoverflow.com/comment/44655082
type: UnansweredQuestion
score: -3
upvote count: 0
has comment: http://stackoverflow.com/comment/44654558
has body: Does anyone know why browsers such as Chrome, FF and IE don't just have all famous scripts embedded in their install? They could have all the versions of jquery, for example, pre-compiled (i.e. in V8 for chrome) and the browser would just be able to recognize the reference to a cdn or simply a local script by the name of the script. And really, how much greater would that make the install of the browser if you included all version of, say, jquery, angular, dojo and ext? Compiled to C++ via V8 these scripts aren't very large at all. Sure, you could say, 'but then it won't use the modifications I made in jquery-2.1.3.js'. True, but that's just horrible engineering. It would be faster and save bandwidth. But there is probably something I'm overlooking. There always tends to be.
has comment: http://stackoverflow.com/comment/44654585

http://stackoverflow.com/q/28153678
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44679373
tagged with: ajax
has answer: http://stackoverflow.com/a/28154061
has title: Can't manipulate data from $.post
has comment: http://stackoverflow.com/comment/44678995
has comment: http://stackoverflow.com/comment/44679236
has comment: http://stackoverflow.com/comment/44679183
has comment: http://stackoverflow.com/comment/44679399
has comment: http://stackoverflow.com/comment/44678866
score: 0
tagged with: php
accepted answer: http://stackoverflow.com/a/28154061
has comment: http://stackoverflow.com/comment/44683277
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I'm trying to use the result of an Ajax query in order to set the value of an input. The problem is that I get an empty result ([Object object]) Here is my process : First : I realise a simple query and encode the result in JSON : file : getVar.php //getMyVar($id) runs a simple "select" query with a specified id // SELECT name FROM table where id = id $var= getMyVar($id); header('Content-type: application/json; charset=UTF-8'); echo json_encode($var); Then, I (try to) extract the data and I insert it as a value in an input which has the id "name" Note : I am sure of the input's id. file : printStuff.js request = $.post('getVar.php', {id:id}, 'json'); request.done(function(data){ $('#name').val(data.name); }); When I inspect my page in my browser with firebug, I can see that my first page (getVar.php) returns a well formatted JSON result. {"id":"42","name":"test"} So, I think that the error occurs when I try to extract the data form the $.post If you need any additional information, don't hesitate :) Thanks for reading.
has comment: http://stackoverflow.com/comment/44678860
type: Question
has comment: http://stackoverflow.com/comment/44678903
answer count: 1

http://stackoverflow.com/comment/50011215
comment on: http://stackoverflow.com/a/28264346
score: 0
type: AnswerComment
has text: thank you sir but i found a way for that using php and it's fine. the only thing i need for now i didn't find out is that, is it possible to create search using php or javascript without database? for example i have search form on index.php and when i write something and click search and it will bring me my pages in search.php
type: Comment

http://stackoverflow.com/comment/44710215
type: Comment
type: AnswerComment
has text: Hi . we will override the basic input widget but right now the problem is that if the input element position is overlap the keyboard position then after the keyboard open -> window re-size event -> will trigger another scroll -> now the widget in the wrong place.
comment on: http://stackoverflow.com/a/28161194
score: 0

http://stackoverflow.com/a/28149007
accepted answer of: http://stackoverflow.com/q/28148869
answers question: http://stackoverflow.com/q/28148869
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has body: I don't know what key.getBytes() is supposed to be. You should simply pass the string to the SHA1 function and get a representation of your choice out of it. This produces a matching hex representation of the byte array from your Java code. &gt; var key = "123456"; &gt; CryptoJS.SHA1(key).toString() "7c4a8d09ca3762af61e59520943dc26494f8941b" If you want to create exactly the same array, you can iterate over the words property of the native representation of CryptoJS. Each integer represents 4 bytes in Big-Endian notation. var key = "123456"; var hash = CryptoJS.SHA1(key); var byteArray = []; hash.words.forEach(function(i){ var k; for(var j = 3; j &gt;= 0; j--){ k = (i &gt;&gt; (j*8)) &amp; 0xFF; k = k &lt; 128 ? k : -(256 - k); byteArray.push(k); } });
type: Answer

http://stackoverflow.com/a/28171809
accepted answer of: http://stackoverflow.com/q/28171521
has body: I will give you some tips: 1.) Enable Bluetooth: mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (mBluetoothAdapter != null) { if (!mBluetoothAdapter.isEnabled()) { Intent enableBtIntent = new Intent( BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivity(enableBtIntent); } } 2.) Connect to device: BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); BluetoothSocket mBluetoothSocket = mBluetoothDevice .createRfcommSocketToServiceRecord(mUUID); try{ mBluetoothSocket.connect(); } catch (Exception e){ }
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28171521
type: Answer

http://stackoverflow.com/comment/44663121
type: QuestionComment
has text: @Hungnh1704, Is it the issue, what if I want to upload multiple images with the same code
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28145621

http://stackoverflow.com/q/28244473
tagged with: http://stackoverflow.com/tag/html
has body: I'm using the chosen dropdown library for an angularjs project using the angular-chosen directive. I'm currently working on implementing a paginated table and I'm having a problem with the dropdown options appearing underneath the container div in my body. Here is the relevant html Name - 000111222 001 Test, Test Import Complete 10/24/2013 7:27:42 Page Size: 10 items 25 items 50 items 100 items I tried commenting out all of my custom css for styling the dropdown and nothing changed in regards to this issue. Any help would be greatly appreciated Edit: I used firefox's 3d view to take a look and it doesn't seem to be a z-index issue
tagged with: css
has title: Chosen Options Going Under Container
has answer: http://stackoverflow.com/a/28244608
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: angularjs-directive
score: 1
tagged with: jquery-chosen
has comment: http://stackoverflow.com/comment/44851233
linked to: http://stackoverflow.com/q/26911397
has comment: http://stackoverflow.com/comment/69544510
has comment: http://stackoverflow.com/comment/44849699
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28131261
answers question: http://stackoverflow.com/q/28131173
has comment: http://stackoverflow.com/comment/44635300
has body: What you are trying to do is have string keys in an array. That is not possible. What you could do instead is use a plain object as a map (instead of an array) or else just convert the hex strings you would like to use as keys into their decimal representations with parseInt, e.g.: sboxValues[parseInt(hexValues[x], 16)] = hexValues[sub - 1];
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44635906
accepted answer of: http://stackoverflow.com/q/28131173
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44636747

http://stackoverflow.com/a/28274885
has body: You'll want to use a separate element to insert your content into. document.getElementById("append").addEventListener("click", appendMore); function appendMore() { tgt.innerHTML += "1"; } append
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44905167
has comment: http://stackoverflow.com/comment/44905005
has comment: http://stackoverflow.com/comment/44904851
accepted answer of: http://stackoverflow.com/q/28274752
type: Answer
answers question: http://stackoverflow.com/q/28274752
score: 4
has comment: http://stackoverflow.com/comment/44904787
has comment: http://stackoverflow.com/comment/44904677
has comment: http://stackoverflow.com/comment/44905140
has comment: http://stackoverflow.com/comment/44905271
upvote count: 4

http://stackoverflow.com/a/28199313
answers question: http://stackoverflow.com/q/28172243
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28172243
downvote count: 0
has comment: http://stackoverflow.com/comment/44765918
score: 3
type: AcceptedAnswer
has body: The easiest way to get what you want is simply to use a CSS selector that looks for one id or the other. The following example simulates a delayed loading. We are looking for an element with either #foo or #bar. So we use the selector #foo, #bar. In your case it would be body.js, #mobile_landing_page. Doing it this way is the most efficient way because it reduces the number of round-trips between your Selenium script and the browser. var webdriver = require('selenium-webdriver'); var By = webdriver.By; var until = webdriver.until; var firefox = require('selenium-webdriver/firefox'); var Promise = require('bluebird').Promise; var browser = new firefox.Driver(); browser.get("http://www.example.com"); // // Decide randomly what we are going to be looking for // // This math here is probably not something to be emulated if you need // serious randomness (e.g. crypto). // var flip = Math.round(Math.random(0, 1)); var id = flip ? "foo": "bar"; console.log("We'll be simulating the delayed loading of an element with id", id); var waitForElement = function (browser, element, timeout) { return browser.wait(until.elementLocated(element), timeout); }; var isLoaded = function (browser) { return waitForElement(browser, By.css("#foo, #bar")); }; // Simulate the delayed loading of the element we are going to look for. browser.executeScript('\ var id = arguments[0];\ setTimeout(function () {\ var el = document.createElement("div");\ el.id = id;\ document.body.appendChild(el);\ }, 1000);\ ', id); isLoaded(browser); browser.quit();
type: Answer

http://stackoverflow.com/comment/44830538
type: AnswerComment
comment on: http://stackoverflow.com/a/28233146
has text: in the if condition I am fetching all the anchor href except the one which is clicked. Since the href is "#" + contentId...so just need to loop through this href array and remove active class from each content. in the end, I added active class on the content which belongs to clicked href.
type: Comment
score: 0

http://stackoverflow.com/a/28247545
downvote count: 0
type: Answer
score: 1
has body: Just played with this http://jqueryui.com/draggable/, I observed whenever we move the div it changes its inline style (top, left, right, bottom). I copied its style attribute after a movement and refreshed the page. After refresh the div comes back to original position, now I pasted the copied style attribute to the div and it took its previous state where I copied the style. SO, you can keep an array of elements Ids as key and style attribute as value. Upload it to server or you can use localStorage @ client. On the page reload fetch the array and set the inline styles back :) I had the similar requirement in past project but the drop targets were fixed....like tiles can be dropped onto an array of &lt;li&gt; elements. I handled it by storing only the indices of &lt;li&gt; element in order.
answers question: http://stackoverflow.com/q/28247397
upvote count: 1

http://stackoverflow.com/q/28211501
answer count: 2
accepted answer: http://stackoverflow.com/a/28211702
has answer: http://stackoverflow.com/a/28211665
possible better answer: http://stackoverflow.com/a/28211665
type: AnsweredQuestion
tagged with: javascript
has body: I have some code that moves an image/element across the screen multiple times. The idea is that I'm trying to create a simple add bar with the image moving within the add bar, the element acting as the border of the bar/the actual bar. With my current setup, the image moves outside of the element during animation despite being places within the /. fiddle (may need to find new image) :http://jsfiddle.net/rwowf5j8/3/ &lt;body onload="setInterval(function(){anim(document.getElementById('test'), 'left', 'px', 300, 800, 500)}, 600)"&gt; &lt;div id="Advert"&gt; &lt;img src="JS.png" id="test"&gt; &lt;/div&gt; &lt;/body&gt; &lt;script&gt; function anim(elem,style,unit,from,to,time) { if( !elem) return; var start = new Date().getTime(), timer = setInterval(function() { var step = Math.min(1,(new Date().getTime()-start)/time); elem.style[style] = (from+step*(to-from))+unit; if( step == 1) clearInterval(timer); },30); elem.style[style] = from+unit; } &lt;/script&gt; &lt;/body&gt; #Advert { background-color: white; border-style: solid; border-width: 2px; width: 500px; height: 225px; left: 300px; } #test { position: absolute; left: 140px; }
type: Question
tagged with: animation
has answer: http://stackoverflow.com/a/28211702
tagged with: css
has title: Animating a picture within border of div
score: 0

http://stackoverflow.com/a/28803355
type: Answer
upvote count: 1
has body: If you examine the source you will find that every time a mouseup, keyup or mouseout event fires on the editor div they snatch a copy of the range. This allows the selection to be recreated prior to acting on it. Around line 300 you'll find this editor.attr('contenteditable', true) .on(namespaceEvents('mouseup keyup mouseout'), function () { saveSelection(); updateToolbar(); }); Around line 248 you'll find this toolbar.find('[data-toggle=dropdown]').click(restoreSelection); This works erratically on IE because it's timing sensitive and slow DOM updates (eg show/hide a dropdown of typefaces as per the standard demo) will muck things up. You can fix it simply by allowing the DOM updates to finish before you try to restore the selection, like this: toolbar.find('[data-toggle=dropdown]').click(function () { setTimeout(restoreSelection, 20); }); As for the hyperlink stuff, I'm working on that right now and I'll update this answer shortly.
answers question: http://stackoverflow.com/q/28148742
downvote count: 0
score: 1

http://stackoverflow.com/comment/44887516
type: Comment
has text: My comment was addressed to bmurrell30, not to you. See the @bmurrell30 at the beginning of my comment. That's who it is addressed to. So far, most unclear question of the day. If the OP just wants to fill the array with 5 random numbers, their original code already works as shown in this jsFiddle: http://jsfiddle.net/jfriend00/frh3dyvd/. It remains unclear what they are actually asking.
type: AnswerComment
comment on: http://stackoverflow.com/a/28265009
score: 0

http://stackoverflow.com/comment/44708170
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28162842
has text: Indeed it is! Thanks!
type: AnswerComment

http://stackoverflow.com/comment/44709143
score: 0
type: AnswerComment
has text: It's Working. But see this in firefox. It is adding an extra Blank option .I have used your code . http://jsfiddle.net/TU6tp/27/
type: Comment
comment on: http://stackoverflow.com/a/28169691

http://stackoverflow.com/q/28143193
tagged with: numbers
tagged with: reactjs
answer count: 2
tagged with: random
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28143561
has body: I'm trying to create a new random number which will be set as state after a method. It works perfectly on refresh, but I can't 'generate' a new number after the button click. Here's my code at the moment: var QuizContainer = React.createClass({ randomNumber: function(){ return Math.floor((Math.random() * Data.length) + 0); }, getInitialState: function(){ var rand = this.randomNumber(); return { answerList: Data[rand].answer, answerQuestion: Data[rand].question, correctAnswer: Data[rand].correct, score: 0, timer: 30 } }, success: function(){ this.setState({score: this.state.score + 1}) }, fail: function(){ this.setState({score: 0}) this.getInitialState(); }, handleClick: function(child){ child.props.singleAnswer == this.state.correctAnswer ? this.success() : this.fail() }, render: function(){ return( &lt;div&gt; &lt;Timer timer={this.state.timer} /&gt; &lt;Score currentScore={this.state.score} /&gt; &lt;QuestionContainer answerQuestion={this.state.answerQuestion} /&gt; &lt;ButtonContainer onClick={this.handleClick} correctAnswer={this.state.correctAnswer} answerList={this.state.answerList} /&gt; &lt;/div&gt; ) } }) module.exports = QuizContainer; If anyone's able to help I'd be very grateful! Thanks!
accepted answer: http://stackoverflow.com/a/28143561
favorite count: 0
possible better answer: http://stackoverflow.com/a/30884316
upvote count: 3
has answer: http://stackoverflow.com/a/30884316
has title: React.js generate new random number
type: Question
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/28252730
type: Question
score: 3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28254091
answer count: 2
has answer: http://stackoverflow.com/a/28254691
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28254091
tagged with: angularjs
has body: My setup app/learning/learning.js angular.module('meanApp') .config(function($stateProvider) { $stateProvider .state('learning',{ templateUrl: 'app/learning/learning.html', url: '/learning', controller: 'LearnCtrl', views: { 'list': { templateUrl: 'app/learning/learning.list.html', controller: function($scope){ } }, 'magic': { templateUrl: 'app/learning/learning.magic.html', controller: function($scope){ } } } }); }); app/learning/learning.html Learning app/learning/learning.list.html A list app/learning/learning.magic.html Magic when I navigate to /learning I get a blank page, I'm not sure what I'm doing wrong so any help would be greatly appreciated.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28254691
upvote count: 3
tagged with: states
has title: Trying to use nested views in angularjs with ui-router get a blank page

http://stackoverflow.com/a/28248294
score: 0
has comment: http://stackoverflow.com/comment/44857119
has comment: http://stackoverflow.com/comment/44856905
has comment: http://stackoverflow.com/comment/44857254
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44856976
answers question: http://stackoverflow.com/q/28248263
has body: html: &lt;a id = 'button-one' name = '5'&gt; Button One &lt;/a&gt; javascript: window.onload = function() { document.getElementById('button-one').onclick = function() { changeURL(this.attributes.name.value); }; }; function changeURL(data) { location.hash = data; }

http://stackoverflow.com/q/28267376
has comment: http://stackoverflow.com/comment/44890893
answer count: 1
has comment: http://stackoverflow.com/comment/44892729
has answer: http://stackoverflow.com/a/28268523
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28268523
tagged with: promise
has body: I recently started working with promises and found a strange behavior for me. When i give the .then() function a reference to a undefined function it is just skipped and the next then is called. An example: var cust = customer({general: { cust_id: 22 }}); // just for testing req.pool.getConnectionAsync() .then(cust.del) // cust.del is 'undefined' .then(function(dbResult) { console.log("dbresult:"); console.log(dbResult); res.status(200).end(); }) .catch(function (e) { console.log(e); res.status(500).end(); }); So what's happening here: getConnectionAsync returns a connection which should be given to cust.del cust.del is undefined (was a typo by me the correct function would be cust.delete) no error is raised instead the next .then function is called with the connection from getConnectionAsync as "dbresult" the output of the last then function is the connection object and not a db result object and status 200 is returned to the client If i change the code to: req.pool.getConnectionAsync() .then(function(conn) { cust.del(conn) }) // type error is raised .then(function(dbResult) { console.log("dbresult:"); console.log(dbResult); res.status(200).end(); }) .catch(function (e) { console.log(e); res.status(500).end(); }); then i get the expected TypeError and the catch function is called. Is this an expected behavior? Or am I missing something to prevent this? .then(cust.del) is obviously much cleaner code, but since this function is not callable there should be an error. Regards Phil
tagged with: node.js
tagged with: bluebird
type: AnsweredQuestion
has title: Bluebird .then(): no TypeError when function reference is undefined
type: Question
score: 0

http://stackoverflow.com/a/28240034
score: 1
upvote count: 1
type: Answer
has body: Here's a general method, which uses getClientRects() to determine when the contents overflow to a new line. normalize() seems to be needed for getClientRects() to function properly. I'm using word-wrap: break-word to avoid the need for multiple spans. You can also simplify the for loop by using the Array().join() method I use: var space = $('&lt;span&gt;').appendTo('div'), num_chars; do { space.append('M'); space[0].normalize(); } while (space[0].getClientRects().length === 1); num_chars = space.text().length; $('div').html(Array(num_chars).join('d')); div { font-family: monospace; font-size: 12px; width: 400px; border: 1px solid black; } span { word-wrap: break-word; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28239175
downvote count: 0

http://stackoverflow.com/a/28180669
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44735879
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44764930
accepted answer of: http://stackoverflow.com/q/28180570
has body: ooo so close ;) you've got a little typo in there ng-controller="contactCtrl" != .controller('ContactCtrl') check out your first letter.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28180570

http://stackoverflow.com/comment/44834097
comment on: http://stackoverflow.com/a/28235020
score: 0
type: AnswerComment
has text: Another problem with bootstrap responsive Media screen menu. It's not Working well and it's breaking down on to the other content. Please help me again..
type: Comment

http://stackoverflow.com/q/28142004
type: AnsweredQuestion
has body: I am getting error Uncaught SyntaxError: Unexpected identifier on line : TableX[i] = &lt;?php echo $TableX[$x]; ?&gt; ; In the code below : index.php for( i = 1 ; i&lt;= &lt;?php echo $num;?&gt; ; i++) { &lt;?php for($x = 1 ; $x&lt;=$num ; $x++ ) { ?&gt; TableX[i] = &lt;?php echo $TableX[$x]; ?&gt; ; TableY[i] = &lt;?php echo $TableY[$x]; ?&gt; ; } &lt;?php } ?&gt; I've wasted enough time on this , help would be really appreciated .
has comment: http://stackoverflow.com/comment/44655705
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28142016
score: 0
accepted answer: http://stackoverflow.com/a/28142016
has title: Embeddin PHP into Javascript ,Uncaught SyntaxError: Unexpected identifier
tagged with: php
type: Question

http://stackoverflow.com/comment/44658324
type: Comment
comment on: http://stackoverflow.com/a/28143255
has text: The method is great, but beside of validating the format I need the regular exp to split the expression into its groups for further processing.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44840615
type: QuestionComment
has text: map.addOverlay(marked) in javascript gmap V3 was removed. I realize the PF 5.1 uses google maps v3
type: Comment
comment on: http://stackoverflow.com/q/28235533
score: 0

http://stackoverflow.com/comment/44799536
type: Comment
comment on: http://stackoverflow.com/q/28217928
has text: Is it reaching to $.post callback function you provided?
score: 0
type: QuestionComment

http://stackoverflow.com/q/28225522
tagged with: jquery
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/28225628
tagged with: regex
has title: Split long string into text chunks with jQuery
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/28225628
tagged with: substr
type: Question
tagged with: javascript
has body: I have a long string that needs to be sliced into separated chunks inside an array, with a predefined length limit the chunks. Some rules apply: If the limit cuts a word, then the word is separated for the next chunk. Slices must be trimmed (no spaces at the beginning or end of the array item). Special punctuation .,!? should stay with the word, and not be sent to the next chunk. Original text: I am totally unappreciated in my time. You can run this whole park from this room with minimal staff for up to 3 days. You think that kind of automation is easy? Or cheap? You know anybody who can network 8 connection machines and debug 2 million lines of code for what I bid for this job? Because if he can I'd like to see him try. Result with current code ["I am totally", " unappreciated in my time", ". You can run this whole", " park from this room with", " minimal staff for up to ", "3 days. You think that", " kind of automation is ea", "sy? Or cheap? You know", " anybody who can network ", "8 connection machines", " and debug 2 million line", "s of code for what I bid", " for this job? Because if", " he can I'd like to see h", "im try."] ...it should actually be: ["I am totally", "unappreciated in my time.", "You can run this whole", "park from this room with", "minimal staff for up to 3", "days. You think that kind", "of automation is easy?", "Or cheap? You know anybody", "who can network 8", "connection machines and", "debug 2 million lines of", "code for what I bid for", "this job? Because if he", "can I'd like to see him", "try."] As you can see, I'm still having trouble with rules 2 and 3. This is my current code (you can check the working demo in jsfiddle): function text_split(string, limit, pos, lines) { //variables if(!pos) pos = 0; if(!lines) lines = []; var length = string.val().length; var length_current; //cut string var split = string.val().substr(pos, limit); if(/^\S/.test(string.val().substr(pos, limit))) { //check if it is cutting a word split = split.repla…
score: 2
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28247779
score: 1
has body: You can use the following and it should be useable in used even if the tab is opened in a new window. if(document.referrer != ''){ // DESTROY ANY PREVIOUS DUPLICATE COOKIE setCookie('referrer','',-1); // CREATE COOKIE ON REGISTRATION PAGE setCookie('referrer',document.referrer,1); document.location.replace(document.referrer); //replaces current url with new one eg. the (current) url is removed from history //or document.location.href = document.referrer; //(current) url is in history/can use back button to go to previous page }
upvote count: 1
has comment: http://stackoverflow.com/comment/44873508
has comment: http://stackoverflow.com/comment/44893697
has comment: http://stackoverflow.com/comment/44893876
downvote count: 0
has comment: http://stackoverflow.com/comment/44874442
type: Answer
answers question: http://stackoverflow.com/q/28247629

hover
tags question: http://stackoverflow.com/q/28223673
type: Tag
tags question: http://stackoverflow.com/q/28153972
tag name: hover

http://stackoverflow.com/comment/44789799
score: 0
type: AnswerComment
type: Comment
has text: How to work out this combo drop down box scenario in casperjs ?
comment on: http://stackoverflow.com/a/28212225

http://stackoverflow.com/comment/44934676
type: Comment
has text: I don't understand with your link. I need more detail please.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28229403

http://stackoverflow.com/comment/44883035
comment on: http://stackoverflow.com/q/28261942
type: Comment
has text: JSON worked perfectly here thanks! Always good to learn something new
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44757126
score: 1
has text: Yes, that's correct. In Promises/A+ compliant promises, calls to the handlers must be deferred (https://promisesaplus.com/#point-34), but it looks like already-resolved jQuery promises call their handlers immediately: http://jsfiddle.net/acn4r4vs/
type: AnswerComment
comment on: http://stackoverflow.com/a/28193450
type: Comment

http://stackoverflow.com/q/28267202
has comment: http://stackoverflow.com/comment/44890607
has title: My for loop is breaking my code
has comment: http://stackoverflow.com/comment/44891111
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44890897
has comment: http://stackoverflow.com/comment/44891181
tagged with: mongoose
has comment: http://stackoverflow.com/comment/44891795
tagged with: javascript
has comment: http://stackoverflow.com/comment/44890928
has body: Here's the for loop in question: console.log(sender1[0]); // returns user object console.log(sender1.length); // returns 1 for (var i = 0; i &lt; sender1.length; i = i + 1) { console.log(sender1[i].phone); // returns can't read phone property of undefined } Here's where I'm getting sender 1 User.find().where({ code: req.body.Body.toUpperCase() }).exec(function (err, sender1) { This is using mongoose, so sender1 is already an array. I tried using .toArray and it said find has no method "toArray". If I replace all the sender[i] with sender[0], everything works fine. But it's saying sender[i].somename is undefined. What's wrong with my loop? Second Update: 2015-02-01T20:38:20.900903+00:00 app[web.1]: 2015-02-01T20:38:20.930258+00:00 app[web.1]: error: Script restart attempt #1 2015-02-01T20:38:20.894952+00:00 app[web.1]: this is sender1 length 1 2015-02-01T20:38:20.895077+00:00 app[web.1]: The for loop executed! 2015-02-01T20:38:20.895465+00:00 app[web.1]: this is sender1 section ["54baf92d2b54840900dcb971"] 2015-02-01T20:38:20.895504+00:00 app[web.1]: jj is 0 2015-02-01T20:38:20.900455+00:00 app[web.1]: This is the from1 phone +19206398297 2015-02-01T20:38:20.901052+00:00 app[web.1]: console.log('This is the section1 phone',sender1[jj].phone); 2015-02-01T20:38:20.901050+00:00 app[web.1]: /app/packages/timeoff/server/controllers/timeoff.js:104 2015-02-01T20:38:20.903068+00:00 app[web.1]: TypeError: Cannot read property 'phone' of undefined 2015-02-01T20:38:20.901184+00:00 app[web.1]: ^ 2015-02-01T20:38:20.903071+00:00 app[web.1]: at Promise.&lt;anonymous&gt; (/app/packages/timeoff/server/controllers/timeoff.js:104:53) 2015-02-01T20:38:20.903072+00:00 app[web.1]: at Promise.&lt;anonymous&gt; (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8) 2015-02-01T20:38:20.903074+00:00 app[web.1]: at Promise.emit (events.js:95:17) 2015-02-01T20:38:20.903075+00:00 app[web.1]: at Promise.emit (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)…
type: Question
has comment: http://stackoverflow.com/comment/44892325
has comment: http://stackoverflow.com/comment/44890876
has comment: http://stackoverflow.com/comment/44891312
tagged with: node.js
has comment: http://stackoverflow.com/comment/44934801
answer count: 0
score: 0

http://stackoverflow.com/comment/64620985
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28255284
has text: @wanttobeprofessional, what do you mean? maybe create another question
score: 0

http://stackoverflow.com/comment/44872233
score: 0
type: Comment
type: QuestionComment
has text: When the end value gets lowered and it's lower than the start value, also lower the start value, or put the cursor in the start value box.
comment on: http://stackoverflow.com/q/28256860

http://stackoverflow.com/comment/44738663
type: Comment
type: QuestionComment
has text: did you try anything ? can you put your effort here ?
score: 1
comment on: http://stackoverflow.com/q/28184267

http://stackoverflow.com/q/28213308
tagged with: input
has title: Save an uploaded image in a local location
has body: on my webpage an user can upload a image with an input like this: &lt;input ID="submitBackground" class="imageUploader" type='file'/&gt; The image shall be saved to my server to C:/TEMP immediately. I try to get access to the uploaded file, I am so far: var input = document.getElementById('submitBackground'); $("#submitBackground").change(function() { if (input.files &amp;&amp; input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { // Something (a stream?) is written in e.target.result; }; reader.readAsDataURL(input.files[0]); } }); I just don't know how to continue, I need to save it local somehow. Has anyone an idea how to do it?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28314924
has comment: http://stackoverflow.com/comment/44790417
type: Question
tagged with: upload
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44790260
has answer: http://stackoverflow.com/a/28314924

http://stackoverflow.com/q/28202801
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28205307
tagged with: javascript
tagged with: express
has title: ExpressJS : req is undefined
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/44771782
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44772060
has body: I try to post data with XMLHttpRequest to a service made with ExpressJS. Server side in index.js : app.post('/add',url.add); Servier side in url.js : exports.add = function(req, res){ var urlToAdd = req.body; console.log(urlToAdd); }; Client side : Ajouter JS Client side : document.getElementById("addButton").addEventListener("click",function(){ var url = document.getElementById("url").value; var xhr_object = null; if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest(); else if(window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); else { alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); return; } xhr_object.open("POST", "/add", true); xhr_object.onreadystatechange = function() { if(xhr_object.readyState == 4) { //alert(xhr_object.responseText); // DEBUG MODE //document.write(xhr_object.responseText); eval(xhr_object.responseText); } return xhr_object.readyState; } var param = "url="+url; xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr_object.send(param); }); When I want to send data, req.body is undefined.
has answer: http://stackoverflow.com/a/28205307
type: Question
tagged with: post

http://stackoverflow.com/comment/44839147
score: 0
type: Comment
type: QuestionComment
has text: There's no way to know what could be wrong if we can't see code that reproduces the problem.
comment on: http://stackoverflow.com/q/28238854

http://stackoverflow.com/comment/44965844
has text: thanks @kangax toDatalessJSON didn't reduce the image from the original size however i think we've found a way to achieve the requirements as answered below
comment on: http://stackoverflow.com/q/28199688
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/114183629
comment on: http://stackoverflow.com/a/29788621
score: 0
type: AnswerComment
has text: I got this error yesterday and I got it in some Chromium based browsers (Microsoft Edge v86.0.622.56, Opera v71.0.3770.284). However Firefox work as expected. This answer solved the problem in all browsers!
type: Comment

http://stackoverflow.com/q/28275960
upvote count: 2
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/37613564
has title: AngularJS return value in the scope from an addEventListener
type: Question
answer count: 2
has body: I have an AngularApp in an iframe and I have a controller with this code to get a click event from the iframe container (main window): $window.addEventListener('message', function(e) { $scope.$apply(function() { console.log(e.data.url); // http://&lt;something&gt; $scope.widget.pageUrl = e.data.url; }); }); console.log($scope.widget.pageUrl); // undefined Everything works fine except I cannot get the $scope.widget.pageUrl variable filled. It remains undefined outside the $window.addEventListener. Any hint?
downvote count: 0
tagged with: javascript
tagged with: dom-events
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28276141
score: 2

http://stackoverflow.com/q/28216761
has comment: http://stackoverflow.com/comment/44797623
has comment: http://stackoverflow.com/comment/44797207
has comment: http://stackoverflow.com/comment/44797701
has comment: http://stackoverflow.com/comment/44797283
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44797615
upvote count: 3
has comment: http://stackoverflow.com/comment/44797713
has comment: http://stackoverflow.com/comment/44797746
linked to: http://stackoverflow.com/q/14330878
type: Question
has answer: http://stackoverflow.com/a/28217708
tagged with: javascript
has title: How do I order ng-repeat items?
has comment: http://stackoverflow.com/comment/44797473
answer count: 1
downvote count: 0
has body: My options object for the select looks like this: { 3 : 'c', 5 : 'a', 6 : 'b', ... } my repeat looks like this: {{v}} I want to order by the values (v), but as far as I can tell, orderBy only works with a key of the object, which does not work for this format.
has comment: http://stackoverflow.com/comment/44797799
favorite count: 0
has comment: http://stackoverflow.com/comment/44797014
accepted answer: http://stackoverflow.com/a/28217708
tagged with: angularjs

http://stackoverflow.com/comment/44717070
type: AnswerComment
score: 0
has text: I want to know each divs text length as im looping through it. Your code returns 3 on every loop
type: Comment
comment on: http://stackoverflow.com/a/28173735

http://stackoverflow.com/comment/44818232
has text: Oh and also, I forgot I was also confused by why I shouldn't authenticate at `app.post('/login')`. My logic was that, that particular route only gets activated on a POST to that endpoint. When else would the `req.body` have user credentials being sent to the endpoint?
comment on: http://stackoverflow.com/a/28227402
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28189372
score: 0
has comment: http://stackoverflow.com/comment/44747041
tagged with: select
has comment: http://stackoverflow.com/comment/44747105
has comment: http://stackoverflow.com/comment/44746945
type: Question
has title: Using javascript and XML to populate a drop-down box
tagged with: javascript
has body: Very new to all this, so please bear with me and use simple answers! I am trying to dynamically populate a drop down box (theSecondBox), with a list of items which is dependent on the selection made in another drop down box (theCriteria). I have been able to do an AJAX request and am getting an XML document back. So far my script looks like this:- var xmlHttp; function triggerAction(){ xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; criteria = document.getElementById("theCriteria").value; xmlHttp.open("GET","MyURL?criteria=" + criteria, true); xmlHttp.send(null); } function handleStateChange(){ if(xmlHttp.readyState == 4){ if(xmlHttp.status == 200){ parseResults();} } } This returns an XML document to me that looks like this :- FirstDropDownItem SecondDropDownItem ThirdDropDownItem So, I'm trying to populate my second drop down box with these items, using something like ... function parseResults(){ var results var selectTag results = xmlHttp.responseXML; selectTag = document.getElementById("theSecondBox"); ...and this is where I need a few 'simple' pointers. How do I populate the secondBox with the items returned in the XML document? Everything I've tried so far (and I won't reproduce it to save my embarrassment!) just gives me nulls. Apologies for the simple question, but as I said, I'm not a programmer by any means, so any pointers to either a solution, or a good tutorial which will help to educate me would be much appreciated.
answer count: 1
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28190452
has comment: http://stackoverflow.com/comment/44746939
has comment: http://stackoverflow.com/comment/44747057
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/44746743

http://stackoverflow.com/a/28273496
answers question: http://stackoverflow.com/q/28273417
has body: Using this you will get your expected output. var var2= "1.400" ; var2 = var2.replace(".",""); var2=parseInt(var2); Explanation: var s1 = '2 + 2'; // creates a string primitive var s2 = new String('2 + 2'); // creates a String object console.log(eval(s1)); // returns the number 4 console.log(eval(s2)); // returns the string "2 + 2"
type: Answer
score: 0

http://stackoverflow.com/comment/44754054
type: AnswerComment
comment on: http://stackoverflow.com/a/28193450
score: 0
type: Comment
has text: @JLRishe I meant defining the callback function, thanks for correcting.

http://stackoverflow.com/q/28227286
possible better answer: http://stackoverflow.com/a/28242814
score: 2
type: AnsweredQuestion
has body: I'm trying to learn Express session and authentication handling. For example: app.post('/login', authCredentials, function(req, res) { console.log("second") }); function authCredentials(req, res, next) { //this happens first console.log(req.body) // =&gt; { username: etc, password: etc } next(); } My question is just how much should my authCredentials function do? For example if the credentials are correct, I can do something like res.redirect('/index'). Once I do that, however, what purpose does the second function have? Other questions: How would I handle invalid credentials? If I make authCredentials just return true or false depending on the credentials, doesn't that break the middleware flow because it would never invoke next()? Is it possible to access anything in authCredentials in the anonymous callback after it? Basically in the function(req, res) { }?
tagged with: middleware
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28227402
downvote count: 0
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/28242814
favorite count: 0
has title: Express user authentication middleware, how much should it do?
accepted answer: http://stackoverflow.com/a/28227402
upvote count: 2

http://stackoverflow.com/comment/44783173
score: 0
comment on: http://stackoverflow.com/a/28208569
type: AnswerComment
type: Comment
has text: @Don when I say add fixed width, I mean giving a certain numerical value. Try this: "width: 980px;"

http://stackoverflow.com/comment/71408236
type: AnswerComment
type: Comment
has text: It's also showing undefined in jQuery2.11 *** Disregard *** Was focusing on the modal event and not the button event...
comment on: http://stackoverflow.com/a/28270395
score: 0

local-storage
tags question: http://stackoverflow.com/q/28231267
tags question: http://stackoverflow.com/q/28143571
tags question: http://stackoverflow.com/q/28250998
tags question: http://stackoverflow.com/q/28155624
tags question: http://stackoverflow.com/q/28182126
tags question: http://stackoverflow.com/q/28127808
tags question: http://stackoverflow.com/q/28214645
tag name: local-storage
tags question: http://stackoverflow.com/q/28183376
tags question: http://stackoverflow.com/q/28233410
tags question: http://stackoverflow.com/q/28217824
tags question: http://stackoverflow.com/q/28127341
tags question: http://stackoverflow.com/q/28150492
tags question: http://stackoverflow.com/q/28129602
tags question: http://stackoverflow.com/q/28249734
type: Tag
tags question: http://stackoverflow.com/q/28220093
tags question: http://stackoverflow.com/q/28206654
tags question: http://stackoverflow.com/q/28237695
tags question: http://stackoverflow.com/q/28250682

http://stackoverflow.com/comment/44898579
type: Comment
has text: try using this cdn link for angular-route. https://cdnjs.cloudflare.com/ajax/libs/angular.js/<version>/angular-route.js
comment on: http://stackoverflow.com/q/28270797
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44956955
has text: There is no inputs in my example but you can simply add it and then assign value the same way. File name is available under 'Blob.filename'. Example: document.getElementById('yourInputID').value = Blob.filename;
comment on: http://stackoverflow.com/a/28257330
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44633267
type: Comment
comment on: http://stackoverflow.com/a/28130182
has text: My brouser language is English. And when I get one results in Ukrainian, all next results are in Ukrainian too.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44700660
type: Comment
comment on: http://stackoverflow.com/q/28162935
type: QuestionComment
has text: Actually the HTML code already has a background color style set for every row.. I would like to know how I can change this color when a particular row is selected.. I tried using CSS but the HTML style overrides the CSS Style. Is there any way I can Force a different style using javascript?
score: 0

http://stackoverflow.com/q/28134115
type: AnsweredQuestion
has title: conditional block not triggered when NaN !== 'number' Javascript
duplicate of: http://stackoverflow.com/q/2801601
accepted answer: http://stackoverflow.com/a/28134134
has body: I am writing an array calculator on code wars. I have a function that checks the array for a valid sequence of numbers and operators. My function validSequence() is not return false when it is supposed to. The error in this test array: Test.assertSimilar(validSequence(['10', '+', '20', '*','3', '*']), false) is not being caught by this line in validSequence() if(typeof parseInt(arr[arr.length-1]) !== 'number'){ return false; } and I don't know why. It gives a NaN as expected, so I don't know why it doesn't enter the block and return false.
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28134134
tagged with: javascript
linked to: http://stackoverflow.com/q/2801601

http://stackoverflow.com/comment/44684186
type: AnswerComment
score: 0
type: Comment
has text: @RW24 from what i saw in your code, you don't need a module, `$(document).ready(function()` is useless
comment on: http://stackoverflow.com/a/28153781

http://stackoverflow.com/a/28202146
has body: You can't actually execute it from another page, you can however use the following. The best way to do this is with a cookie, storing the username, and pointing to an encrypted file with an encrypted password. But you can store the encrypted password in a cookie too, as long as it's encrypted before putting it in the cookie. I originally developed this for a function that will keep a user logged in to a page that redirected to a login whenever it is accessed, it will click the button and bring them to the page after the login page. working example: Will need to be edited to fit exact elements on any page, and run on the page, probally through a property or permission gained through a download or web app etc. function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } 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) == 0) return c.substring(name.length,c.length); } return ""; } function stayLoggedIn() { setCookie("logged_in","true",30); setCookie("username", username,30); setCookie("password",encryptedPassword,30); return null; } window.onload { var loggedIn = getCookie("logged_in"); if(loggedIn == true) { var username = getCookie("username"); var password = getCookie("password"); var usernameTextBox = document.getElementById("username"); var passwordTextBox = document.getElementById("password"); //decrypt password here. usernameTextBox.value = username; passwordTextBox.value = password; } else {} } Explained: first, we set a function to set a cookie and get one, I took these from here then, I set the function stayLoggedIn() this sets the cookie with the value of "logged_in" to true, so when the user comes to the page, and window.onload runs it's block, the if st…
accepted answer of: http://stackoverflow.com/q/28201974
answers question: http://stackoverflow.com/q/28201974
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45088829
score: 2
has comment: http://stackoverflow.com/comment/44771047
has comment: http://stackoverflow.com/comment/44770958

http://stackoverflow.com/q/28262347
has answer: http://stackoverflow.com/a/28262509
has body: I need to highlight the keyword used for search in the blog. So far i managed to used the following script http://www.jquery.info/scripts/SearchHighlight/demo_en.html but this script doesn't match the exact keywords if one wishes to. It is working as it has been programmed to. When one select option exact: "exact", in the function it match's and highlights each word Per id of search keyword. How can i modify this script so that it match whole keywords not part of keywords . In this fiddle example it should only highlight Per id rather than occurrences of Per or id.. Fiddle example: http://jsfiddle.net/gq4hkvgd/ var val2 = "Per id"; var options = { exact: "exact", style_name_suffix:false, keys:val2 } $('.wrapper').SearchHighlight(options);
has answer: http://stackoverflow.com/a/78469321
has comment: http://stackoverflow.com/comment/44881874
type: Question
has comment: http://stackoverflow.com/comment/44881717
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28262509
tagged with: jquery
has comment: http://stackoverflow.com/comment/44882010
tagged with: http://stackoverflow.com/tag/html
has title: Highlight text for search keyword based on complete keywords
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/78469321

http://stackoverflow.com/comment/44628311
type: AnswerComment
type: Comment
has text: yes, I know that. you linked to an article about http polling though. I think that will create more confusion, not help a beginner.
comment on: http://stackoverflow.com/a/28127608
score: 0

template-engine
tags question: http://stackoverflow.com/q/28131912
tag name: template-engine
tags question: http://stackoverflow.com/q/28195934
type: Tag
tags question: http://stackoverflow.com/q/28231451
tags question: http://stackoverflow.com/q/28139658
tags question: http://stackoverflow.com/q/28128483

http://stackoverflow.com/comment/44885007
type: AnswerComment
has text: I tried it many times but it doesn't work. Can you show me your code, maybe I do something wrong?
type: Comment
comment on: http://stackoverflow.com/a/28208585
score: 0

http://stackoverflow.com/comment/44876895
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28259462
score: 0
has text: I tested this: ` ` - and it works.

http://stackoverflow.com/q/28184263
tagged with: javascript
has comment: http://stackoverflow.com/comment/44737992
has comment: http://stackoverflow.com/comment/44752234
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28184539
has comment: http://stackoverflow.com/comment/44737618
favorite count: 0
has body: I am trying to increase the width and padding of stacked bar graph but unable to get it. I have tried pointWidth and pointPadding property but it overlaps with each other if I try to give pointWidth: 20but it overlaps with each other instead of having padding among bars. plotOptions: { series: { stacking: 'normal', pointWidth: 15 pointPadding: 0 } }, Please look at the below link: http://jsfiddle.net/rkahuja99/cmhbvqp7/ Any help will be highly appreciated. Thanks.
has comment: http://stackoverflow.com/comment/44737613
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28184539
upvote count: 1
type: Question
tagged with: graph
has title: HighCharts: Increase width and padding of stacked bar graph

http://stackoverflow.com/comment/44639860
type: Comment
type: QuestionComment
has text: Please clarify your question. what is it that you want to remove? How is it even related to the code in the question
comment on: http://stackoverflow.com/q/28133663
score: 0

http://stackoverflow.com/comment/44746062
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28188396
has text: I get 403 here http://jsfiddle.net/mplungjan/7tc21g1j/ . So now it is clear

http://stackoverflow.com/q/28249088
tagged with: sublimetext2
has body: I've been using sublime text for 2 months and I really like it so far. However, I am starting to implement angular design material on my webapps and I have an issue with the indentation process : it doesn't indent well and mess with the structure. I have put a screenshot at the bottom of the post. FYI I have no indentation or HTML syntax related package installed and I didn't change the default indentation preferences. When I take all the angular material design element out of my code, it works well but as soon as I add a tag, it goes wild. The code works perfectly well but it's really difficult to code that way. I've tried a clean install of sublime text 2 with no packages or changed at all and it still doesn't work well. (I use sublime text 3 for my everyday coding). So my question is, how can I fix that? Thanks in advance and have a nice day! ;) PS : The following code is a copy-paste from https://material.angularjs.org/#/getting-started reformatted with hate by my sublime text 3 indentation process. Menu Hello World
accepted answer: http://stackoverflow.com/a/30929064
score: 8
downvote count: 0
tagged with: javascript
type: Question
type: AnsweredQuestion
tagged with: sublimetext3
favorite count: 0
tagged with: angularjs
upvote count: 8
has answer: http://stackoverflow.com/a/30929064
has title: Angular JS (and especially Angular Material Design) don't indent well on Sublime Text 3
answer count: 1

http://stackoverflow.com/q/28270831
has comment: http://stackoverflow.com/comment/44897643
has comment: http://stackoverflow.com/comment/44897338
tagged with: javascript
tagged with: forms
score: 0
has title: Modal box confirmation before submit the form
has comment: http://stackoverflow.com/comment/44897735
tagged with: modal-dialog
tagged with: jquery
has comment: http://stackoverflow.com/comment/44897355
has comment: http://stackoverflow.com/comment/44897697
type: UnansweredQuestion
has body: I have form where user will type his information and before he/she will submit the form, there was a confirmation that indicated whether if he/she is sure to submit the form. I have try to run my code below but I cannot see the problem why isn't working. I hope you help me. thank you here's form Receiving report <link rel="stylesheet" href="<?php echo base_url(); ?>assets1/css/bootstrap.css"> <script type="text/javascript" src="<?php echo base_url();?>assets1/jquery/jquery-1.11.1.min.js" > Code Model Color Qty To receive Engine Number Chassis Number Complete TBA Promo 6 Raider J BLUE 1 0 1 Complete Incomplete Modal Submit <?php form_close(); ?> × Are you sure Do you want to submit the form? Yes No
has comment: http://stackoverflow.com/comment/44897283
tagged with: php
answer count: 0
has comment: http://stackoverflow.com/comment/44898461
type: Question

http://stackoverflow.com/q/28231825
has title: How To add a link for image1 and image2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44826057
score: -1
answer count: 2
upvote count: 0
has body: function displayNextImage() { x = (x === images.length - 1) ? 0 : x + 1; document.getElementById("img").src = images[x]; } function displayPreviousImage() { x = (x <= 0) ? images.length - 1 : x - 1; document.getElementById("img").src = images[x]; } function startTimer() { setInterval(displayNextImage, 3000); } var images = [], x = -1; images[0] = "image1.png"; images[1] = "image2.png"; change picture I have two images: image1 and image2 - which will change automatically. 5 seconds from now I need to attach a link for both images i.e for image1 and image2. Please help me with this
favorite count: 0
has comment: http://stackoverflow.com/comment/44826055
has answer: http://stackoverflow.com/a/28232067
type: UnansweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44826108
has answer: http://stackoverflow.com/a/28232074

http://stackoverflow.com/q/28121908
has title: Host assets on Google Drive, loop to display
score: 0
answer count: 1
tagged with: google-drive-api
has answer: http://stackoverflow.com/a/28122472
type: UnansweredQuestion
tagged with: php
has body: I am using Google Drive to host images, it gives me a public URL that I am using on my carousel...this is only an issue if I put an image tag and the image does not belong (the result is a blank image in the carousel) I know you can use JS to detect if an image is available, but would it be possible to write a loop that would display all images in a certain folder? Current Example - data-src="https://googledrive.com/host/gdrivepath/inside-1.JPG" In a perfect world my client should be able to dump a bunch of images into an assigned folder (assuming images are named sequentially), and no matter the amount the loop would catch them all. Is this possible with just JS? Thank you!
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/102924535
has text: @Madbreaks For documentation of this fuctionality of select 2's https://select2.org/configuration/data-attributes
type: AnswerComment
comment on: http://stackoverflow.com/a/30738457
score: 0
type: Comment

http://stackoverflow.com/q/28198582
tagged with: javascript
has answer: http://stackoverflow.com/a/28198977
score: 0
has answer: http://stackoverflow.com/a/28198650
tagged with: random
answer count: 3
possible better answer: http://stackoverflow.com/a/28198733
has title: Random Insult Generator (Randomizing Results)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44763580
has body: I've written a random insult generator. It is fine, and works well to what I need. The problem is that when I run the program more than once, the insult is the same every time, unless I copy all the vars again. Here is my code: var bodyPart = ["face", "foot", "nose", "hand", "head"]; var adjective = ["hairy and", "extremely", "insultingly", "astonishingly"]; var adjectiveTwo = ["stupid", "gigantic", "fat", "horrid", "scary"]; var animal = ["baboon", "sasquatch", "sloth", "naked cat", "warthog"]; var bodyPart = bodyPart[Math.floor(Math.random() * 5)]; var adjective = adjective[Math.floor(Math.random() * 4)]; var adjectiveTwo = adjectiveTwo[Math.floor(Math.random() * 5)]; var animal = animal[Math.floor(Math.random() * 5)]; var randomInsult = "Your" + " " + bodyPart + " " + "is more" + " " + adjective + " " + adjectiveTwo + " " + "than a" + " " + animal + "'s" + " " + bodyPart + "."; randomInsult; "Your nose is more insultingly stupid than a warthog's nose." randomInsult; "Your nose is more insultingly stupid than a warthog's nose." What I'm trying to do is when I run randomInsult; again, I want a different result.
has answer: http://stackoverflow.com/a/28198733
type: Question
accepted answer: http://stackoverflow.com/a/28198650

http://stackoverflow.com/comment/44790857
comment on: http://stackoverflow.com/q/28213338
score: 0
type: QuestionComment
type: Comment
has text: So what is your question?

http://stackoverflow.com/a/28196136
accepted answer of: http://stackoverflow.com/q/28193510
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/57458634
has body: i have resolved with cookie setting: response.setHeader("Set-Cookie", "fileDownload=true; path=/"); else if i have an exception set so: response.setHeader("Set-Cookie", "fileDownload=false; path=/");
answers question: http://stackoverflow.com/q/28193510

http://stackoverflow.com/comment/44650885
type: Comment
comment on: http://stackoverflow.com/a/28138458
type: AnswerComment
has text: Finally figured that out, I added code "alert('a')" before the function capturing onkeydown returns, then it didn't work. After I delete that alert code, it works fine. PS. the event is not canceling, but working till end then return a signal 'false' to stop the next step
score: 0

http://stackoverflow.com/a/28145431
has comment: http://stackoverflow.com/comment/44662708
score: 1
upvote count: 1
has body: Those are not primitives. Compare: console.log("foo", new String("foo")); console.log(1, new Number(1) ); console.log(true, new Boolean(true)); The first values are primitives; the second ones are objects that wrap primitives (i.e. boxed versions). As to why it happens, $.each is implemented in terms of Function.prototype.call, which has this bit in its documentation (MDN): The value of this provided for the call to fun. Note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object, and primitive values will be boxed. (Emphasis mine)
has comment: http://stackoverflow.com/comment/44662672
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28145378
answers question: http://stackoverflow.com/q/28145378
type: Answer

http://stackoverflow.com/comment/44628779
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28127299
has text: This might help http://stackoverflow.com/questions/24303371/touchscreen-scroll-disable

http://stackoverflow.com/a/28347551
has body: If you want to load an external resource as for example a JavaScript file you need to intercept the call using a ResourceInterceptor and inject your file into the response.
answers question: http://stackoverflow.com/q/28239408
type: Answer
score: 0

http://stackoverflow.com/q/28227516
has comment: http://stackoverflow.com/comment/44821107
answer count: 1
tagged with: javascript
score: 0
tagged with: knockout-validation
accepted answer: http://stackoverflow.com/a/28232649
has comment: http://stackoverflow.com/comment/44826909
type: AnsweredQuestion
tagged with: knockout.js
has title: How do I call an observable property within its own validation extender?
type: Question
has body: I'm attempting to create a drop-down list of countries using the knockout framework in ASP MVC4. The validation requirement is fairly simple - a country has to be selected before the control is validated. The relevant code in the view model is as follows: function viewModel(model) { var _self = this; // Various guff _self.ConfirmationOption = ko.observable(model.ConfirmationOption).extend({ required: { message: _self.mdata.requiredMessage } }); //mdata is part of the guff _self.CountryOfPractice = ko.observable(model.CountryOfPractice).extend({ required: { message: "You must select a country", onlyIf: function () { return (_self.ConfirmationOption() === '4' &amp;&amp; (_self.CountryOfPractice() === null || _self.CountryOfPractice() === undefined)); } } }); // Assorted other guff } When I try to run this, Firebug tells me that an error occurs trying to parse, showing: TypeError: _self.CountryOfPractice() is not a function. My limited understanding of knockout is that properties declared as ko.observable are not strictly JS properties and have to be accessed as functions in order to obtain their current value. In most other areas of code this normally works fine. The reason I attempt this access to the value within the validator extension is to ensure that a selection has been made. I can see in the debugger that CountryOfPractice is not yet part of _self, so I can somewhat see how the error occurs. I tried factoring out the test into another function declared beforehand but that function then fails because it hasn't yet seen CountryOfPractice(), if I place it after this method it fails because CountryOfPractice()'s extender hasn't yet seen my validation method... What pattern do I need to use in order to be able to get the function to work?
has answer: http://stackoverflow.com/a/28232649

http://stackoverflow.com/a/37646585
has body: Reveal.js is running perfectly fine locally for me using only a few lines: &lt;script src="reveal.js/lib/js/head.min.js"&gt;&lt;/script&gt; &lt;script src="reveal.js/js/reveal.js"&gt;&lt;/script&gt; &lt;script&gt; //run reveal.js Reveal.initialize({ controls: true, progress: true, theme: Reveal.getQueryHash().theme || 'moon', transition: Reveal.getQueryHash().transition || 'slide', dependencies: [ { src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } } ] }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/28144316
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28219729
tagged with: jquery
favorite count: 0
tagged with: html-select
upvote count: 5
has body: I'm trying to integrate Rivets.JS into my app. I'm getting the hang of binding values for basic form inputs and regular data in the page, but I can't figure out how to handle selects drop (down menus) with Rivets. I can build a select with the each tag, like in this JSFiddle: http://jsfiddle.net/eimajenthat/94ca1xht/ But I want to bind the selected value in the menu to a model value (in my Fiddle, I would bind truck.job_id to the select). Here is my JS: $(document).ready(function(){ window.view = rivets.bind($('#contentWrap'),{ truck:{id:1,job_id:3}, jobs:[ {id:1,job_number:'thing1'}, {id:2,job_number:'thing2'}, {id:3,job_number:'thing3'}, {id:4,job_number:'thing4'}, ] }); }); Here is my HTML: &lt;div id="contentWrap"&gt; &lt;select&gt; &lt;option rv-each-job="jobs" rv-value="job.id"&gt;{ job.job_number }&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; Bonus points: all the select elements in my app are augmented with Chosen. This means whenever I change the options or the selection via JavaScript, I need to trigger an update to Chosen for users to see it, like this: $('#my-select').trigger('liszt:updated'); How do I trigger the code above whenever the model used for options (jobs in my Fiddle) is updated, or when the value of the select (trucks.job_id) is updated?
type: AnsweredQuestion
downvote count: 0
type: Question
score: 5
has answer: http://stackoverflow.com/a/28225355
accepted answer: http://stackoverflow.com/a/28225355
tagged with: javascript
tagged with: jquery-chosen
has title: How do I bind an HTML select to a model value in Rivets.JS?
answer count: 1
tagged with: rivets.js

http://stackoverflow.com/a/28220564
has comment: http://stackoverflow.com/comment/44804995
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28220455
has body: First argument of your function is event object. You should check keyCode property and chose following logic based on choise. https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onkeyup

http://stackoverflow.com/comment/44688129
type: QuestionComment
has text: @nix. It's the same as `ctrl-alt`. Do you want to discriminate between `ctrl-alt` and `altgr`?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28158262

cryptography
tags question: http://stackoverflow.com/q/28268895
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/28252990
tags question: http://stackoverflow.com/q/28157827
tags question: http://stackoverflow.com/q/28167253

http://stackoverflow.com/comment/44641971
type: QuestionComment
comment on: http://stackoverflow.com/q/28134887
type: Comment
has text: is there any other way?
score: 0

http://stackoverflow.com/q/28219561
tagged with: javascript
tagged with: meteor
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28230457
has title: How to fill a meteor collection with graphics and individually display them
type: Question
tagged with: jquery-ui
score: 0
has body: I am trying to add a feature that allows me to drag little graphics (think 20x20px) around a web page. There should be a list with all the icons and via clicking them and double-clicking the page background, copies can be generated on the page that are draggable. The dragging is done via jquery-ui and works. Now I am wondering how to get the images into the collection. What I want to do is have one collection to conveniently display all the available icons, and another one to handle the ones that are being worked with. Here is the template for the latter: &lt;template name="usedIcon"&gt; &lt;div draggable="true" class="draggableImageDiv" id="{{_id}}" style="position:absolute;left:{{left}};top:{{top}};"&gt; &lt;img src="{{imagePath}}" class="draggableImage" alt="test-image" /&gt; &lt;/div&gt; This works for a set image path. But now I intend to make an event handler for the availableIcon class that sets the image path in a certain variable upon clicking and then allows that variable to be used to insert a new object with the particular imagepath in the usedIcons collection. For that I need to first insert the paths into the availableIcons collection Is there a convenient way to populate the availableIcons collection with the imagePath variables? I was thinking doing it manually in a startup function, which isn't very elegant. CollectionsFS can probably do this better and also make this more elegant than using the paths but I don't have any Idea how to go about that.
answer count: 1

http://stackoverflow.com/comment/44730599
score: 0
comment on: http://stackoverflow.com/q/28180544
has text: Thanks for your response, the reason I have a div inside the label its because that's where the text (URL) is generated. This is also why an id, as it makes reference to a javascript function that generates the link (text) into the div
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28126289
has answer: http://stackoverflow.com/a/28126570
accepted answer: http://stackoverflow.com/a/28126570
possible better answer: http://stackoverflow.com/a/28126441
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28126441
has body: I know that JS inheritance has been discussed thoroughly, and I've got a couple of books on it myself, but I haven't found one that works with my current constructor pattern, and I'm not grasping the theory behind it. This is the object pattern I've used: MYAPP.Animal = function() { function Animal() { this.position = {x: 0, y: 0}; }; Animal.prototype.getPosition = function() { return this.position.x; }; return Animal; }(); MYAPP.Dog = function() { function Dog(param) { this.name = param.name; this.position.x = param.x; }; Dog.prototype.getName = function() { return this.name; }; return Dog; }(); var snoopy = new MYAPP.Dog({ name:"snoopy", x: 10 }); var slinky = new MYAPP.Dog({ name:"slinky", x: 20 }); I thought I'd cracked it but then it appeared as though the two dog's shared the same instance of Animal, and the first dog's position was overwritten by the second. Is inheritance possible with this approach? Thanks in advance EDIT: Looking for a vanilla JS solution
type: Question
has comment: http://stackoverflow.com/comment/44627919
tagged with: javascript
tagged with: inheritance
score: 0
has title: Can't find a JavaScript inheritance pattern that works
answer count: 3
has comment: http://stackoverflow.com/comment/44625751
has answer: http://stackoverflow.com/a/28126551

http://stackoverflow.com/comment/44709635
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28167313
has text: What if you ignore the div itself, all the images under that would automatically be discarded. `document.querySelectorAll("#parent div:not(.amazingDiv2) img")`

http://stackoverflow.com/comment/44679290
comment on: http://stackoverflow.com/q/28153017
type: QuestionComment
score: 0
has text: @user247326 I wasn't encouraging you to change it to a url, it was okay as it was, just checking that the power was on before trying to debug the os, as it were. check out `http://api.jquery.com/jquery.post/` the shorthand version of $.ajax for posting
type: Comment

http://stackoverflow.com/a/28236104
type: Answer
answers question: http://stackoverflow.com/q/28235969
has body: That code won't run anything. Assuming what comes back from that promise is a function body (as it's very unclear what you want to do), you can do something like this: var myPromise; MyService .send("req") .then(function(res) { myPromise = res(); });
score: 0

http://stackoverflow.com/comment/44728900
score: 0
type: AnswerComment
has text: Where is the jQuery script included in your markup. In the head? What order are the scripts instantiated? I saw you said after jquery ui, this is a jquery plugin it needs to be loaded after jquery, it extends jquery so the jquery object needs to be defined before the plugin is instantiated.
type: Comment
comment on: http://stackoverflow.com/a/28178154

http://stackoverflow.com/comment/44762682
score: 0
comment on: http://stackoverflow.com/q/28197846
type: QuestionComment
type: Comment
has text: store image url in same table as text is simplest approach

http://stackoverflow.com/comment/44742762
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28186849
has text: Your second example is a completely different issue. Please ask a new question.

http://stackoverflow.com/a/28214204
has body: The problem is that myFactory is not a module, so you cannot inject it the way you are trying to. describe('unit test here', function(){ var myFactory; beforeEach(module('myApp')); beforeEach(inject(function(_$controller_, _$rootscope_, _myFactory_) { //Now you can use myFactory in your specs.. myFactory = _myFactory;_ scope._$rootScope.$new(); testCtrl = _$controller_('testCtrl', { $scope:scope }) }) })
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28204683

http://stackoverflow.com/q/28234554
tagged with: hapi.js
tagged with: javascript
has answer: http://stackoverflow.com/a/28449726
accepted answer: http://stackoverflow.com/a/28449726
upvote count: 1
answer count: 1
downvote count: 0
favorite count: 0
tagged with: handlebars.js
has title: Display json data from helper module in hapijs using handlebars
type: AnsweredQuestion
score: 1
has body: I have a small hapijs app and want to display quotes in json format from a helper module but I can't display it. index.js: server.views({ engines: { html: require('handlebars') }, context: defaultContext, relativeTo: __dirname, path: './views', layoutPath: './views/layout', helpersPath: './views/helpers', partialsPath: './views/partials', layout: false, isCached: false }); server.route({ method: 'GET', path: '/quotes', handler: function (request, reply) { reply.view('quotes'); } }); quotes.html: Word of the day by {{{ quotes }}} {{{quotes}}} quotes.js: module.exports = function () { var quotes = [ { author: "Kobayashi Issa", text: "What a strange thing! to be alive beneath cherry blossoms." }, { author: "Kobayashi Issa", text: "Summer night-- even the stars are whispering to each other." }, { author: "Kobayashi Issa", text: "Never forget: we walk on hell, gazing at flowers." }, { author: "Kobayashi Issa", text: "Here I'm here- the snow falling." } ]; var id = Math.floor(Math.random() * quotes.length); return quotes[id].text; }; If I return quotes[id] I get 'Word of the day by [object Object]' in the browser. If I change the handlebar html to {{{ quotes.author }}} it is empty. Is there something in hapijs that require tweaks to handlebars? I tried to do a {{#each quotes}} ... {{/each}} but it does not loop. If I return JSON.stringify(quotes[id]); I get Word of the day by {"author":"Kobayashi Issa","text":"What a strange thing! to be alive beneath cherry blossoms."} I'm aware quotes is called twice. regards Claus
type: Question

http://stackoverflow.com/a/28159610
answers question: http://stackoverflow.com/q/28159446
has comment: http://stackoverflow.com/comment/44690952
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28159446
has body: It looks like $submitted doesn't exist in the version you're using. See the docs for 1.3.0-beta.8. This was added with version 1.3.0-beta.18

http://stackoverflow.com/comment/44737613
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28184263
has text: The width and padding of the bars? or the entire graph as a whole?
score: 0

http://stackoverflow.com/a/28226423
accepted answer of: http://stackoverflow.com/q/28226180
has body: What you have is not idiomatic angular. It is important to stick to conventions when working with angular. Anything that is connected to the DOM should be attached to the $scope object: angular.module('app.controllers', []) .controller("HeaderCtrl", function($scope) { $scope.HelpButtonVisible = false; $scope.HideHelpButton = function() { $scope.HelpButtonVisible = false; } $scope.ShowHelpButton = function() { $scope.HelpButtonVisible = true; } }); View: Help
answers question: http://stackoverflow.com/q/28226180
downvote count: 0
has comment: http://stackoverflow.com/comment/44816299
has comment: http://stackoverflow.com/comment/44816318
type: AcceptedAnswer
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44801768
comment on: http://stackoverflow.com/q/28218402
has text: @hindmost that would work to a certain level, but I prefer to remove the full-screen functionality than to have the window changing sizes all the time. It gets a bit frustrating and frustration is not something i want the users to feel when using my application.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/40336196
has body: Because .testimonial_wrapper is the element you're initializing the slick function on, and you're only saying to show one slide with: slidesToShow: 1, the slide with class col-md-4 will inherit the entire width of the .testimonial_wrapper element because you chose slidesToShow: 1. By nature, SlickJS handles everything with javascript which will overwrite Bootstraps CSS settings. I would propose one of two things: If you want the slider to have one slide and take up the size of a col-md-4 column then add a col-md-4 class to the .testimonial_wrapper element. Or You can have the slide show 3 slides at once (mimicking a col-md-4 class within in the slider) by declaring that property when calling the slick function/initializing the slider: slidesToShow: 3 In addition to this ^ - If you're interested in responsive breakpoints for your slider Slick has a way to handle that as well. You can look through their documentation for the responsive breakpoints settings.
score: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28233459
downvote count: 1

http://stackoverflow.com/comment/44719431
comment on: http://stackoverflow.com/a/28162309
score: 1
type: AnswerComment
type: Comment
has text: The library has a specific event for handling this.

http://stackoverflow.com/q/28194313
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has title: Kaazing, AngularJS & BasicChallengeHandler
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28209029
accepted answer: http://stackoverflow.com/a/28209029
has body: I'm trying to use the Kaazing Library in our HTML5 client. I already implemented it in a java client and it worked. It seems that there is a problem with the LoginHandler. When I debug the code it ends in a endless loop in the LoginHandler. The line callback(new PasswordAuthentication(usr, pwd)) is called over and over again: // Configure a Basic Challenge Handler var basicHandler = new BasicChallengeHandler(); basicHandler.loginHandler = function(callback) { callback(new PasswordAuthentication(usr, pwd)); } JmsConnectionProperties jmsProps = new JmsConnectionProperties(); jmsProps.connectionTimeout = 1000000; jmsProps.reconnectAttemptsMax = -1; jmsProps.reconnectDelay = 3000; jmsProps.shutdownDelay = 5000; console.log("Connect to: " + url); // Create Connection Factory jmsConnectionFactory = new JmsConnectionFactory(url, jmsProps); websocketFactory = jmsConnectionFactory.getWebSocketFactory(); websocketFactory.setChallengeHandler(basicHandler); // reate Connection future handler for the result try { if (connection == null) { var connectionFuture = jmsConnectionFactory.createConnection( function() { try { // never comes to this line!!! connection = connectionFuture.getValue(); // DO SOME STUFF } catch (e) { console.dir(e); // alert(e.message); } }); } else { try { connection.close(function() { /* Closed */ }); } finally { connection = null; } } } catch (ex) { console.dir(ex); } Any help would be very appreciated! Regards Angela
tagged with: kaazing
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/comment/44725378
type: QuestionComment
has text: Then good luck my friend ;)
score: 0
comment on: http://stackoverflow.com/q/28177139
type: Comment

http://stackoverflow.com/a/28165797
has body: Maybe it is good to know what setinterval does. So per example: var myInterval = setInterval(function() { //some code here } The value of the variable 'myInterval' is not a function as you might expect. The value is however an integer. So by setting off the interval again in your code this integer changes from (per example) 1 to 2. If you run do not clear the interval before you run it again, the only thing you will do is clearing the latest interval. The first one has not been cleared. Also be careful where you run an interval, before you know it you already have a couple of them running in your script.
answers question: http://stackoverflow.com/q/28165606
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44702261
has comment: http://stackoverflow.com/comment/44702000
downvote count: 0
score: 1

http://stackoverflow.com/comment/44712094
score: 0
type: Comment
type: QuestionComment
has text: issue in Your controller name
comment on: http://stackoverflow.com/q/28171453

http://stackoverflow.com/q/28200125
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/60710003
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28200971
tagged with: angularjs
type: UnansweredQuestion
has title: MouseEnter vs MouseOver in AngularJs
score: 19
upvote count: 19
tagged with: mouseevent
has body: I was playing with AngularJS mouse events and got into a problem. I know MouseEnter event is fired when mouse enters container of an element and there after MouseOver is fired for all child elements. Thanks to this animation Visualizing mouse events However turns out that in my case MouseEnter event is never fired. I am working on Angular PhoneCat application (step-10) and did following modifications: Controllers.js: Added a method to log mouse events phone-details.html: Added ng-mouseenter and ng-mouseleave handlers $scope.logMouseEvent = function() { switch (event.type) { case "mouseenter": console.log("Hey Mouse Entered"); break; case "mouseleave": console.log("Mouse Gone"); break; default: console.log(event.type); break; } &lt;ul class="phone-thumbs"&gt; &lt;li ng-repeat="img in phone.images"&gt; &lt;img ng-src="{{img}}" ng-Click="setImage(img)" ng-mouseenter="logMouseEvent()" ng-mouseleave="logMouseEvent()"&gt; &lt;/li&gt; &lt;/ul&gt; Result: Only mouseover and mouseout event being logged Question: Is this behavior happening because images are ul element and we are moving mouse in child elements? and How can I get mouseenter event on image? Thank you
linked to: http://stackoverflow.com/q/7286532
type: Question

http://stackoverflow.com/comment/44710762
type: Comment
comment on: http://stackoverflow.com/a/28157939
type: AnswerComment
has text: @Martijn: I get that jQueryUI would be overkill for this. I just wanted to point out that the functionality existed, just not in the plugin he was using. `$.animate()` is the typical choice for this kind of thing.
score: 0

http://stackoverflow.com/comment/44928583
score: 0
type: Comment
has text: find duplicate question http://stackoverflow.com/questions/28205278/twitter-widgets-js-throws-javascript-error-expected-identifier-on-ie8
type: QuestionComment
comment on: http://stackoverflow.com/q/28178051

http://stackoverflow.com/a/28188756
type: Answer
has body: You could replace the default browser tooltips with the jquery version: $('*').tooltip({track: true}); Then you could set the tooltips to be disabled while you drag your elements: $('.thumbnail').tooltip('disable'); On drop, enable them again: $('.thumbnail').tooltip('enable'); http://jsfiddle.net/uHuDp/1/ Edit: for your example: $(element).find("span.item-outer").uitooltip('disable'); $(element).find("span.item-outer").uitooltip('enable'); http://jsfiddle.net/uHuDp/260/
has comment: http://stackoverflow.com/comment/44823588
has comment: http://stackoverflow.com/comment/44855756
answers question: http://stackoverflow.com/q/28188376
score: 0

find
tags question: http://stackoverflow.com/q/28161150
type: Tag
tags question: http://stackoverflow.com/q/28222832
tags question: http://stackoverflow.com/q/28133766
tag name: find

http://stackoverflow.com/q/28187950
linked to: http://stackoverflow.com/q/3224834
has comment: http://stackoverflow.com/comment/44749984
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44744226
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28191523
has title: How to Change color of a text after a time period?
linked to: http://stackoverflow.com/q/17320399
has answer: http://stackoverflow.com/a/28191140
type: Question
has body: I have created a notice board. I want to show the notices in Red color for the first 48 hours. After 48 hour the color of the Notices will be changed. Now what should i change or add in my code? HTML body for the notice board - Notice Board <%-- --%> JQuery/JavaScript - $(document).ready(function () { PageMethods.loadNotice('', loadNoticeSuccess); }); function loadNoticeSuccess(result) { $("#dvNotice").html(''); var html = ""; for (var i = 0; i < result.length; i++) { var month_value = result[i].PublishedDate.getMonth(); var day_value = result[i].PublishedDate.getDate(); html += " "; html += " " + months[month_value] + "" + day_value + " "; //html += " " + result[i].Title + " " + result[i].Description + " "; html += " " + result[i].Title + " "; } html += " More "; $("#dvNotice").append(html); } C# Code Behind for loading the notice board - [WebMethod] public static List<Notice> loadNotice(string value) { IList<Notice> notice = NoticeManager.GetTopPublishedNotice(); if (notice == null) { notice = new List<Notice>(); } return notice.ToList(); }
tagged with: c#
has answer: http://stackoverflow.com/a/28188535

http://stackoverflow.com/q/28267256
downvote count: 1
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/54091007
has comment: http://stackoverflow.com/comment/44890660
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/54091007
has body: I'm trying to move an element when when the user clicks on the document, however, the element is moving to an offset position. How do I remove the offset when clicking? I'm trying to get the element to move to the exact position of the mouse, how do I do this? Would I need to use the .offset() function? If so, how would I do that? HTML Player Name: Submit JS $(document).ready(function(){ $(this).on("click", function(e){ var x = e.pageX; var y = e.pageY; $("#meh").css("marginLeft", x); $("#meh").css("marginTop", y); }) })
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: How to move an element to the mouse position
favorite count: 0
has comment: http://stackoverflow.com/comment/44890765
has answer: http://stackoverflow.com/a/28267300
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28267300
has answer: http://stackoverflow.com/a/28267302

http://stackoverflow.com/comment/44628563
has text: It is a good hint but what I want is a bit different. Although is a good solution and if I can't find an answer I will try it. Thanks again.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28126772
score: 0

http://stackoverflow.com/a/28221731
answers question: http://stackoverflow.com/q/28221566
has comment: http://stackoverflow.com/comment/44807322
has body: require : 'ngModel' link:function (scope, element, attrs, model) {
score: 0
type: Answer

http://stackoverflow.com/a/40022063
answers question: http://stackoverflow.com/q/28251886
score: 2
upvote count: 2
downvote count: 0
has body: as the name says, "beforeEach" runs before-each-test, you should use "before"
type: Answer

http://stackoverflow.com/comment/44786505
type: QuestionComment
has text: Try to set [staggerLines](http://api.highcharts.com/highmaps#xAxis.labels.staggerLines) as 1.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28195267

model-view-controller
tags question: http://stackoverflow.com/q/28196005
tags question: http://stackoverflow.com/q/28277292
tag name: model-view-controller
tags question: http://stackoverflow.com/q/28274417
tags question: http://stackoverflow.com/q/28177110
tags question: http://stackoverflow.com/q/28209311
tags question: http://stackoverflow.com/q/28239416
tags question: http://stackoverflow.com/q/28159244
tags question: http://stackoverflow.com/q/28272026
tags question: http://stackoverflow.com/q/28153954
type: Tag
tags question: http://stackoverflow.com/q/28276404

http://stackoverflow.com/a/28204475
score: 5
upvote count: 5
downvote count: 0
has body: Emscripten output is a flat script. That means if it is in the global scope, it uses global variables. To have multiple scripts, just put each one inside a function, so all the variables now have function local scope, and the global scope is not polluted. Something like this: function moduleOne() { var Module = { }; // add and Module adjustments here, or leave empty // .. emscripten output for this module // return Module; // will have exported functions added to it } var m1 = moduleOne(); Module is necessary because if it isn't defined, emscripten will define it (globally).
answers question: http://stackoverflow.com/q/28193171
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28193171
type: Answer
has comment: http://stackoverflow.com/comment/46072148
has comment: http://stackoverflow.com/comment/44799298

http://stackoverflow.com/a/28138081
downvote count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/44657294
type: Answer
has body: You can, but you don't need to use directives to make this work nice. You could use ng-styleor just $scopelike the following example will show you. This Demo shows you, how easy make a "toggle" work in AngularJS by using directives. var OfficeUIRibbon = angular.module('OfficeUIRibbon', []); OfficeUIRibbon.directive('officeActiveStyle', function () { return { restrict: 'A', link: function (scope, element, attr) { scope.$watch(function() { officeUiRibbonActiveHexColor = '#f700ff'; }); } }; }); /** * CSS Hex color holder * @type {string} * @global */ var officeUiRibbonActiveHexColor = '#ff0000'; /** * Active holder * @type {boolean} * @global */ var officeUiRibbonActiveToggle = false; // Defines the AngularJS 'OfficeUIRibbon' controller. OfficeUIRibbon.controller('OfficeUIRibbon', ['$scope', '$http', '$animate', function($scope, $http, $animate) { $scope.toggle = function () { officeUiRibbonActiveToggle = officeUiRibbonActiveToggle ? false : true; //switch active state } $scope.getStyles = function () { if (officeUiRibbonActiveToggle) { return officeUiRibbonActiveHexColor; } } }]); HTML-Template: Dit is een demo Toggle Solution 2 Optional: This is an other Demo. This demo shows you, how easy make a "toggle" work in angularjs without using directives. var OfficeUIRibbon = angular.module('OfficeUIRibbon', []) OfficeUIRibbon.controller('OfficeUIRibbon', ['$scope', '$http', '$animate', function($scope, $http, $animate) { /** * Active state holder * @type {boolean} */ var active = false; /** * Holds css color hex code * @type {string} */ var color = '#ff0000'; /** * Check active scope */ $scope.toggleShow = function () { active = !active; //switch true false in the coolest way ;) } /** * Check active scope */ $scope.giveColor = function () { if (active) { return color; } } }]); Your HTML-Template: Dit is een demo Toggle
score: 3
answers question: http://stackoverflow.com/q/28138008
accepted answer of: http://stackoverflow.com/q/28138008
type: AcceptedAnswer

http://stackoverflow.com/comment/88570403
has text: This can help - https://stackoverflow.com/a/14544497/104380
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28194166

http://stackoverflow.com/q/28221114
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28223566
tagged with: javascript
tagged with: angularjs
tagged with: mathquill
favorite count: 0
has body: The problem is, I'm using angularjs ng-include to load partial, and mathquill box is in the partial, if I put &lt;script src="/MathQuill/mathquill.js"&gt;&lt;/script&gt; in the partial view, it works fine, but I will get a warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. If I put &lt;script src="/MathQuill/mathquill.js"&gt;&lt;/script&gt; in the main view, after loading partial, mathquill doesn't work at all, so is this the rendering problem? How do I re-render the partial view? Or if it's not, how do I solve it?
downvote count: 0
type: AnsweredQuestion
has title: How do I rerender mathquill.js?
score: 1
accepted answer: http://stackoverflow.com/a/28223566
type: Question

http://stackoverflow.com/q/28155841
has title: Mysterious failure of jQuery.each() and Underscore.each() on iOS
has comment: http://stackoverflow.com/comment/46971934
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/44686760
tagged with: jquery
has answer: http://stackoverflow.com/a/28414133
has body: A brief summary for anyone landing here from Google: There is a bug in iOS8 (on 64-bit devices only) that intermittently causes a phantom "length" property to appear on objects that only have numeric properties. This causes functions such as $.each() and _.each() to incorrectly try to iterate your object as an array. I have filed an issue report (really a workaround request) with jQuery (https://github.com/jquery/jquery/issues/2145), and there is a similar issue on the Underscore tracker (https://github.com/jashkenas/underscore/issues/2081). Update: This is a confirmed webkit bug. A fix was comitted on 2015-03-27, but there is no indication as to which version of iOS will have the fix. See https://bugs.webkit.org/show_bug.cgi?id=142792. Currently iOS 8.0 - 8.3 are known to be affected. Update 2: A workaround for the iOS bug can be found in jQuery 2.1.4+ and 1.11.3+ as well as Underscore 1.8.3+. If you're using any of these versions, then the library itself will behave properly. However, it's still up to you to ensure that your own code isn't affected. This question can also be called: "How can an object without a length have a length?" I'm having a twilight zone kind of issue with mobile Safari (seen on both iPhones and iPads running iOS 8). My code has a lot of intermittent failures using the "each" implementation of both jQuery ($.each()) and Underscore (_.each()). After some investigation, I discovered that in all cases of failure, the each function was treating my object as an array. It would then try to iterate it like an array (obj[0], obj[1], etc.) and would fail. Both jQuery and Underscore use the length property to determine if an argument is an object or an array/array-like collection. For example, Underscore uses this test: if (length === +length) { ... this is an array My objects had no length parameter, yet they were triggering the above if statements. I double validated that there was no length by: Sending the value of obj.length to the server for logg…
has answer: http://stackoverflow.com/a/29382690
has comment: http://stackoverflow.com/comment/44683326
has comment: http://stackoverflow.com/comment/44701589
has comment: http://stackoverflow.com/comment/51416588
upvote count: 24
has answer: http://stackoverflow.com/a/28600712
favorite count: 0
linked to: http://stackoverflow.com/q/26044056
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44683184
has comment: http://stackoverflow.com/comment/46951379
has comment: http://stackoverflow.com/comment/46313985
has answer: http://stackoverflow.com/a/30778615
has comment: http://stackoverflow.com/comment/45126606
has comment: http://stackoverflow.com/comment/46941384
has comment: http://stackoverflow.com/comment/51399224
has answer: http://stackoverflow.com/a/31741387
has comment: http://stackoverflow.com/comment/45081906
downvote count: 0
tagged with: underscore.js
tagged with: mobile-safari
score: 24
has comment: http://stackoverflow.com/comment/44683315
has comment: http://stackoverflow.com/comment/44682966
type: Question
has comment: http://stackoverflow.com/comment/44736945
has comment: http://stackoverflow.com/comment/44683301

http://stackoverflow.com/comment/44692889
score: 0
type: Comment
has text: hmmm clever. What would the best way to go about eliminating any sign it is a hyperlink?
type: AnswerComment
comment on: http://stackoverflow.com/a/28160779

http://stackoverflow.com/q/28159370
has answer: http://stackoverflow.com/a/70049715
tagged with: knockout.js
accepted answer: http://stackoverflow.com/a/28159445
type: AnsweredQuestion
score: 3
has body: We have a select menu that is being populated via data- attributes and a knockout.js array. I'm not so familiar with jQuery as well, keep this in mind. How could I add an option via jQuery that is the first selected one and it's disabled as well. Basically, it's being used as a placeholder. I know how to do this via HTML, but not in this way. Here is the HTML that is being used: &lt;select id="delemilter" data-bind="options: delimiterList, value: delimiterSelectedValue, optionsValue: 'value', optionsText: 'name', enable: true"&gt;&lt;/select&gt; In other select menus, one of our developers used this line of jQuery. Seems to be some knockout API stuff. Looks like an observable array: self.selectMenuID.push({ value: 'Placeholder Text', key: 0, data: 0, disabled: true }); Can't figure out how to reuse this again... Hopefully this is enough information. Thank you!
tagged with: javascript
type: Question
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Add disabled selected option in select menu via jQuery
has answer: http://stackoverflow.com/a/28159445
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/70049715
upvote count: 3

http://stackoverflow.com/comment/44714116
type: Comment
type: QuestionComment
has text: Take a look here: use the lastIndexOf on 'x' and use the substring method. http://www.w3schools.com/jsref/jsref_obj_string.asp
comment on: http://stackoverflow.com/q/28172505
score: 0

http://stackoverflow.com/a/28236844
has body: You have several ways to do it with jQuery. For example: function showhide() { $('#mapsec').slideToggle(200); } This will slide the div open or closed. 200 is the speed of the animation in miliseconds. Check these out: $('#mapsec').toggle(200); &mdash; jQuery.toggle() $('#mapsec').slideToggle(200); &mdash; jQuery.slideToggle() $('#mapsec').fadeToggle(200); &mdash; jQuery.fadeToggle()
has comment: http://stackoverflow.com/comment/113571706
upvote count: 5
answers question: http://stackoverflow.com/q/28236608
score: 5
downvote count: 0
type: Answer

loops
tags question: http://stackoverflow.com/q/28138095
tags question: http://stackoverflow.com/q/28261128
tags question: http://stackoverflow.com/q/28136542
tags question: http://stackoverflow.com/q/28125830
tags question: http://stackoverflow.com/q/28224624
tags question: http://stackoverflow.com/q/28279770
tags question: http://stackoverflow.com/q/28160142
tags question: http://stackoverflow.com/q/28243869
type: Tag
tags question: http://stackoverflow.com/q/28215369
tags question: http://stackoverflow.com/q/28274967
tags question: http://stackoverflow.com/q/28126759
tags question: http://stackoverflow.com/q/28228886
tags question: http://stackoverflow.com/q/28155376
tags question: http://stackoverflow.com/q/28135489
tag name: loops
tags question: http://stackoverflow.com/q/28201504
tags question: http://stackoverflow.com/q/28226725
tags question: http://stackoverflow.com/q/28273039
tags question: http://stackoverflow.com/q/28129409
tags question: http://stackoverflow.com/q/28201951
tags question: http://stackoverflow.com/q/28268635
tags question: http://stackoverflow.com/q/28131409
tags question: http://stackoverflow.com/q/28264836

http://stackoverflow.com/q/28140181
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44681961
upvote count: 1
has comment: http://stackoverflow.com/comment/44705742
has answer: http://stackoverflow.com/a/28179682
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44656013
has comment: http://stackoverflow.com/comment/44681546
accepted answer: http://stackoverflow.com/a/28179682
downvote count: 1
type: Question
tagged with: gmaps.js
has comment: http://stackoverflow.com/comment/44661553
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44684772
tagged with: javascript
has title: How to get polygon properties when a marker is placed on it
tagged with: google-maps-api-3
has body: Using google map Drawing Manager user draws the polygon .I want to get polygon properties(title,paths,..) when a marker(marker from drawing manager) is placed on it. Here I want to know how to get the properties of the polygon(title, paths) and then like to it in a variable. code : Get Latitude and Longitude Coordinates of a Polygon - Google Maps API v3 It would be fine to show a alert message of the polygon properties When I place the marker on it. Hope There will be possible for this. jsfiddle
score: 0

http://stackoverflow.com/comment/44921528
has text: fwiw video.js does not duplicate ids. You'd end up with ` `
comment on: http://stackoverflow.com/a/28274928
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/28157141
type: Answer
upvote count: 1
has body: This seems like a good use case for localStorage: document.querySelector('#color').addEventListener('change', function () { document.body.style.background = this.value; localStorage.setItem('appColor', this.value); }); document.body.style.background= localStorage.getItem('appColor'); See this Fiddle. Each time you choose a color, it's remembered and will be the default color the next time you run it. Side note: You can simplify this: this.options[this.selectedIndex].value; &hellip; to this: this.value;
score: 1
has comment: http://stackoverflow.com/comment/44686715
accepted answer of: http://stackoverflow.com/q/28156835
downvote count: 0
answers question: http://stackoverflow.com/q/28156835
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44686646

http://stackoverflow.com/comment/44751045
comment on: http://stackoverflow.com/a/28191889
score: 0
type: AnswerComment
type: Comment
has text: If it's in the frontend salting the encryption is useless since the attacker would be able to see the salt key. Encoding to B64 only obfuscates the code, I already know that.

http://stackoverflow.com/comment/44770857
type: QuestionComment
comment on: http://stackoverflow.com/q/28202056
has text: @EvanTrimboli `loadRecord` returns an error when loading the result of `getValues`
score: 0
type: Comment

http://stackoverflow.com/q/28156622
has comment: http://stackoverflow.com/comment/44689103
type: Question
has comment: http://stackoverflow.com/comment/44684944
upvote count: 1
has comment: http://stackoverflow.com/comment/44685196
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44685587
has title: file_put_contents empties when large image data uri is sent
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: file
has comment: http://stackoverflow.com/comment/44685047
tagged with: php
has body: Hi I use file_put_contents() in PHP to write/edit HTML contents of a remote HTML file. This works fine when I'm sending just HTML syntax/tags. and it also works fine while sending small size data uri images (eg:- &lt;img src="data: image/png;base64,iVBORw0KGg......."/&gt;) inside the code. But when the image size is more than 100kb. The remote HTML page becomes empty. May I know whats the reason for this? Is there a size limit while writing files in file_put_contents()? Following is my code for writing the HTML file: $info = file_get_contents("path/to/page/$page"); //here i'm searching for &lt;!-- container begin --&gt; comment jsut to replace them with the posted data $replaced = preg_replace('|(&lt;!\-\- container begin \-\-&gt;.*&lt;!\-\- container end \-\-&gt;)|isU','&lt;!-- container begin --&gt;'. (string) $_POST['content'].'&lt;!-- container end --&gt;', $info); //after replacing i'm insering/replacing the whole code in the html file file_put_contents("path/to/page/$page", $replaced); the $_POST['content'] is sent through ajax. edit:- when i send a large file for the first time it works good. but when i send the same data again, it is again empty.
has comment: http://stackoverflow.com/comment/44685457
score: 1
has comment: http://stackoverflow.com/comment/44711825
has comment: http://stackoverflow.com/comment/44685026

http://stackoverflow.com/a/28146745
has comment: http://stackoverflow.com/comment/44669627
has comment: http://stackoverflow.com/comment/44670223
has comment: http://stackoverflow.com/comment/44681229
has comment: http://stackoverflow.com/comment/44665403
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44665506
downvote count: 0
has comment: http://stackoverflow.com/comment/44682449
type: Answer
has comment: http://stackoverflow.com/comment/44669699
has body: Addressing your specific issue The behavior of the promise constructor is well defined both in ES6 promises and promise implementations that implement the constructor spec (virtually everything except old jQuery): var p = new Promise(function(resolve, reject){ // ALWAYS runs synchronously console.log("Hello"); }); console.log("World"); // program always logs "Hello World", events will never be missed This is well specified and by design. The use case you are describing is mostly why this behavior was guaranteed to work in the spec. Note that while the promise constructor is specified to run synchronously you still have a race condition with the then - http://jsfiddle.net/vko4p6zz/ I don't think promises are the correct abstraction here (see jfriend00's answer) but it might make sense with more context - you can rely on the execution order of the promise constructor. You can see this in the specification - new Promise then calls InitializePromise which in turn synchronously calls the function passed. A possibly better approach. Just like a promise represents a single value + time, there is an abstraction called an observable that represents multiple values + time. Just like a promise is a functional callback an observable is a functional event emitter. Here is an example using one library (RxJS) - there are several other libraries implementing the concept: var messageStream = Rx.Observable.fromEvent(window, 'message'); messageStream.subscribe(function(value){ console.log(value); // unwrapping the event }); In addition to unwrapping with subscribe - you can also map events, filter them, flatMap them and more - they compose just like promises and are as close as I think you can/should get to promises in this context.
has comment: http://stackoverflow.com/comment/44686208
has comment: http://stackoverflow.com/comment/44665309
score: 4
has comment: http://stackoverflow.com/comment/44668694
has comment: http://stackoverflow.com/comment/44669339
has comment: http://stackoverflow.com/comment/44665322
has comment: http://stackoverflow.com/comment/44665486
has comment: http://stackoverflow.com/comment/44668764
accepted answer of: http://stackoverflow.com/q/28146276
upvote count: 4
has comment: http://stackoverflow.com/comment/44666007
has comment: http://stackoverflow.com/comment/44951329
has comment: http://stackoverflow.com/comment/44665566
has comment: http://stackoverflow.com/comment/44665907
answers question: http://stackoverflow.com/q/28146276
has comment: http://stackoverflow.com/comment/44665758
has comment: http://stackoverflow.com/comment/44682917

http://stackoverflow.com/a/28238399
has comment: http://stackoverflow.com/comment/44839374
has comment: http://stackoverflow.com/comment/44838858
has comment: http://stackoverflow.com/comment/44838754
has comment: http://stackoverflow.com/comment/44842130
score: 4
upvote count: 4
downvote count: 0
has body: You could set an id to the dropdown you want to have this behavior and then make the selection based in the id. Something like this: &lt;ul id="dropdownId" class='dropdown-menu' role='menu' aria-labelledby='dLabel'&gt; $("#dropdownId").hover( function(){ $(this).addClass('open') }, function(){ $(this).removeClass('open') } );
answers question: http://stackoverflow.com/q/28238377
has comment: http://stackoverflow.com/comment/44838084
type: Answer
has comment: http://stackoverflow.com/comment/44842386
has comment: http://stackoverflow.com/comment/44842907

http://stackoverflow.com/a/28261416
has comment: http://stackoverflow.com/comment/44893043
has comment: http://stackoverflow.com/comment/44893517
has comment: http://stackoverflow.com/comment/44880001
has comment: http://stackoverflow.com/comment/44892584
has comment: http://stackoverflow.com/comment/44893076
has comment: http://stackoverflow.com/comment/44893206
downvote count: 0
has comment: http://stackoverflow.com/comment/44892706
has comment: http://stackoverflow.com/comment/44892484
has comment: http://stackoverflow.com/comment/44892971
has comment: http://stackoverflow.com/comment/44892412
has comment: http://stackoverflow.com/comment/44893009
has comment: http://stackoverflow.com/comment/44893141
has comment: http://stackoverflow.com/comment/44892086
has comment: http://stackoverflow.com/comment/44893422
answers question: http://stackoverflow.com/q/28261307
has comment: http://stackoverflow.com/comment/44893544
has comment: http://stackoverflow.com/comment/44892986
has comment: http://stackoverflow.com/comment/44892251
has comment: http://stackoverflow.com/comment/44892530
has comment: http://stackoverflow.com/comment/44886402
type: Answer
has comment: http://stackoverflow.com/comment/44893345
has comment: http://stackoverflow.com/comment/44892625
score: 2
has body: If you want to have it executed for all AJAX calls in your document you need something like this: $(document).on("ajax:success", "form[data-remote]", function(e, data, status, xhr) { $('html').scrollTop(0); }); In the example above when a form element with a data attribute called data-remote sends an AJAX call and the call succeeds the function is executed. Read more about on here. Another example from jQuery Documentation but this time with ajaxSuccess: $(document).ajaxSuccess(function() { $( ".log" ).text( "Triggered ajaxSuccess handler." ); }); Yet another example from the docs but this time with appending the callback directly to the ajax function: var jqxhr = $.ajax( "example.php" ) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "complete" ); });
has comment: http://stackoverflow.com/comment/44893605
upvote count: 2
has comment: http://stackoverflow.com/comment/44893181
has comment: http://stackoverflow.com/comment/44893225
has comment: http://stackoverflow.com/comment/44892419
has comment: http://stackoverflow.com/comment/44893161
has comment: http://stackoverflow.com/comment/44880228
has comment: http://stackoverflow.com/comment/44892376

http://stackoverflow.com/q/28252703
downvote count: 0
answer count: 1
favorite count: 0
has body: I want to bind a event handler to multiple components in React. Now I set className to every component and use event.currentTarget.className to determine which component triggers the handler. handleClick: function (e) { var className = e.currentTarget.className; if (className === "longComment") { this.setState({showLongComment: !this.state.showLongComment}); } else { this.setState({showShortComment: !this.state.showShortComment}); } }, render: function () { var topic = this.props.topic; var shortComment = this.state.showShortComment ? '[-]' : '[+]'; var longComment = this.state.showLongComment ? '[--]' : '[++]'; return ( &lt;li className="topic"&gt; &lt;div className="title"&gt; &lt;a target="_blank" href={api}&gt; {this.props.children.toString()} &lt;/a&gt;&amp;nbsp; &lt;span className="longComment" onClick={this.handleClick}&gt; {longcomment} &lt;/span&gt; &lt;span className="shortComment" onClick={this.handleClick}&gt; {shortcomment} &lt;/span&gt; &lt;/div&gt; {this.state.showLongComment ? &lt;CommentList url={url} /&gt; : null} {this.state.showShortComment ? &lt;CommentList url={url} /&gt; : null} &lt;/li&gt; ); } Is there any native way in React to know which component triggers the event handler?
accepted answer: http://stackoverflow.com/a/28253198
has title: How to determine which component triggers the event handler in React?
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: reactjs
tagged with: javascript
has answer: http://stackoverflow.com/a/28253198

http://stackoverflow.com/comment/44691288
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28159937
type: Comment
has text: With this approach you would create an Interval after every 2 sec

http://stackoverflow.com/comment/44715622
type: Comment
has text: @Ruddy - How about a pure JavaScript solution?
comment on: http://stackoverflow.com/q/28172955
score: 0
type: QuestionComment

http://stackoverflow.com/a/33521605
has body: Not played around with Chart.js in the environment you described, but I would make sure your data specifies the color property in each data point.
answers question: http://stackoverflow.com/q/28241516
score: 0
type: Answer

http://stackoverflow.com/q/28122339
has answer: http://stackoverflow.com/a/28122362
possible better answer: http://stackoverflow.com/a/28122399
upvote count: 1
has answer: http://stackoverflow.com/a/28122399
favorite count: 0
tagged with: php
has title: Why is Javascript event handler changing my PHP variable?
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: dom
type: Question
accepted answer: http://stackoverflow.com/a/28122362
tagged with: javascript
has body: I have a webpage(page1.php) form that posts to another PHP page(page2.php) with an access login form. I am trying to auto insert 2 of the $_POST variables into the access login form. The process on page2.php is as follows: // assign the $_POST variables. $number = $_POST['number']; $accessCode = $_POST['accessCode']; // quick check of the data type of $number printf('Number: ' . $number . ' - ' . gettype($number) . ' data type &lt;br /&gt;'); // The access login form... printf('&lt;form&gt;'); printf('Number &lt;input name="practiceNumber" id="practiceNumber" /&gt;&lt;br /&gt;'); printf('Access Code &lt;input name="practiceCode" id="practiceCode" /&gt;'); printf('&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;'); //outside the &lt;/php ?&gt; tags, the JavaScript to auto insert the values after 3 secs... &lt;script type="text/javascript"&gt; var myVar=setInterval(function () {myTimer()}, 3000); function myTimer() { document.getElementById("practiceNumber").value = &lt;?php echo $number); ?&gt;; document.getElementById("practiceCode").value = &lt;?php echo $accessCode; ?&gt;; } &lt;/script&gt; &lt;/php // quick check to see if the data type of $number has changed printf('Number: ' . $number . ' - ' . gettype($number) . ' data type &lt;br /&gt;'); The browser output inserts the values into the form fields, but changes the string $number '5021251000801111111' to '5021251000801111000'. Why is the string $number '5021251000801111111' changed too '5021251000801111000' when using JavaScript to insert the value?
answer count: 2

http://stackoverflow.com/comment/44863927
type: AnswerComment
comment on: http://stackoverflow.com/a/28252180
has text: Does the function I added help? Pass it the yyyy-mm-dd format value and it returns the corresponding dd-M-yy
type: Comment
score: 0

http://stackoverflow.com/q/28142761
type: Question
has body: I am writing a JSON exporter but am having issues saving out color information for the vertices of my mesh objects. Here is what the output of an isocahedron looks like: https://gist.github.com/fraguada/69d523af7f75049db39e Here is an image describing what I see in the program used to create the object (left) and in the threejs editor (right): https://i.sstatic.net/7TCCF.jpg If I would have to guess the issue, I'd say it is the way I am passing the color to JSON. I get access to the RGB values of each mesh vertex and convert the values to an int: public int ColorToInt(Color color) { string c = color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2"); return Convert.ToInt32(c, 16); } Checking the color output, things seem ok. The first vertex color I process on this model is 127,255,0 (R,G,B,) which translates to 8388352 or 7fff00. I assume I need the 8388352 representation in the JSON file as this is the format used in the examples I've looked at. Based on the JSON file, is there anything obvious that would make the vertex colors not work in the threejs editor? I've tried some other files (not generated by my exporter) and they all have the vertex colors showing. Thanks.
tagged with: c#
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44663912
tagged with: javascript
score: 0
tagged with: 3d
has comment: http://stackoverflow.com/comment/44666018
has comment: http://stackoverflow.com/comment/44661348
has title: three.js JSON Model Vertex Colors not shown in editor
tagged with: three.js
has comment: http://stackoverflow.com/comment/44663987
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44898670
has text: i got it working. other features like tooltip and hover is not showing up.
comment on: http://stackoverflow.com/a/28218380
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28260839
tagged with: http://stackoverflow.com/tag/html
tagged with: templates
has comment: http://stackoverflow.com/comment/44896000
has answer: http://stackoverflow.com/a/28260988
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44886979
has comment: http://stackoverflow.com/comment/44879089
has title: Polymer, template won't evaluate true and bind
has comment: http://stackoverflow.com/comment/44896413
type: Question
tagged with: polymer
accepted answer: http://stackoverflow.com/a/28260988
answer count: 1
tagged with: javascript
has body: Using polymer I am very simply trying to evaluate wether an object property is a specific value, and if so bind the contents of truthy template to the dom. I have: working Also tried, == "message". The template DOES bind if asked to evaluate a boolean expression, and {{response.data.detail}} displays the correct text. I have tried this in two separate elements (starting from scratch) and the problem persists, can anyone tell me what I am clearly overlooking? Also tried passing to a helper function,, and the function is never called.
score: 0
tagged with: web-component

http://stackoverflow.com/comment/44930907
comment on: http://stackoverflow.com/q/28278476
score: 0
type: Comment
type: QuestionComment
has text: It gets a bits restrictive with NVD3, you can use plain d3 for this. Have a look at this [example](http://bl.ocks.org/d3noob/e34791a32a54e015f57d)

http://stackoverflow.com/a/28261745
type: Answer
has comment: http://stackoverflow.com/comment/44882945
has comment: http://stackoverflow.com/comment/44883013
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44883405
has comment: http://stackoverflow.com/comment/44883501
has body: Your selector is wrong. You mean to use form[name="login-form"]. You initial selector is actually equal to form[id="login-form"], because # is the id selector. Note that you use the fillSelectors function, so you need to use actual selectors to find the fields. Since this is angularjs, you might also need to wait for the form to appear. Full code: casper.start('http://localhost:3000/#/login'); casper.waitForSelector('form[name="login-form"] input[name="emailId"]', function() { this.fillSelectors('form[name="login-form"]', { 'input[name="emailId"]': 'test@gmail.com', 'input[name="passwordId"]': 'test123' }, false); }); casper.run(function() { this.echo(this.getHTML()); this.echo('message sent').exit(); }); Also note that the step which contains evaluateOrDie isn't doing anything useful. You don't use the argument that you pass into the page context and you don't use the value that you return from the page context.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28261569
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28261569

http://stackoverflow.com/q/28273389
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28277416
score: 0
has comment: http://stackoverflow.com/comment/44908860
has comment: http://stackoverflow.com/comment/44905305
has body: DEMO:HERE I am using raphael js in my application. Here I need to re-arrange element order on paper. I want to move back or front element one place at a time. I tried Using toFront() and toBak(), but it moves to the end or top of paper. I just want to move 1 position. UPDATE: I am trying to find a solution for, overlapping elements. I mean Suppose I add 2 elements on paper and drag 1 element over another element. Than is there way to find that second element is over element 1. e.g-> suppose I have Rect, circle, rect2 in my paper. I want to move rect2 to the position of circle and vise versa. I am not getting a way to do this in RaphaelJS. There are two methods,element.prevandelement.nex`t. I tried using them, but not able to understand how to use them. CODE: Click on rectangle Back JS: var paper = Raphael("editor", 635,500), canvas= document.getElementById('editor').style.backgroundColor='gray'; r1 = paper.rect(80,40,250,80,5) r2 = paper.rect(180,80,290,80,5) r3 = paper.rect(120,140,200,80,5) r1.attr({ fill:'red', }); r2.attr({ fill:'blue', }); r3.attr({ fill:'green', }); ft= paper.freeTransform(r1,{draw:['bbox'], rotate: true,keepRatio:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides'], scale:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides' ]}); ft= paper.freeTransform(r2,{draw:['bbox'], rotate: true,keepRatio:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides'], scale:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides' ]}); ft= paper.freeTransform(r3,{draw:['bbox'], rotate: true,keepRatio:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides'], scale:[ 'axisX', 'axisY', 'bboxCorners', 'bboxSides' ]}); var moveBack = function () { r2.toBack(); }
has title: How to move element front and back?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44905026
accepted answer: http://stackoverflow.com/a/28277416
tagged with: raphael

http://stackoverflow.com/comment/44694031
comment on: http://stackoverflow.com/a/28160996
score: 0
type: AnswerComment
type: Comment
has text: Yes but using a native element that isn't fully supported isn't a great answer. My code works on all browsers and a simple message like the label above my input and a sample placeholder should tell the user enough. The OP couldn't however get it to work with Knockout. That's a shame.

http://stackoverflow.com/comment/44841512
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28224637
type: Comment
has text: Thank you Ryan ... this works but even though it does hide the content, the space where the content is still present, where .toggle actually saves space.

http://stackoverflow.com/comment/44678026
type: Comment
score: 0
has text: Thanks allot Zeratops, the validation is the most important. The textarea needs to be filled with at least 1 character. Else when submit you need to get a popup or other message. That is what I mean with required.
type: AnswerComment
comment on: http://stackoverflow.com/a/28153208

http://stackoverflow.com/comment/44766768
comment on: http://stackoverflow.com/q/28199712
type: Comment
type: QuestionComment
has text: Whichever method you choose though, you need to factor in the line spacing in the text. I think this is your main issue.
score: 2

http://stackoverflow.com/a/28128467
score: 1
answers question: http://stackoverflow.com/q/28128368
has comment: http://stackoverflow.com/comment/44630093
type: Answer
has comment: http://stackoverflow.com/comment/44630134
upvote count: 1
has body: Your graph in the question is correct. Let us understand it with the list of variables available in each function, var a; function Foo() { var b; # [a, b] function Bar() { var c; # [a, b, c] } function Bam() { var d; # [a, b, d] } } In Foo, a is available from the higher scope and it has b defined in it. Bar has access to a also, it can access Foo's b because of the closure property, but it cannot access Bam's d, because it is enclosed in Bam and not visible outside. Similarly Bam cannot access Bar's c. Actually, when Foo is created, there will be a new Lexical environment created (which has a Environment Record and a reference to outer Lexical Environment) and all the variables created in it will be stored in the Environment Record. Since Foo doesn't have any outer Environment, outer Lexical Environment will be Global Environment. Similarly when Bar is created a new Lexical Environment will be created which will have the outer Lexical Environment as the Foo's Lexical Environment. So, when a variable being accessed in Bar is not defined in the current Environment Record, then Foo's Environment Record will be searched. Similarly for Bam. Quoting ECMA Script 5.1 Specification, A Lexical Environment is a specification type used to define the association of Identifiers to specific variables and functions based upon the lexical nesting structure of ECMAScript code. A Lexical Environment consists of an Environment Record and a possibly null reference to an outer Lexical Environment. Usually a Lexical Environment is associated with some specific syntactic structure of ECMAScript code such as a FunctionDeclaration, a WithStatement, or a Catch clause of a TryStatement and a new Lexical Environment is created each time such code is evaluated. An Environment Record records the identifier bindings that are created within the scope of its associated Lexical Environment. The outer environment reference is used to model the logical nesting of Lexical Environment values. The outer …
downvote count: 0

http://stackoverflow.com/q/28136728
tagged with: steroids
score: 0
has answer: http://stackoverflow.com/a/28136740
accepted answer: http://stackoverflow.com/a/28136740
answer count: 1
has title: Not able to load new module dependency in angular
tagged with: angularjs
tagged with: carousel
has comment: http://stackoverflow.com/comment/44645744
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44645803
has body: Im using appgyver and are not able to load new module. I get this error message: Failed to instantiate module legeApp due to:\n[$injector:nomod] Module 'legeApp' 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 Here is my code, please help! Js file angular .module('legeApp', ['angular-carousel']) .controller('IndexControllerOrer', function($scope, supersonic, $filter) { }); My Layout.html <%= yield.viewName %> <% _.each(yield.modules, function(module) { %> <script src="/app/<%= module %>.js"> <% }); %> <body ng-app="<%= yield.moduleName %>"> <%= yield.view %> My view Helseplager {{plagerOret.value}} Diagonoser The angular-carousel files is under the components/angular-carousel/angular-carousel.css and components/angular-carousel/angular-carousel.js
type: Question
tagged with: javascript

http://stackoverflow.com/q/28187615
upvote count: 1
has comment: http://stackoverflow.com/comment/44743495
type: Question
has body: At the moment I am doing this: var token = document.location.href.split('?_sft_category=')[1]; Which is ok if my URL is: http://www.example.com/xchanges/results/?_sft_category=sky I get sky in that case as a var, but if my URL becomes http://www.example.com/xchanges/results/?_sft_category=sky#comboFilters%5BAgency%5D=.TBWA In that case I obviously get everything after = while instead I would like to get ONLY the first string after '?_sft_category='
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28187743
has title: How to set a variable based on the first string in the URL after a symbol?
linked to: http://stackoverflow.com/q/901115
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/901115
has answer: http://stackoverflow.com/a/28187743
has comment: http://stackoverflow.com/comment/44743575
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44789180
type: AnswerComment
comment on: http://stackoverflow.com/a/28212225
score: 0
type: Comment
has text: PhantomJS has two environments. `page.evaluate` is the sandboxed page context. You should read the documentation: http://phantomjs.org/api/webpage/method/evaluate.html the casper documentation is also quite good: http://docs.casperjs.org/en/latest/modules/casper.html#evaluate (I would suggest to use CasperJS, because it is much easier to write navigation scripts that way)

http://stackoverflow.com/a/28224101
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: Using the jQuery filter you can minimize the selected elements and than just iterate through matching results. $("td").filter(function(idx) { return $(this).text().indexOf("http") !== -1; }).each(function(){ var contents = $(this).html() ; $(' ').appendTo($(this)); }); See working example here: http://fiddle.jshell.net/3w10tfou/1/
answers question: http://stackoverflow.com/q/28223746

http://stackoverflow.com/q/28187507
has comment: http://stackoverflow.com/comment/44748998
has comment: http://stackoverflow.com/comment/44743507
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44746546
has comment: http://stackoverflow.com/comment/44746232
has body: Hi I have a table with data in it,what I what is to filter the result so that if a table row have a datetime that is not current like today's date that specific row must not be shown or just change the background-color of it. Here is what I have tried but it doesn't work. Even if it's not filter what-else can I use? Basically the first row must appear KomaxShortname OriginalFileName OriginalPath OriginalModifiedDateTime UpLoadedDateTime AgeInMinutes FileLength {{latestwpcsfiles.KomaxShortname}} {{latestwpcsfiles.OriginalFileName}} {{latestwpcsfiles.OriginalPath}} {{latestwpcsfiles.OriginalModifiedDateTime}} {{latestwpcsfiles.UpoadedDateTime}} {{latestwpcsfiles.AgeInMinutes}} {{latestwpcsfiles.FileLength}} JS function Model($http) { var self = this; self.$http = $http; self.WpcsFiles = []; self.GetLatestWpcsFiles = function () { return ngHesto.Ajax.Get(self.$http , { url: 'http://10.19.13.68/GetLatestWpcsFiles/Default.aspx' , success: function (data) { self.WpcsFiles = data.data; console.log(self.WpcsFiles); } }); } self.GetLatestWpcsFiles(); } ngAppModule.controller('LatestWpcsFilesController', ['$scope', '$http', function ($scope, $http) { $scope.Model = new Model($http); }]);
has comment: http://stackoverflow.com/comment/44746152
has title: Use filter to filter result in angularJS
has comment: http://stackoverflow.com/comment/44748894
type: Question
has comment: http://stackoverflow.com/comment/44746335
score: 0
has comment: http://stackoverflow.com/comment/44748034
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44744206
has comment: http://stackoverflow.com/comment/44746434
has comment: http://stackoverflow.com/comment/44751586
has comment: http://stackoverflow.com/comment/44749255
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44747247
has answer: http://stackoverflow.com/a/28192259

http://stackoverflow.com/a/28222990
has body: As @adeneo pointed, do not pass strings to the setTimeout function, you can even get rid of the parenthesis. Test Image update from cam
answers question: http://stackoverflow.com/q/28222870
type: Answer
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44809591

http://stackoverflow.com/comment/130367287
type: AnswerComment
has text: What to do with response?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28165580

http://stackoverflow.com/comment/44783291
type: AnswerComment
type: Comment
score: 0
has text: @T.J. Crowder, you are right, it's just my habit to reiterate stuff to make myself understand. Nothing meant to steal anyone's thunder.
comment on: http://stackoverflow.com/a/28209289

http://stackoverflow.com/comment/44671511
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28149950
has text: It's only the first ul not the first li. THe > selector means it selects onyl li's which parent is ul. It can go without it as well since the html structure doesn't have li's outside of ul's. But I tried without it. Still the same issue.

http://stackoverflow.com/q/28262796
type: AnsweredQuestion
tagged with: network-protocols
tagged with: google-chrome
has title: Can a chrome extension be opened when requesting specific external protocol?
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/12868386
has body: I want to write a chrome extension that is triggered when the browser redirect to a specific external protocol: myApp://... I googled a bit and didn't find an easy meta-data way to do so. is there a way to define it in the manifest? I want the extension to open a popup then, and I'll wait for it in my automation testing.
tagged with: google-chrome-extension
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28264744
accepted answer: http://stackoverflow.com/a/28264744
favorite count: 0
upvote count: 2
score: 2

http://stackoverflow.com/comment/44848737
type: Comment
has text: @Tomalak Good point. Although it depends on whether you want a deep or shallow copy. If you can only get a deep copy, you need methods in your top-level class to update deeply nested elements.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28243920

http://stackoverflow.com/q/28153365
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44678113
answer count: 1
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44678294
has answer: http://stackoverflow.com/a/28155092
has body: I am trying to implement a show more/show less functionality in my div depending on number of characters. Any ideas on how to do it using AngularJS? My div looks like follows: {{more ? 'Less' : 'More'}} If I want to show the "More" text only if the number of chars in the paragraph exceeds 250, how do I go about doing that?
has title: How do you show/hide a div depending on character count?
accepted answer: http://stackoverflow.com/a/28155092

http://stackoverflow.com/a/28157708
type: Answer
has body: Since you have an async call, the value would be returned when the call is finished (successfully) $http({ url: 'resource-directory.json', method: "GET" }).success(function(data){ console.log('response data', data); var theHref = $filter('filter')(data.link, {title: "services-path"})[0].href; console.log('theHref', theHref); // value shows here }).error(function(errorResp){ console.log('error'); });
answers question: http://stackoverflow.com/q/28156987
score: 0

http://stackoverflow.com/a/28198211
accepted answer of: http://stackoverflow.com/q/28198181
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28198181
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: getElementsByTagName returns collection of elements, not single element. Try this: array.push(elements[i].getElementsByTagName("a")[0].href);

http://stackoverflow.com/comment/44836220
has text: weird, it may be a plugin issue? i am using firefox 31.4.0. unfortunately an update is not possible
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28237370

http://stackoverflow.com/a/28224990
type: Answer
has body: are you looking for something like this? (look at the console) http://jsfiddle.net/swm53ran/180/ Ajax finished $(document).ready(function() { $('.ajax').on('click', function() { // ajax did something and added element to dom $('.content').append('hello'); console.log($('html').html()); }); }); i added a button to "simulate" the ajax call, and then changed the dom. In your ajax success() function, you could but the $('html').html() code which will give you the html of your view after the ajax is called.
answers question: http://stackoverflow.com/q/28224876
score: 0

http://stackoverflow.com/a/28167565
has body: The problem is you're not emitting to the socket that just connected but to all other sockets, so you must have a second connection to the server before you receive an "ip" message client side. Change socket.broadcast.emit('ip', {ip: ip}) to socket.emit('ip', {ip: ip})
has comment: http://stackoverflow.com/comment/44712627
score: 2
has comment: http://stackoverflow.com/comment/44709616
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28167509
upvote count: 2
has comment: http://stackoverflow.com/comment/44709818
answers question: http://stackoverflow.com/q/28167509
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44640871
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28134031
has text: I am new to this. But document.write works fine for me. At least in the terms that it allows me to render the content. I used friebug to inspect the html page and it shows all the elements with the id's i am writing. But I will try with createElement and check if the code works then. Thanks

http://stackoverflow.com/comment/44861268
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28250803
score: 0
has text: Doesn't your custom `modal()` expose some callbacks you could use to set your logic?

http://stackoverflow.com/q/28214844
tagged with: javascript
tagged with: jquery
has body: I am having trouble trying to re-populate a form with has come from a JSON object. I have used JSON.stringify(name) and for the value as well and it returns me the type of data format I think might work. But can't seem to get in the $.each method function fetchOrderFromLocalStorage() { PROCESS_SAVE = true; var mcs = localStorage.getItem(REPORTS_KEY); console.log(mcs); var jsn = JSON.parse(mcs); console.log(jsn); if (mcs.length == 0) { return false; } $.each(jsn, function (name, val) { var $el = $("input[name='" + name + "']"), type = $el.attr('type'); console.log(JSON.stringify(name) + ":" + JSON.stringify(val)); switch (type) { case 'checkbox': $el.attr('checked', 'checked'); break; case 'radio': $el.filter('[value="' + val + '"]').attr('checked', 'checked'); break; default: $el.val(val); } }); //console.log(jsn); //for (var i = 0; i &lt; jsn.length; i++) { // var formInput = jsn[i]; // $("form input[name='" + formInput.name + "']").val(formInput.value); //} } The commented out code at the bottom works, but I want to populate checkboxs as well so I have tried some code from here that has been checked to work. So I am trying it but my data is not in the correct format. I think I want JSON.Stringify() as the sonsole give me the correct result according to jQuery docs.
upvote count: 1
has answer: http://stackoverflow.com/a/28215451
accepted answer: http://stackoverflow.com/a/28215451
answer count: 1
favorite count: 0
has title: Populate checkbox from JSON data
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/28248961
tagged with: ajax
has body: I am trying to send the data from a PHP page with AJAX , but I am not able to understand how this works, I will explain what I have done so far. Bootstrap dropdown: BOTÂO valor 1 valor 2 AJAX: $(document).on('click','#status li',function(){ $.ajax({ url : 'exemple.php', type : 'POST', data : { 'valor' : $('#data').val() }, }); }); I changed the AJAX to: $(document).on('click','#status li',function(){ $.ajax({ url : 'exemple.php', type : 'POST', data : { 'valor': $(this).attr('data') }, }); }); But does not work aswell. Any idea please?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44857940
tagged with: php
tagged with: twitter-bootstrap
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28253252
has comment: http://stackoverflow.com/comment/44864649
has comment: http://stackoverflow.com/comment/44865005
answer count: 1
tagged with: jquery
has title: Dropdown-menu Bootstrap PHP

http://stackoverflow.com/comment/44825541
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28212301
has text: @madforstrength I tried cookies once but I don't really understand that could you explain and send a code, if you don't mind ?

http://stackoverflow.com/a/28145524
downvote count: 0
has body: I think you are looking for the disableObjectResizing configuration option. Note that due to big differences in contenteditable implementation in browsers, this is not 100% cross-browser supported. See the note at the documentation here: http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-disableObjectResizing A very complicated issue, this one :)
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28123071
type: Answer

http://stackoverflow.com/a/28183297
answers question: http://stackoverflow.com/q/28182682
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28182682
has body: Each time you call SC.stream, you're creating a new sound object. pause() is working, just on a different sound than the one playing. You can store the stream to be used later: var stream; function playTrack(event) { e.preventDefault(); if(!stream) { SC.stream("/tracks/293", function(sound){ stream = sound; stream.play(); }); } else { stream.play(); } } function pauseTrack(event) { if(stream) { stream.pause(); } }
type: Answer

http://stackoverflow.com/comment/44899872
type: QuestionComment
comment on: http://stackoverflow.com/q/28271996
has text: If you found it useful, please mark the question as solved.
score: 0
type: Comment

http://stackoverflow.com/q/28245173
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28246067
has title: how to have google form data emailed with bold text
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44851270
upvote count: 1
type: Question
tagged with: google-apps-script
has answer: http://stackoverflow.com/a/28248422
answer count: 2
has body: I am currently using the following script to have google spreadsheet email my google form responses to me. All the text in the email is plain text, but I would like the headers to be bold text. I have tried several variations of adding the java command for bold text into the code to accomplish this but I am basically guessing since I have zero code writing experience. Is it possible and how should my script look to succeed? Thank you. function sendFormByEmail(e) { var emailSubject = "MOD Report"; // Set with your email address or a comma-separated list of email addresses. var yourEmail = "xxxx@xxxx.com"; // Set with your spreadsheet's key, found in the URL when viewing your spreadsheet. var docKey = "xxxx-xxxx-xxxx-xxxx"; // If you want the script to auto send to all of the spreadsheet's editors, set this value as 1. // Otherwise set to 0 and it will send to the yourEmail values. var useEditors = 0; // Have you added columns that are not being used in your form? If so, set this value to // the NUMBER of the last column that is used in your form. // for example, Column C is the number 3 var extraColumns = 0; if (useEditors) { var editors = DocsList.getFileById(docKey).getEditors(); if (editors) { var notify = editors.join(','); } else var notify = yourEmail; } else { var notify = yourEmail; } // The variable e holds all the submission values in an array. // Loop through the array and append values to the body. var s = SpreadsheetApp.getActive().getSheetByName("FormResponses1"); if (extraColumns){ var headers = s.getRange(1,1,1,extraColumns).getValues()[0]; } else var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; var message = ""; for(var i in headers) { message += headers[i] + ' = '+ e.values[i].toString() + '\n\n'; } MailApp.sendEmail(notify, emailSubject, message); }
tagged with: google-sheets
downvote count: 0

http://stackoverflow.com/comment/44893918
comment on: http://stackoverflow.com/q/28268901
type: Comment
type: QuestionComment
has text: The `innerHTML` is being updated. What is your expected output?
score: 1

http://stackoverflow.com/q/28217824
answer count: 1
tagged with: arrays
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28219069
has title: JavaScript $http.get an json array and store it in localstorage
has body: I'm trying to receive an json Array and store it in the local storage. I've seen some questions like this but they couldn't help me. So i wanted to try with my own question. Im developing in Ionic Framework. My controller includes following: app.controller('QuestionsCtrl', function($scope, $http, $stateParams, $localstorage) { $scope.getData = function() { // get the json $http.get("data/fragenArray.json") .success(function(data) { //output of json as a string -&gt; correct console.log('data: ' + JSON.stringify(data)); // store json in local storage $localstorage.setObject('fragenset', data); // restore json from local storage var post = $localstorage.getObject('fragenset'); // output of local storage item -&gt; incorrect // I got: Test xxx: [object Object] console.log('Test xxx: ' + post); }) .error(function(data) { alert("ERROR"); }); } }); To store the json I've got: angular.module('utils', []) .factory('$localstorage', ['$window', function($window) { return { set: function(key, value) { $window.localStorage[key] = value; }, get: function(key, defaultValue) { return $window.localStorage[key] || defaultValue; }, setObject: function(key, value) { $window.localStorage[key] = JSON.stringify(value); }, getObject: function(key) { return JSON.parse($window.localStorage[key] || '{}'); } } }]); So I decided to try it without the http.get request: app.run(function($localstorage, $http) { $localstorage.setObject('post', {"fragen":[ { "id":"1", "frage":"Wie ist das Wetter?", "antworten": { "a_1":"gut", "a_2":"schlecht" } }, { "id":"2", "frage":"Wie geht es dir?", "antworten": { "a_1":"gut", "a_2":"schlecht" } } ]}); var post = $localstorage.getObject('post'); console.log(post); }) And the result ist exactly what i expected - an json object. So how can i store the json array from the http.get correctly?
tagged with: local-storage
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28219069
tagged with: http://stackoverflow.com/tag/json
tagged with: ionic-framework
type: Question

http://stackoverflow.com/q/28194596
favorite count: 0
type: Question
has body: I've imported some XML files inside InDesign (you can see the structure in the picture below) and I've also created a script to get some statistics concerning this hierarchy. For example, to count the "free" elements: var items = app.activeDocument.xmlElements.everyItem(); var items1 = items.xmlElements.itemByName("cars"); var cars = items1.xmlElements.everyItem(); var c_free = cars.xmlElements.itemByName("free"); var cars_free = c_free.xmlElements.count().length; I also have apartments in my structure that's why I'm using itemByName. The code above returns the correct number of free cars in my structure. What I'm trying to do - without any luck so far - is to target those free items (inside cars) and either delete all of them or a specific number. My last attempt was using: var del1 = myInputGroup2.add ("button", undefined, "Delete All"); del1.onClick = function () { cars.xmlElements.everyItem().remove(); } inside a dialog I've created. Any suggestions will be appreciated cause I'm really stuck here.
accepted answer: http://stackoverflow.com/a/28202729
has title: InDesign Scripting: Deleting elements from the structure panel
tagged with: http://stackoverflow.com/tag/xml
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28297139
has answer: http://stackoverflow.com/a/28202729
has answer: http://stackoverflow.com/a/28297139
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
tagged with: adobe-indesign
score: 1

http://stackoverflow.com/comment/75230510
type: Comment
has text: https://diff2html.xyz/ is what you want
comment on: http://stackoverflow.com/a/28131892
type: AnswerComment
score: 0

http://stackoverflow.com/a/28234145
has comment: http://stackoverflow.com/comment/44830622
has comment: http://stackoverflow.com/comment/44833491
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44831956
has comment: http://stackoverflow.com/comment/44832044
downvote count: 0
has body: Example using todays date: var today = new Date(); today.setDate(today.getDate() + x); where x is the number of days. Then just use getYear(), getMonth() and getDate() and format it how you like. EDIT var myDate = new Date(year, month, day, hours, minutes, seconds, milliseconds); Assuming your date is entered in dd/mm/yyyy format as inputDate then dateParts = inputDate.split("/"); var myDate = new Date(dateParts[2], dateParts[1]-1, dateParts[0]); Depending on the date format your split() delimiter and array positions may be different but this is the general idea.
answers question: http://stackoverflow.com/q/28233532

http://stackoverflow.com/q/28268488
has answer: http://stackoverflow.com/a/28268604
tagged with: authentication
type: Question
has title: facebook js sdk. How do I login with facebook, without the user actually login into facebook?
tagged with: javascript
tagged with: facebook-login
score: 0
has body: I am new to stackoverflow, so I hope that I ask the question correctly. For a website that I am working on, I have to implement login in using your facebook account. I have this working for the biggest part, since the user is able to login with using facebook and I'm able to retrieve the information I want. But the problem is, whenever the user logs in with their facebook account, he automatically gets logged in into facebook itself. And whenever the user presses the log out button, facebook logs him out too. For the facebook login, I am using the javascript sdk from facebook. This can be quit anoying for the user, since it must be possible for a random user to login my website using their facebook account, even when someone else is logged into facebook itself on the same computer. So my question is: is it possible to login with facebook, without the user actually login into facebook, like just let facebook verify the account and send the requested information back? Using the facebook js sdk off course.
answer count: 1
has comment: http://stackoverflow.com/comment/44893127
accepted answer: http://stackoverflow.com/a/28268604
tagged with: facebook
tagged with: facebook-javascript-sdk
type: AnsweredQuestion

http://stackoverflow.com/comment/44691153
type: Comment
has text: loop won't be defined if you do this (which is the purpose for using http://en.wikipedia.org/wiki/Immediately-invoked_function_expression)
comment on: http://stackoverflow.com/a/28132605
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44702534
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28166130
has text: I dont understand, for what for I need the on and off?.
type: AnswerComment

http://stackoverflow.com/q/28125555
has title: Using app.get inside the function connecting DB - NodeJs
linked to: http://stackoverflow.com/q/5818312
tagged with: node.js
type: AnsweredQuestion
tagged with: mysql
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28127940
accepted answer: http://stackoverflow.com/a/28127940
score: 0
has body: I am using NodeJs along with MySQL. I am using node-mysql after looking at MySQL with Node.js. Now the problem is I am trying to make db connection only once and using GETs inside it but it's not working. Code: var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'example.org', user : 'bob', password : 'secret', }); connection.connect(function(err) { // connected! (unless `err` is set) app.get('/hello',function(req,res){ console.log('Hello'); res.send('Hi'); }); }); But the above code is not working. It is not recognizing the route. But making a connection inside every get function works. I should be doing something wrong. Is there any way such that I can connect to the Db only once ?

http://stackoverflow.com/q/28278049
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28278210
has comment: http://stackoverflow.com/comment/45035215
has title: URL with #anchor over a position:fixed div - is there a non-javascript solution
score: -1
has body: this is a problem I'm sure someone else has dealt with. I have a header which is position-fixed at the top of the page. then I have a list of elements stacked vertically. Each element has &lt;a name="post-&lt;?php echo $ID;?&gt;"&gt;&lt;/a&gt; at its start. So naturally I'd want to have the URL mypage.php?#post-735 scroll that element to the top. Well, it does exactly what I ask it, imagine that! Unfortunately of course, since the header is about 150px tall, it is hidden under the header. My question from there is pretty obvious: 1) any way to use HTML to subtract the 150 or so px from the scroll-down and 2) if this can't be done by HTML, any elegant way to handle it in jQuery or javascript?
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44910483
has answer: http://stackoverflow.com/a/28278210
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/a/28198868
accepted answer of: http://stackoverflow.com/q/28198488
has comment: http://stackoverflow.com/comment/44799118
upvote count: 4
has comment: http://stackoverflow.com/comment/44764858
has comment: http://stackoverflow.com/comment/44764626
type: Answer
has comment: http://stackoverflow.com/comment/44797286
has comment: http://stackoverflow.com/comment/44791159
has comment: http://stackoverflow.com/comment/44786137
downvote count: 0
has comment: http://stackoverflow.com/comment/44764739
has comment: http://stackoverflow.com/comment/44764347
has comment: http://stackoverflow.com/comment/44764171
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28198488
score: 4
has body: Try doing: ds.filter([ { "logic":"and", "filters":[ { "logic":"or", "filters":[ // Your A condition { "field": "InspectionStatusCode", "operator": "eq", "value": "PL" }, // Your B condition { "field": "InspectionStatusCode", "operator": "eq", "value": "OPEN" } { // Your C condition } ] }, { "logic":"or", "filters":[ { // Your D condition }, { // Your E condition } ] } ] } ]); I.e. Write a first filter with login "AND" which contains two filters. Each of these filters have and "OR" filter with the conditions that you want. Remember that:
has comment: http://stackoverflow.com/comment/44798622

http://stackoverflow.com/comment/44783690
has text: Both, the answer is no you can't if you just have the client. But if OP does have access to the website, I'll edit my answer to accommodate
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28209513
type: AnswerComment

http://stackoverflow.com/comment/45953457
score: 0
type: QuestionComment
type: Comment
has text: are you sure that args[0] can be casted to a plain `Array`? I would probably try to do it the opposite way - allocate the image, call image decoder with the pointer to its data. This will eliminate the call to `.set()`, but I'm not really sure if this will work or not. Btw I'm working on an addon that will bring an asynchronous imaging for node.js (http://blend2d.com), but it's not ready yet.
comment on: http://stackoverflow.com/q/28205874

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/28210648
tag name: google-oauth

mongodb
tags question: http://stackoverflow.com/q/28249381
tags question: http://stackoverflow.com/q/28136650
tags question: http://stackoverflow.com/q/28216810
tags question: http://stackoverflow.com/q/28149213
tags question: http://stackoverflow.com/q/28174210
tags question: http://stackoverflow.com/q/28158667
tags question: http://stackoverflow.com/q/28223107
tags question: http://stackoverflow.com/q/28205869
tags question: http://stackoverflow.com/q/28197358
tags question: http://stackoverflow.com/q/28165674
tags question: http://stackoverflow.com/q/28242510
tags question: http://stackoverflow.com/q/28256484
tags question: http://stackoverflow.com/q/28267084
tag name: mongodb
tags question: http://stackoverflow.com/q/28260850
tags question: http://stackoverflow.com/q/28269579
tags question: http://stackoverflow.com/q/28203387
tags question: http://stackoverflow.com/q/28139638
tags question: http://stackoverflow.com/q/28122091
tags question: http://stackoverflow.com/q/28133345
tags question: http://stackoverflow.com/q/28147059
tags question: http://stackoverflow.com/q/28196926
tags question: http://stackoverflow.com/q/28166632
type: Tag
tags question: http://stackoverflow.com/q/28229857
tags question: http://stackoverflow.com/q/28122617
tags question: http://stackoverflow.com/q/28246879
tags question: http://stackoverflow.com/q/28156042
tags question: http://stackoverflow.com/q/28267050
tags question: http://stackoverflow.com/q/28204224
tags question: http://stackoverflow.com/q/28129223
tags question: http://stackoverflow.com/q/28144362
tags question: http://stackoverflow.com/q/28261579
tags question: http://stackoverflow.com/q/28135409
tags question: http://stackoverflow.com/q/28169660
tags question: http://stackoverflow.com/q/28198685
tags question: http://stackoverflow.com/q/28261928
tags question: http://stackoverflow.com/q/28200502
tags question: http://stackoverflow.com/q/28248628
tags question: http://stackoverflow.com/q/28157597
tags question: http://stackoverflow.com/q/28266855
tags question: http://stackoverflow.com/q/28241282
tags question: http://stackoverflow.com/q/28155298
tags question: http://stackoverflow.com/q/28243961
tags question: http://stackoverflow.com/q/28247346
tags question: http://stackoverflow.com/q/28153179
tags question: http://stackoverflow.com/q/28249909
tags question: http://stackoverflow.com/q/28213019
tags question: http://stackoverflow.com/q/28174042
tags question: http://stackoverflow.com/q/28121870

http://stackoverflow.com/a/28275073
type: Answer
has body: Id should be unique. specification If the HTML code is yours, you should fix this first. On the other hand, if what you are doing is on a site you cannot modify (e.g. userscript): querySelector('div#id1'), or, getElementById('id1') have no stander behavior when there are duplicate ids. So you may need document.querySelector('div[id="id1"]')
answers question: http://stackoverflow.com/q/28274887
score: 0

http://stackoverflow.com/q/28265325
has title: Google Tag Manager with disabled Javascript doesn't fire
type: Question
tagged with: javascript
has body: I try to implement a GTM call that executes Analytics tracking. When I use the normal JS interface with {"event": "fire"} It fires well, when I try to use the no javasript approach: http://www.googletagmanager.com/ns.html?GTM-XXXXX&amp;event=fire it doesn't seem to do anything to the analytics counts. Have you encountered such a thing?
score: 0
type: UnansweredQuestion
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/45008647
answer count: 0
tagged with: google-tag-manager
has comment: http://stackoverflow.com/comment/45032378

http://stackoverflow.com/comment/44667762
comment on: http://stackoverflow.com/q/28148062
score: 0
type: Comment
has text: @Neil Got it ;) Deleted
type: QuestionComment

http://stackoverflow.com/q/28262674
favorite count: 0
has answer: http://stackoverflow.com/a/28393656
possible better answer: http://stackoverflow.com/a/56496854
has body: last year I was using the code found here http://gdata-javascript-client.googlecode.com/svn/trunk/samples/calendar/simple_sample/simple_sample.html to retrieve all events from "now" of a public Google Calendar and then display the results in a webpage. I modified that code to match my needs (see the code below). Now, with API v3, the code doesn't work anymore and I'm not able to understand which lines of the code are deprecated and how to update them. Could please someone help me with this code? Thank you so much :-) LOADING CALENDAR . . . . . . . . . .
score: 9
has answer: http://stackoverflow.com/a/56496854
tagged with: google-calendar-api
type: AnsweredQuestion
has title: Retrieve Google Calendar events using API v3 in javascript
tagged with: calendar
accepted answer: http://stackoverflow.com/a/28393656
type: Question
answer count: 2
upvote count: 9
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/66435427
has comment: http://stackoverflow.com/comment/45123521
has comment: http://stackoverflow.com/comment/44928825
downvote count: 0

http://stackoverflow.com/comment/44619597
has text: glade that my answer helps you, its developer`s choice to use blade or not :D
comment on: http://stackoverflow.com/a/28122747
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28190664
has comment: http://stackoverflow.com/comment/44757868
upvote count: 1
has comment: http://stackoverflow.com/comment/44756392
has comment: http://stackoverflow.com/comment/44786893
score: 1
has comment: http://stackoverflow.com/comment/44761279
has comment: http://stackoverflow.com/comment/44789361
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44764620
has comment: http://stackoverflow.com/comment/44764209
has comment: http://stackoverflow.com/comment/44760964
has comment: http://stackoverflow.com/comment/44754808
type: Answer
has body: jQuery does not supports namespaces, only colons in node names. I could not get the jquery-xmlns plugin to work with the current jQuery versions. The new Document.querySelector() and Document.querySelectorAll() methods do not support namespaces either. But Document.evaluate() and Document itself do. They allow to use XPath. All modern browser except IE support Document.evaluate(). For IE a JavaScript library can be used to add the method to the document objects. var dom = (new DOMParser()).parseFromString(xml, 'application/xml'); var resolver = { namespaces : { 'o' : 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' }, lookupNamespaceURI : function(prefix) { if (prefix == '') { return null; } return this.namespaces[prefix] || null; } }; var node = dom.evaluate( '//o:BinarySecurityToken', dom, resolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; node.appendChild(dom.createTextNode('TOKEN_TEXT')); document.querySelector('#output').textContent = (new XMLSerializer()).serializeToString(dom); Demo: http://jsfiddle.net/mec2qxLa/2/ To make it work with IE you need to load the xpath.js. It attaches the evaluate method to the document object. For new Document instances you can get it from there. It does not publish the XPathResult object, but it defines a xpath object that provides it. var dom = (new DOMParser()).parseFromString(xml, 'application/xml'); if (!dom.evaluate &amp;&amp; document.evaluate) { dom.evaluate = document.evaluate; if (typeof XPathResult == 'undefined') { XPathResult = xpath.XPathResult; } } ...
accepted answer of: http://stackoverflow.com/q/28189869
has comment: http://stackoverflow.com/comment/44754345
has comment: http://stackoverflow.com/comment/44764373
answers question: http://stackoverflow.com/q/28189869
has comment: http://stackoverflow.com/comment/44761822

http://stackoverflow.com/q/28204016
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28204721
tagged with: jquery
tagged with: click
tagged with: video
has answer: http://stackoverflow.com/a/28204037
type: UnansweredQuestion
type: Question
has title: Video src won't reload on click of a different object
has body: I recently asked a similar question regarding audio posts... but I've had a more difficult time with videos. For reference, I've provided a link to the (working) audio example as well as a link to the (broken) video example. http://www.eastcoastband.com/new/audio-clip/ http://www.eastcoastband.com/new/video-gallery/ As you can see, the audio clips always replace and reload on click, but the videos only replace and reload on the first click. I'll provide some code below.. HTML: &lt;video id="video-play" src="https://www.youtube.com/watch?v=QKvtOAzO_-o" type="video/youtube" controls autoplay &gt; &lt;h5 class="change-video" data-video="https://www.youtube.com/watch?v=QKvtOAzO_-o" data-version="video/youtube"&gt; &lt;img width="480" height="360" src="http://www.eastcoastband.com/new/wp-content/uploads/2015/01/wedding-band-or-dj-oh-the-dilemm.jpg" class="attachment-post-thumbnail wp-post-image" alt="Wedding Band or DJ? Oh, the Dilemma"&gt; &lt;/h5&gt; JQuery: $('.change-video').click(function(){ var src = $(this).data('video'); var type = $(this).data('version'); var player = MediaElementPlayer('#video-play'); player.pause(); player.setSrc(src); $('#video-play').attr('type', type); player.load(); player.play(); }); Any suggestions?
tagged with: html5-video
has comment: http://stackoverflow.com/comment/44774172

http://stackoverflow.com/a/28179814
score: 3
answers question: http://stackoverflow.com/q/28179757
upvote count: 3
downvote count: 0
type: Answer
has body: Use ng-repeat for each of three horizontally placed divs and put the list in.

http://stackoverflow.com/comment/44832393
has text: Okey, I will try this way! Thank you very much
comment on: http://stackoverflow.com/a/28235060
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44679061
type: QuestionComment
has text: @Magrangs btw thank yopu very much for that tutorial, thats another issue i had with passive notifications, thanks.
comment on: http://stackoverflow.com/q/28153522
score: 0
type: Comment

react-rails
type: Tag
tag name: react-rails
tags question: http://stackoverflow.com/q/28122656

http://stackoverflow.com/q/28180255
has comment: http://stackoverflow.com/comment/44730027
upvote count: 1
type: Question
has title: Memory issue with Ember
tagged with: javascript
tagged with: memory
has body: I'm trying to understand why my Ember application has currently memory issue. Basically what happens is, when I load the application (Snapshot 1), I'm on the landing page, that's the default state of the app. When I navigate from page to page, then going back to the landing page, it takes more memory. I continue to navigate to the same pages, and the memory increases again. If I'm using the application during a long time without refreshing the browser, the memory explodes. It's not easy to read but it seems like there is something related to jQuery... Do you have any idea what could generate those memory issue? Thanks
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
answer count: 0
score: 1

http://stackoverflow.com/q/28177650
has comment: http://stackoverflow.com/comment/44724594
tagged with: javascript
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28177761
accepted answer: http://stackoverflow.com/a/28177761
favorite count: 0
has body: I created a simple helloworld with angular But I cant see result from it! My angular.min.js is in the html file and it loads correctly in browser. my code: {{helloMessage}} Result : {{helloMessage}}
tagged with: angularjs
has title: AngularJs not working in a simple project
has comment: http://stackoverflow.com/comment/44724582
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28178110
has answer: http://stackoverflow.com/a/28178110
type: Question
has comment: http://stackoverflow.com/comment/44724549

http://stackoverflow.com/q/28276108
possible better answer: http://stackoverflow.com/a/28276348
has comment: http://stackoverflow.com/comment/44906764
score: -1
has answer: http://stackoverflow.com/a/28276348
has body: I am trying to get the id of a selection of a select box, however was unable'm confused, can someone help me? Code of Selectbox: Edited SelectBox Code : <?php echo $this->__('Occasion') ?>* <select id="type_id" name="type_id" title="<?php echo $this->__('Occasion') ?>" class="validate-select form-control" onChange="criaDados(), showId(<?php $this->getId() ?>)" <?php if (!is_null ($_e->getId())) { echo "style='display: none;'"; } ?> > <?php echo $this->__('Please select occasion') ?> <?php foreach($_e->getTypes() as $k=>$v):?> <option value="<?php echo $k ?>" <?php if($_e->getTypeId() == $k) echo 'selected'?>><?php echo $this->htmlEscape($v) ?> <?php endforeach; ?> <input type="text" value="<?php echo $_e->getTypes()[$_e->getTypeId()] ?>" class="form-control" disabled <?php if (is_null ($_e->getId())) { echo "style='display: none;'"; } ?> /> <?php echo $this->__('Date') ?>* <?php echo $this->getDateInput($_e->getDate()) ?> Edited Javascript function showId(id) { var id_val = $("#" + id).val(); alert(id_val); }
upvote count: 0
accepted answer: http://stackoverflow.com/a/28276207
has answer: http://stackoverflow.com/a/28276276
tagged with: javascript
has title: SelectBox getID
favorite count: 0
has comment: http://stackoverflow.com/comment/44906954
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/28276377
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28276207
downvote count: 1
type: Question

http://stackoverflow.com/comment/44824154
comment on: http://stackoverflow.com/a/28230218
type: AnswerComment
has text: first one with modifcation since im using angular directive
score: 0
type: Comment

http://stackoverflow.com/q/28140698
has title: if elements height is greater than x addClass "portrait" else addClass "landscape"
type: Question
has answer: http://stackoverflow.com/a/28140736
has body: I am trying to write this script: if elements height is greater than 226, addClass "portrait", else addClass "landscape" I have this: var assetHeight = $("video.img-responsive").outerHeight(); if (assetHeight > 226){ $("video.img-responsive").addClass('portrait'); } else { $("video.img-responsive").addClass('landscape'); } However, When I inspect my elements all of them only have the added class 'landscape' even though some elements have a height greater than 226. Additionally, When I flip the script to : var assetHeight = $("video.img-responsive").outerHeight(); if (assetHeight < 226){ $("video.img-responsive").addClass('landscape'); } else { $("video.img-responsive").addClass('portrait'); } All the elements are still adding the class landscape. When I use my console to check my selectors, and find the hight of each individual elements it gives me the proper heights of the elements. However, the height is not indicated in css, or html. giving the elements a default height of auto. here is my html : Console: $("[data-id='72']").outerHeight(); 224 $("[data-id='73']").outerHeight(); 710
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28140736
has comment: http://stackoverflow.com/comment/44653088
type: AnsweredQuestion

http://stackoverflow.com/q/28158463
type: Question
tagged with: javascript
score: 0
answer count: 2
upvote count: 1
downvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28159154
favorite count: 0
has title: How to filter / clone select box options with jQuery?
has answer: http://stackoverflow.com/a/28158687
accepted answer: http://stackoverflow.com/a/28158687
has answer: http://stackoverflow.com/a/28159154
has body: I have the following two select boxes: None Project A Project B Project C Person A Person B Person C How can I filter the #person options based on the value selected in #project? This is a jQuery code snippet that a colleague came up with but I was unable to get it working because I am still new to jQuery: $(function() { var $person = $('#person'); $allPersonOptions = $person.children(); $('#project').on('change', function() { var selected_project = $('#project').data('person_ids'); filterOptions($allPersonOptions.clone(), +selected_project).appendTo($person.empty()); }); }); function filterOptions($options, id) { return $options.filter(function() { return $.inArray(id, $(this).data('project_ids')) > -1 }); } Thanks for any help in this matter.
type: AnsweredQuestion

http://stackoverflow.com/comment/44792241
type: Comment
has text: but it will reload the page then
type: AnswerComment
comment on: http://stackoverflow.com/a/28214279
score: 0

http://stackoverflow.com/q/28193598
has title: Display active tab's name in an span
answer count: 3
has answer: http://stackoverflow.com/a/28193684
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44754090
has comment: http://stackoverflow.com/comment/44754062
has answer: http://stackoverflow.com/a/28193742
favorite count: 0
has answer: http://stackoverflow.com/a/28193879
score: -3
possible better answer: http://stackoverflow.com/a/28193742
type: AnsweredQuestion
downvote count: 3
accepted answer: http://stackoverflow.com/a/28193879
type: Question
has body: I would like to show the active tab's name (text) in a span .active-class. Example: feinleinen glatt *Active_Tab_Name_Here (i.e. feinleinen) *
upvote count: 0
has comment: http://stackoverflow.com/comment/44754157
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28462520
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28273051
has body: I'm not what the issue is exactly, but I think the cause may be in the workflow. It should be: (1) destroy() the edgehandles on cy. (2) cy.destroy() the core instance. (3) Create a new core instance, cy. (4) Create a new edgehandles on cy. Alternate flow: (1) Never destroy. (2) Instead of destroying, empty graphs and re-use them: cy.elements().remove() The alternate flow is probably safer if there is a bug in edgehandles, and it's certainly more efficient (i.e. faster). If this doesn't solve the problem, then perhaps you could share some code (or send it to me privately if the code is sensitive) and we can post the generic results here.

http://stackoverflow.com/comment/44690992
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28159755
has text: I don't understand.. You are storing a template with `"browse/templates/browse.tpl.html"`, but retrieving it with `"templates/browse.tpl.html"`?
score: 0

http://stackoverflow.com/comment/44806964
type: Comment
type: QuestionComment
score: 0
has text: It says that Basket Object doesn't support `addEventListener`? But you are using `document.addEventListener`, not `JB_Shopping_Basket.addEventListener`.
comment on: http://stackoverflow.com/q/28221802

http://stackoverflow.com/a/28254707
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28254670
has body: Add that HTML code at the end of your page (inside the body tag) and add the following to your jQuery: $('#myModal').modal('show') See the Bootstrap JavaScript reference for more details.
has comment: http://stackoverflow.com/comment/44869082
has comment: http://stackoverflow.com/comment/45042883
downvote count: 0
has comment: http://stackoverflow.com/comment/44870114
has comment: http://stackoverflow.com/comment/44868344
type: Answer
has comment: http://stackoverflow.com/comment/44868273

http://stackoverflow.com/comment/44903548
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28274098
type: AnswerComment
has text: It's not just the error. The div that acts as the button is unclickable because it has no listener. I wrote all the code here, and I also wrote the theme/loop/etc from scratch as a learning project I guess. I guess I have to load all the JS in the footer like the other commenter says?

http://stackoverflow.com/q/28162210
has comment: http://stackoverflow.com/comment/44709482
type: Question
tagged with: c#
has title: Highcharts not referenced error when using setOptions
has answer: http://stackoverflow.com/a/28163242
accepted answer: http://stackoverflow.com/a/28163242
has comment: http://stackoverflow.com/comment/44697410
has body: We are currently using the DotNet.Highcharts API to incorporate Highcharts into our website. However, we are having some JavaScript reference issues when using the .SetOptions(GlobalOptions) call. We are using a wrapper class to build our chart in the controller, then using a simple view to render it. In our controller: Chart chart = new HighCharts("chart-id"); chart.SetOptions(new GlobalOptions { Global = new Global { UseUTC = false; } }); chart.SetPlotOptions()... In our view: @model HighchartWrapper @(Model.Chart) The chart is rendered in the view as follows: &lt;script type="text/javascript"&gt; Highcharts.setOptions({ global: { useUTC: false } }); var chart05; $(document).ready(function() { }); &lt;/script&gt; Chrome is raising an "Uncaught ReferenceError: Highcharts is not defined" error on the .setOptions() statement. Without this (and the corresponding .SetOptions() statement in .NET) the chart renders correctly. If I navigate off this page and then back again, the charts start to render correctly. I've found that manipulating the ToHtmlString() return value to put the .setOptions call to inside the .ready() portion makes the charts display properly. Is this the approach that others have had to resort to?
tagged with: dotnethighcharts
score: 0
has comment: http://stackoverflow.com/comment/44695667
has comment: http://stackoverflow.com/comment/44697255
tagged with: highcharts
answer count: 1
tagged with: javascript
tagged with: asp.net
type: AnsweredQuestion

http://stackoverflow.com/a/28181877
has comment: http://stackoverflow.com/comment/67332569
type: Answer
has comment: http://stackoverflow.com/comment/69202297
has comment: http://stackoverflow.com/comment/95124675
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28180871
upvote count: 172
has comment: http://stackoverflow.com/comment/102459107
answers question: http://stackoverflow.com/q/28180871
has comment: http://stackoverflow.com/comment/69138704
has comment: http://stackoverflow.com/comment/93074352
type: AcceptedAnswer
has body: Yes, you can provide multiple data sets using the datasets property, which is an array of containing groupings of values. Each data set contains a series of values in data that correspond to the labels. See two slightly different examples below depending on your version of Chart.js. Chart.js v1.x var ctx = document.getElementById("myChart").getContext("2d"); var data = { labels: ["Chocolate", "Vanilla", "Strawberry"], datasets: [ { label: "Blue", fillColor: "blue", data: [3,7,4] }, { label: "Red", fillColor: "red", data: [4,3,5] }, { label: "Green", fillColor: "green", data: [7,2,6] } ] }; var myBarChart = new Chart(ctx).Bar(data, { barValueSpacing: 20 }); See this JSFiddle. Chart.js v2.x var ctx = document.getElementById("myChart").getContext("2d"); var data = { labels: ["Chocolate", "Vanilla", "Strawberry"], datasets: [ { label: "Blue", backgroundColor: "blue", data: [3,7,4] }, { label: "Red", backgroundColor: "red", data: [4,3,5] }, { label: "Green", backgroundColor: "green", data: [7,2,6] } ] }; var myBarChart = new Chart(ctx, { type: 'bar', data: data, options: { barValueSpacing: 20, scales: { yAxes: [{ ticks: { min: 0, } }] } } }); See this JSFiddle.
has comment: http://stackoverflow.com/comment/109908000
score: 172
has comment: http://stackoverflow.com/comment/65550616

http://stackoverflow.com/a/29382690
upvote count: 0
score: -4
has comment: http://stackoverflow.com/comment/46961638
downvote count: 4
has comment: http://stackoverflow.com/comment/46957357
type: Answer
answers question: http://stackoverflow.com/q/28155841
has body: The problem is the user code, not iOS8 webkit. var obj = { 23: 'a', 24: 'b', 25: 'c' } The map keys above are integers, when strings should be used. It's not a valid map by the javascript standard so the behaviour is undefined, and Apple is choosing to interpret `obj' as an array of 26 elements (indexes 0 to 25 inclusive). Use string keys and the length problem will go away: var obj = { '23': 'a', '24': 'b', '25': 'c' }
has comment: http://stackoverflow.com/comment/47028873

http://stackoverflow.com/q/28233107
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44828728
upvote count: 2
has body: So, I've been reading up on some of Reginald's stuff on Method Combinators and I have to say, his style of writing is just not what I had hoped. Very smart, but I can't wrap my head around his explanations &amp; usage. So, I was hoping all the very expressive bright minds here :-), can tell me if they've had some practical usage for method combinators.. and perhaps an example. So, these are example of method combinators and outside of "feeding methods into other methods", I can't see what is the usage. I mean, I know we use this style alot in callbacks and such, but there is a deeper meaning/usage here that is escaping me. https://github.com/raganwald/method-combinators/blob/master/README-JS.md var __slice = [].slice; this.before = function(decoration) { return function(base) { return function() { decoration.apply(this, arguments); return base.apply(this, arguments); }; }; }; this.after = function(decoration) { return function(base) { return function() { var __value__; decoration.call(this, __value__ = base.apply(this, arguments)); return __value__; }; }; }; this.around = function(decoration) { return function(base) { return function() { var argv, callback, __value__, _this = this; argv = 1 &lt;= arguments.length ? __slice.call(arguments, 0) : []; __value__ = void 0; callback = function() { return __value__ = base.apply(_this, argv); }; decoration.apply(this, [callback].concat(argv)); return __value__; }; }; }; this.provided = function(condition) { return function(base) { return function() { if (condition.apply(this, arguments)) { return base.apply(this, arguments); } }; }; }; this.excepting = function(condition) { return function(base) { return function() { if (!condition.apply(this, arguments)) { return base.apply(this, arguments); } }; }; }
type: Question
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28233784
has title: Javascript Method Combinators
accepted answer: http://stackoverflow.com/a/28233784
downvote count: 0
answer count: 1

drawingbrush
tag name: drawingbrush
type: Tag
tags question: http://stackoverflow.com/q/28190697
tags question: http://stackoverflow.com/q/28197378

http://stackoverflow.com/q/28263005
upvote count: 1
has title: Highlight Arabic text using javascript or jquery
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28263534
favorite count: 0
has answer: http://stackoverflow.com/a/28263992
type: UnansweredQuestion
tagged with: regex
has body: I need to highlight the keyword used for search in the blog. So far i managed to used the following script http://www.jquery.info/scripts/SearchHighlight/demo_en.html problem is when i try to use the same for Arabic it fails due to Unicode issue. Fiddle example: http://jsfiddle.net/gq4hkvgd/6/ var val2 = "Per id"; // var val2 = "النظر"; var options = { exact: "exact", style_name_suffix:false, keys:val2 } $('.wrapper').SearchHighlight(options); I looked for such example which can work for both english &amp; arabic but could not find. Possible solution might be in this link http://tiku.io/questions/1079426/using-regex-and-jquery-to-select-patterns-in-arabic-text but i am not able to resolve way this script to be modified to work with arabic version also.
score: 1

http://stackoverflow.com/q/28186707
downvote count: 2
linked to: http://stackoverflow.com/q/9709209
has body: I am new to JS. How to validate check box, radio button. I created the choose the best answers questions. I used radio buttton and check box for answers. Anyone give the explainations. This is my code: 1. What are JavaScript types? Number Boolean Function Undefined All the above Check Show Answer Thanks
score: -1
has comment: http://stackoverflow.com/comment/44741905
has comment: http://stackoverflow.com/comment/44741906
type: Question
answer count: 2
upvote count: 1
tagged with: validation
tagged with: javascript
has comment: http://stackoverflow.com/comment/44742121
has answer: http://stackoverflow.com/a/28186842
favorite count: 0
has comment: http://stackoverflow.com/comment/44742070
has answer: http://stackoverflow.com/a/28190752
has title: Javascript checkbox validations
type: UnansweredQuestion

http://stackoverflow.com/comment/44766873
score: 0
type: AnswerComment
type: Comment
has text: it works but can it be more prettier? I feel like it has a lot of nested function here + 1
comment on: http://stackoverflow.com/a/28200175

http://stackoverflow.com/comment/44817533
type: AnswerComment
type: Comment
has text: Sorry but I have no idea what you mean, but of a newbie
comment on: http://stackoverflow.com/a/28226599
score: 0

http://stackoverflow.com/comment/71142549
comment on: http://stackoverflow.com/a/34467815
has text: Do you suggest this to use ?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/51988366
type: Comment
comment on: http://stackoverflow.com/a/31809761
has text: Can you try from here-https://nickalchemist.wordpress.com/2015/04/08/cordova-calendar-plugin-for-windows-phone-8/ Will need some time to upload it to Github.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44944472
comment on: http://stackoverflow.com/a/28141073
type: AnswerComment
has text: You're Code example works totally fine for me (aside from an issue that he would not find the bower.json file - which is fixed now). See here for the code sample I am referring to: http://pastebin.com/idZgQ0bx - But I switched to load-grunt-config by now which is working fine for me. Chances are high, that I just had a small error in my config somewhere. Thanks for your help though!
score: 0
type: Comment

http://stackoverflow.com/comment/44934529
type: AnswerComment
comment on: http://stackoverflow.com/a/28277836
score: 0
type: Comment
has text: @BrendanMullins—for..in iterates over all enumerable properties on the object and its `Prototype` chain, so you might match an inherited property rather than an own property. *Object.keys* avoids that. It may not be required for an *ad hoc* solution, but it is for a general case.

http://stackoverflow.com/q/28219970
linked to: http://stackoverflow.com/q/3888902
score: 2
has comment: http://stackoverflow.com/comment/45197068
downvote count: 0
has answer: http://stackoverflow.com/a/28449941
has comment: http://stackoverflow.com/comment/45185058
has title: img requests before windows close
has body: I have the situation that data needs to be reliably sent before browser window closes. My current implementation is to use a synchronous AJAX calls. However that's unlikely to work in the near future because the browsers are deprecating synchronous XHR calls according to https://xhr.spec.whatwg.org/#synchronous-flag What I'm trying is to replace the ajax call with a fake "img" call, parameterize data to be sent and append it as the image's url query string. It seemed to work so far I tried. I don't really care about the server response so that as long as the request is made and pushed to the wire before browser window is unloaded. My question is how reliable it is? Has anyone gotten any expeirences? My other options is to keep the data in a cookie or webstorage and send them on the next request but that's based on the assumption that user will revisit which may not be true in my case. Thanks.
type: Question
upvote count: 2
tagged with: browser
linked to: http://stackoverflow.com/q/6869393
linked to: http://stackoverflow.com/q/3138498
tagged with: window.onunload
tagged with: javascript
has comment: http://stackoverflow.com/comment/45197478
has comment: http://stackoverflow.com/comment/45215148
tagged with: ajax
answer count: 2
linked to: http://stackoverflow.com/q/6162188
has answer: http://stackoverflow.com/a/28403618
linked to: http://stackoverflow.com/q/3584288
tagged with: onbeforeunload
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45185090
has comment: http://stackoverflow.com/comment/70422317

http://stackoverflow.com/comment/44842472
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225113
has text: Note that SlimerJS can also be run [headlessly](http://docs.slimerjs.org/current/installation.html#having-a-headless-slimerjs) if you have xvfb.

http://stackoverflow.com/a/28737739
has comment: http://stackoverflow.com/comment/49224500
has comment: http://stackoverflow.com/comment/80891301
answers question: http://stackoverflow.com/q/28250810
upvote count: 5
has comment: http://stackoverflow.com/comment/49292806
has comment: http://stackoverflow.com/comment/82142294
type: Answer
has body: It is possible to create pdf for large files. There are primarily two ways to do this : 1. html -> canvas -> image -> pdf (I assume you are trying this approach) 2. html -> pdf (does not work if html contains svg) I would suggest you to go for (2) unless you have a good reason to go for (1) (like if you are have svg content)-- it is quite expensive operation for the browser and there is possibility of the browser crashing too. 1. html -> canvas -> image -> pdf This is very neatly described here - https://github.com/MrRio/jsPDF/issues/339#issuecomment-53327389 My experience when using this method - crashes when the pdf generated contains more than 2-3 pages. (tested on latest chrome and firefox) 2. html -> pdf var pdf = new jsPDF('l', 'pt', 'a4'); var options = { pagesplit: true }; pdf.addHTML($('body'), 0, 0, options, function(){ pdf.save("test.pdf"); }); This is way faster compared to above approach. Generates pdf containing 5-6 pages in 1-2 seconds! Hope this helps!
downvote count: 0
score: 5

http://stackoverflow.com/comment/44865455
comment on: http://stackoverflow.com/a/28253314
has text: Unless you listen to click events on your `button` or `div` tags and use `Router.go` to mimic the purpose of an anchor (you don't want to do this BTW), this is impossible.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28220760
score: 3
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/92909526
downvote count: 0
tagged with: javascript
tagged with: build-process
upvote count: 3
has title: Concat and wrap in anonymous function multiple js files (build process)
tagged with: gulp
favorite count: 0
type: UnansweredQuestion
has body: I'm building a pretty big script in javascript and I wrap it in an anonymous function so it won't be in the global outer space. This should be implemented on multiple sites as a service that don't need any public api for the time being (and if and when it will be needed i'll just expose the functions it want). This is a sample of my one huge js file: "use strict"; (function() { var MyApp = {}; /************************************************************ * MyApp helpers ************************************************************/ MyApp.Helpers = {}; /** * Generate something */ MyApp.Helpers.someFunc = function() { } /************************************************************ * MyApp Widget ************************************************************/ MyApp.Widget = function() {}; /** * Create / update widget's dom element */ MyApp.Widget.prototype.build = function() { this.driver.build(); }; /************************************************************ * Widget Drivers ************************************************************/ MyApp.Widget.Drivers = {}; /************************************************************ * Some Driver ************************************************************/ MyApp.Widget.Drivers.SomeDriver = function(widget) { this.widget = widget; } /************************************************************ * Run app ************************************************************/ // Fire in the hole! MyApp.App.init(); })(); I want to break it up to multiple files under multiple directories and build it in one gulp function. As of now this the js-specific gulp task: var jsFiles = [ 'src/js/vendor/*.js', // polyfills and other non-project-specific plugins 'src/js/MyApp.js' // my huge js file ]; gulp.task('js', function () { return gulp.src(jsFiles) .pipe(concat('all.min.js')) .pipe(uglify()) .pipe(gulp.dest('build/js')); }); So.. does that even make sense or I'm just doing it wrong? and if my question is logical, how can I make it happen? Thank y…

http://stackoverflow.com/comment/44657504
has text: Also, "Page code is already present" option is basically another level of "drafting" stuff in DTM. It is meant for people who already have a legacy imp. on their site and are trying to migrate to DTM. So, it is a way to start implementing it through DTM but not actually have DTM output anything. The idea is that once you have done that, and then also removed all the legacy code from your site, you can uncheck the box and DTM will start outputting it. TBH I'm still trying to figure out why I would ever do this, instead of just not publish changes until I'm ready, but..it is what it is!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28139864

http://stackoverflow.com/q/28149730
has comment: http://stackoverflow.com/comment/44676218
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44671319
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/44671362
type: Question
has comment: http://stackoverflow.com/comment/44677807
has body: I have been creating a map of a local town center and it has taken ages, I wanted it to be in SVG so I could zoom in and out and also have 'popup' details when the cursor moves over an element. This is done in Javascript (I am a beginner!!). I have searched here and online and cobbled together something good BUT it doesn't work if I put it into a 'window' as seen here http://www.poipleshadow.com/Goa-Mapusa-Market. (scrolling and zooming breaks and the text becomes tiny!) I am hoping there is a Javascript/SVG god somewhere out there who can help The same image works here on its own http://www.poipleshadow.com/Images/Mapusa-Market.svg
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28153459
has comment: http://stackoverflow.com/comment/44671644
has comment: http://stackoverflow.com/comment/44676760
has title: SVG and Javascript not working 'online' in Chrome
tagged with: css
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/44796255
has text: Since the phone number appears to be known at page load, I would just set the correct value when loading the page instead of trying to solve things in javascript.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28215821
score: 0

http://stackoverflow.com/comment/44632757
has text: I hope the code I've amended can clarify what I meant.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28129719
type: AnswerComment

http://stackoverflow.com/comment/44859865
comment on: http://stackoverflow.com/a/28250111
has text: It doesn't instruct all the dismiss buttons. `$("#dismissButton")` only matches the first button with that ID. So every time he creates a new dismiss button, he adds a handler to the first one, none of the new ones.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28205034
downvote count: 0
tagged with: gulp
favorite count: 0
type: UnansweredQuestion
has title: gulpfile browsersync nodemon too much ram
score: 2
answer count: 0
upvote count: 2
type: Question
tagged with: javascript
tagged with: express
tagged with: browser-sync
tagged with: nodemon
has body: My gulpfile is not functioning how I'd like. When I run the default task gulp my browser is launched but hangs at waiting for localhost... in the lower left corner. If I refresh then the server works as expected. I'd also like to edit my code and get the updates showing in my browser. This feature works but gulp grows to ~300mb of ram after developing for a while. 'use strict'; process.env.DEBUG = process.env.DEBUG || 'r3dm:*'; var gulp = require('gulp'), // ## Style concat = require('gulp-concat'), stylus = require('gulp-stylus'), swiss = require('kouto-swiss'), mincss = require('gulp-minify-css'), // ## Bundle browserify = require('browserify'), watchify = require('watchify'), envify = require('envify/custom')({ NODE_ENV: 'development' }), uglifyify = require('uglifyify'), bundleName = require('vinyl-source-stream'), //brfs = require('brfs'), // ## utils plumber = require('gulp-plumber'), util = require('gulp-util'), noopPipe = util.noop, //logPipe = util.log, watch = require('gulp-watch'), yargs = require('yargs').argv, debug = require('debug')('r3dm:gulp'), // ## min imagemin = require('gulp-imagemin'), //pngcrush = require('imagemin-pngcrush'), // ## Serve/Proxy/Reload nodemon = require('gulp-nodemon'), sync = require('browser-sync'), reload = sync.reload, // ## React react = require('gulp-react'), // ## production? production = yargs.p; var paths = { main: './client.js', jsx: './components/**/**.jsx', stylusMain: './components/app.styl', stylusAll: './components/**/*.styl', css: './public/css/', server: './server.js', serverIgnore: [ 'gulpfile.js', 'public/', 'components/**/*.styl', 'bower_components/', 'node_modules/' ], publicJs: './public/js' }; var watching = false; var reloadDelay = 6500; if (production) { // ## Set with `-p` console.log('\n', 'Production mode set', '\n'); } gulp.task('stylus', function() { return gulp.src(paths.stylusMain) .pipe(plumber()) .pipe(stylus({ use: [ swiss() ], 'include css': true })) .pipe(concat('main.css')) .pipe(production…

http://stackoverflow.com/a/28181137
score: 3
has body: Maybe this will help. Angular lets you set the context (this) in forEach. It's one of the arguments. You don't have to set any other variables: angular.forEach(obj, iterator, [context]); You've passed in obj and iterator. Just pass in something for context and that will be this in the function.
downvote count: 0
answers question: http://stackoverflow.com/q/28181100
has comment: http://stackoverflow.com/comment/44731520
has comment: http://stackoverflow.com/comment/44732184
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/44731476
has comment: http://stackoverflow.com/comment/44731570

http://stackoverflow.com/comment/44736258
type: Comment
has text: [87% of users globally](http://caniuse.com/#feat=classlist) have a browser that supports it. You can say it _is_ available in many browsers.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28182807

http://stackoverflow.com/comment/44849743
comment on: http://stackoverflow.com/a/28243947
type: AnswerComment
score: 0
type: Comment
has text: can I get a jsfiddle or something? i've been screwing this up for a while now if this is not the correct way of doing it

http://stackoverflow.com/a/28136892
has comment: http://stackoverflow.com/comment/44645808
has comment: http://stackoverflow.com/comment/44645681
downvote count: 0
has comment: http://stackoverflow.com/comment/44646005
answers question: http://stackoverflow.com/q/28136787
type: Answer
has body: You could use data attribute: Content 1 $('.pop').popover({ 'trigger': 'hover', 'placement': 'bottom', 'html': true, 'content': function(){ return ' '+$(this).data('mycontent')+' '; } }); JSFiddle
has comment: http://stackoverflow.com/comment/44645723
upvote count: 1
score: 1

http://stackoverflow.com/comment/44814085
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28225306
has text: This is the second time in the last two days someone has pointed me to http://davidwalsh.name/ . Thanks I will have a look.
score: 0

http://stackoverflow.com/a/28178912
upvote count: 3
answers question: http://stackoverflow.com/q/28178800
has comment: http://stackoverflow.com/comment/44727353
type: AcceptedAnswer
type: Answer
has body: Your problem is in clickdelay.js: $(function(){ // DOM READY shorthand $('li').click(function (e) { e.preventDefault(); var goTo = this.getAttribute("href"); //&lt; do something //do something &gt; setTimeout(function(){ window.location = goTo; },500); }); }); this in this code is the li element, not the link. When you try to get the href of the li it fails and goTo is null. Then you have window.location = null;. You need to get the href of the child element, the anchor tag.
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28178800

http://stackoverflow.com/comment/45288446
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28482368
type: AnswerComment
has text: Thanks a lot for your example, it seems a lot "cleaner" to me. Though, I'm not yet a CSS pro and your approach doesn't tell me why my own approach with Javascript is not working, which my question is all about ... I may consider using your way of doing it after taking a little CSS self-schooling, but I'd like to know what's wrong with my Javascript.

http://stackoverflow.com/comment/44862614
score: 0
has text: Should I try to check if iframe is completely loaded?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28251661

http://stackoverflow.com/comment/44662367
type: Comment
type: QuestionComment
has text: There was something about information headers. and origin anonymous but I did not understand it well.
score: 0
comment on: http://stackoverflow.com/q/28145259

http://stackoverflow.com/a/28181904
has body: You need to wrap your table in a div and set the height on the div. Then you set overflow: auto on the containing div to achieve this result. http://jsfiddle.net/uh6705mx/2/
downvote count: 1
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/44734400
answers question: http://stackoverflow.com/q/28181791
score: -1

http://stackoverflow.com/comment/88676372
has text: try nicer variable names. don't use abbreviations like ptrn, just write "pattern". It's soo much easier to read!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28247319
type: AnswerComment

http://stackoverflow.com/comment/60367177
type: AnswerComment
comment on: http://stackoverflow.com/a/31559187
score: 0
type: Comment
has text: How much is the minimum?

http://stackoverflow.com/q/28139505
has answer: http://stackoverflow.com/a/28140143
has comment: http://stackoverflow.com/comment/44650842
has comment: http://stackoverflow.com/comment/44650958
tagged with: slide
upvote count: 1
linked to: http://stackoverflow.com/q/19205370
possible better answer: http://stackoverflow.com/a/28140430
has comment: http://stackoverflow.com/comment/44651240
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28140430
tagged with: onclick
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28140143
has comment: http://stackoverflow.com/comment/44650757
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Jquery slide from left to right not working
has answer: http://stackoverflow.com/a/40865165
answer count: 3
has comment: http://stackoverflow.com/comment/44650900
favorite count: 0
has body: I am trying to get a slide left from right effect in jquery when I click a div. This is the HTML I am using. Webbing in an alternative social network. based on intrests and interactions between people all over the world. And this is the jquery I am trying to use. $(function() { $("#toggle").click(function () { $(".sliding").css("display","none"); //$(".sliding").animate({left:'-240px'}); // Set the effect type var effect = 'slide'; // Set the options for the effect type chosen var options = { direction: 'left' }; // Set the duration (default: 400 milliseconds) var duration = 10000; $('#myDiv').toggle(effect, options, duration); }); What I have achieved is the div is displaying onclick, but it is not sliding out in from left to right. Please help me out. I appreciate your help. Thanks. I added the jsfiddle link as well. http://jsfiddle.net/yLyr599z/
has comment: http://stackoverflow.com/comment/44650878

http://stackoverflow.com/comment/44660965
type: QuestionComment
comment on: http://stackoverflow.com/q/28139864
score: 0
has text: In the tool custom code you can write logic to set s.abort to true if other page code exists if the other code has already loaded
type: Comment

http://stackoverflow.com/q/28145543
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44663064
possible better answer: http://stackoverflow.com/a/28145583
has answer: http://stackoverflow.com/a/28145557
accepted answer: http://stackoverflow.com/a/28145557
type: Question
answer count: 2
tagged with: javascript
has body: I have lots of dynamic textboxes with different ids. I am trying to remove them on click i have a function &lt;script&gt; function removing(id){ alert(id); id.remove(); } &lt;/script&gt; and my html textbox &lt;input type="text" id="a" name="name" onclick="removing(this.id)" /&gt; when i click on it. it gives alert box but not removing textbox any help?
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has title: How to remove textbox using dynamic id in javascript?
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28145583
score: 2

http://stackoverflow.com/a/30282847
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28124554
has body: The following TypeScript works fine with PIXI v3.0.3 SpriteFromPoints(graphics, points /*PIXI.Point[]*/, bounds /*{x, y, width, height}*/, isInteractive) { var polygon = graphics.drawPolygon(points); var zoneSprite = new PIXI.Sprite(polygon.generateTexture(1, (&lt;any&gt;PIXI).SCALE_MODES.DEFAULT));// no d.ts yet for v3 zoneSprite.position.x = bounds.x; zoneSprite.position.y = bounds.y; zoneSprite.interactive = isInteractive || false; if (zoneSprite.interactive) { // can't assign the polygon from above for whatever reason // seems to be a different type and doesn't have the contains method zoneSprite.hitArea = new PIXI.Polygon(points); } return zoneSprite; } Adding the sprite returned, the hit area is what I expected.
answers question: http://stackoverflow.com/q/28124554
type: AcceptedAnswer

http://stackoverflow.com/comment/79104649
type: AnswerComment
comment on: http://stackoverflow.com/a/28250693
type: Comment
has text: @UAvalos While I agree with this being the best answer (from a FP perspective), I disagree with your comparison. FRP is about events, behaviors, event streams and suitable combinators. The only overlap with `Promise`s it that both happen to deal with asynchronous control flows and share a "monad-like" structure.
score: 0

http://stackoverflow.com/comment/44628275
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28127607
has text: Try trimming off the first and last characters (e.g. with `substr`) before splitting by using a method
score: 0

http://stackoverflow.com/comment/44806238
type: AnswerComment
type: Comment
has text: " s
comment on: http://stackoverflow.com/a/28221616
score: 0

http://stackoverflow.com/comment/44791766
has text: @Venkat: Using `val` on elements that aren't form fields, as in that other answer, is a bad idea; there's no guarantee at all it'll work correctly cross-browser.
comment on: http://stackoverflow.com/a/28213780
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44737817
comment on: http://stackoverflow.com/a/28184195
score: 0
type: AnswerComment
has text: Are you trying to calculate the width of multiple elements?
type: Comment

http://stackoverflow.com/q/28141793
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: OnsenUI pushPage doesn't load page
has body: Looks like I'm overseeing something. I just started with OnsenUI. I used the standard Tabbar Option and didn't really change anything in the . I have this in my index.html City1 and I made a new template too: <ons-template id="City1.html"> City1 I want to slide into City1.html after clicking on City1. What am I doing wrong?
tagged with: onsen-ui
has answer: http://stackoverflow.com/a/28151633
has answer: http://stackoverflow.com/a/28144063
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
score: 2

http://stackoverflow.com/comment/44876187
type: QuestionComment
score: 0
type: Comment
has text: @trusktr: **`foo` doesn't _have_ a `this`**. `foo()` passes `window` (the global object) as `this`; nothing is stored anywhere.
comment on: http://stackoverflow.com/q/28258800

http://stackoverflow.com/comment/53335567
has text: @aIMAC I'm not quite sure because my code has changed since then, but I'm pretty sure you can just call: `this.fromImage(image)` inside the constructor since fromImage() is a method of PIXI.Sprite.
comment on: http://stackoverflow.com/a/28142227
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28275214
type: AnsweredQuestion
type: Question
tagged with: polymer
has answer: http://stackoverflow.com/a/28275271
tagged with: javascript
has title: Polymer animated-pages can't change page
score: 0
answer count: 1
has body: I can't change the page when i click the button in the logincard element. In the logincard element i have set the button's on-tap to {{onSignUp}} What should i do? I get the error message: Uncaught TypeError: Cannot read property 'selected' of null
has comment: http://stackoverflow.com/comment/44921079
accepted answer: http://stackoverflow.com/a/28275271

http://stackoverflow.com/a/31124382
type: Answer
answers question: http://stackoverflow.com/q/28252768
has comment: http://stackoverflow.com/comment/56944544
upvote count: 5
has body: As the other responder said, what you are looking for is an Isomorphic approach. This allows the page to come from the server with the rendered content that will be parsed by search engines. As another commenter mentioned, this might make it seem like you are stuck using node.js as your server-side language. While it is true that have javascript run on the server is needed to make this work, you do not have to do everything in node. For example, this article discusses how to achieve an isomorphic page using Scala and react: Isomorphic Web Design with React and Scala That article also outlines the UX and SEO benefits of this sort of isomorphic approach.
score: 5
downvote count: 0

http://stackoverflow.com/comment/44892518
type: AnswerComment
has text: I tried break, but it didn't end the loop. I also tried putting break after the if loop, but the output says undefined instead of "No input"
type: Comment
comment on: http://stackoverflow.com/a/28268156
score: 0

http://stackoverflow.com/q/28124578
tagged with: node.js
has comment: http://stackoverflow.com/comment/44622605
upvote count: 1
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/4968406
has answer: http://stackoverflow.com/a/28124621
tagged with: javascript
score: 0
answer count: 1
has title: Understanding Object.keys in javascript
favorite count: 0
has body: I have a following object: var sample = { count: { '20-01-2015/17': { 'a': 553056, 'b': 622123 }, '20-01-2015/18': { 'a': 519008, 'b': 610474 } } } I want to find all the keys for count property. Also, all the keys for 20-01-2015/17 property also. var times = Object.keys(sample.count); console.log(times); var time = '20-01-2015/17' //This works var props = Object.keys(sample.count[time]); console.log(props); //But this doesn't work. I am not able to understand that. props = Object.keys(sample.count.time); console(props) I didn't understand why the first approach is working, but not the second one.
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/4968406

http://stackoverflow.com/a/28192567
type: Answer
answers question: http://stackoverflow.com/q/28192384
downvote count: 1
has comment: http://stackoverflow.com/comment/44753145
has comment: http://stackoverflow.com/comment/44752791
score: -1
upvote count: 0
has body: d3nm4k. The code in my example does what you want. Maybe you got the problem with the short opening tags that is &lt; ? ? >. The file I'm trying to load in my example is located in app/View/Tests/def.php and works just fine. Hope it helped you! &lt;div class='content'&gt;&lt;/div&gt; &lt;?php $fileLocation = APP . 'View/Tests/def.php'; // Ensure the file exists echo "FILE EXISTS: &lt;b&gt;" . (file_exists($fileLocation) ? "TRUE" : "FALSE") . "&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;"; ?&gt; &lt;?php // Alternatively, you can try this one //include $fileLocation; ?&gt; &lt;script type='text/javascript'&gt; $('.content').html("&lt;?php include($fileLocation); ?&gt;"); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/44752881
has comment: http://stackoverflow.com/comment/44752997

http://stackoverflow.com/q/28209552
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28517724
favorite count: 0
tagged with: android
has comment: http://stackoverflow.com/comment/45425598
type: AnsweredQuestion
has body: I am trying to just hook a webview to display a certain web page.The website seems to have changed its UI to include a lot of transitions and animations. These animations while working on a laptop weren't working on Chrome yesterday. Until we updated Chrome to Version 18.0.1025308 . Now they work on Android chrome i.e. we can see the modal pop up JS screens. But the webview's don't. A blank blue screen comes on top of the screen and stops responding. This was also the behaviour on the browser also until we updated it to the latest chrome version. I think this is a significant point here. I don't see any changes made to the WebChromeClient API. The window in chrome browser as shown below. React JS is being used. In Webview So instead of the popup a blue screen comes over the screen and nothing can be done to it Additional details Hardware acceleration already is enabled. We tried toggling this to see if it made any difference but it doesn't. We are using a WebChromeClient so that JS is enabled. All the other parts of the site are working as intended. Any ideas on where to look for the problem would be appreciated. We just use webchromeclient and don't do anything fancy. All webview plugins are enabled.
has title: Different behaviour of JS Popups in Chrome Browser and Webchrome client in Android
score: 1
accepted answer: http://stackoverflow.com/a/28517724
tagged with: webview
upvote count: 1
tagged with: google-chrome
type: Question
linked to: http://stackoverflow.com/q/22459735
tagged with: javascript

http://stackoverflow.com/a/28229729
accepted answer of: http://stackoverflow.com/q/28225530
has comment: http://stackoverflow.com/comment/44850353
has body: TL;DNR Array is not a built-in type for HTML. You should pass string like "[1,2,3]" rather than the array itself ([1,2,3]) which would be transparently converted to string '1,2,3' (note a lack of square brackets around.) Let’s simplify your snippet to find the problem out. First of all, we’ll define the fake chart-pie component to assure that the problem is not induced. {{ values }} Now we’ll try to pass both array and string to the element: {{ chart }} Comparing outputs now, we’ll see, that the correct way to pass an argument is: Internal Array#toString(), unfortunately drops square brackets around the array. So, to make it working you need to convert the array to string itself. E.g. '[' + myArray.join(',') + ']'. UPD: I can’t yet understand the reason, but the string for chart values in the case with chart-pie should be explicitly cast to an array: ... Polymer({ arrayize: function(el) { return JSON.parse(el); } });
answers question: http://stackoverflow.com/q/28225530
has comment: http://stackoverflow.com/comment/44848863
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/44883172
score: 1
comment on: http://stackoverflow.com/q/28263156
type: QuestionComment
has text: I hope the duplicate I've chosen answers your question, even if the question is not the same.
type: Comment

http://stackoverflow.com/a/28130020
upvote count: 0
type: Answer
has body: A thought on this is that SQLite database files have to be writable by the server. (chmod 777). By default you can read from the database but not DELETE or modify. Inspect your database file for write permissions and make sure writable is enabled. Hope that works.
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28129063

http://stackoverflow.com/q/28135705
tagged with: readonly
tagged with: javascript
has comment: http://stackoverflow.com/comment/44647662
has body: I have discovered that setCustomValidity tooltip is not working on readonly input fields. It actually makes sense because , editable fields are only available for validation. How can I show alert message customValidation for readonly fields ? thx
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28138085
has comment: http://stackoverflow.com/comment/44643428
tagged with: customvalidator
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44643477
accepted answer: http://stackoverflow.com/a/28138085
has title: how to set customvalidity on a readonly input field
type: Question

http://stackoverflow.com/q/28125554
tagged with: ecmascript-6
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
score: 13
possible better answer: http://stackoverflow.com/a/28430619
has body: I'm still a beginner, i try to to export and import one class into a main file, the other class in the others class file and use them. And then gulp ES5 code with 6to5 (now Babel). // file a.js import B from 'b.js'; class A { constructor() { B.methodB(); } } export default A; // file b.js class B { methodB() { console.log('hi from b'); } } export default B; // file main.js import A from 'a.js'; new A(); My gulpfile: var gulp = require('gulp'); var to5 = require('gulp-6to5'); gulp.task('default', function () { return gulp.src('main.js') .pipe(to5()) .pipe(gulp.dest('dist')); }); And this is my dist/main.js file: "use strict"; var _interopRequire = function (obj) { return obj &amp;&amp; (obj["default"] || obj); }; var A = _interopRequire(require("a.js")); new A(); The error in console: ReferenceError: require is not defined Which of course does not work ... what am I doing wrong or what lack I yet? I do not get it exactly.
has answer: http://stackoverflow.com/a/28430619
has comment: http://stackoverflow.com/comment/44627487
has title: Javascript 6to5 (now Babel) export module usage
has answer: http://stackoverflow.com/a/28269436
has comment: http://stackoverflow.com/comment/44624806
upvote count: 13
tagged with: babeljs
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44624430
accepted answer: http://stackoverflow.com/a/28269436
linked to: http://stackoverflow.com/q/28087674

http://stackoverflow.com/a/28154507
has comment: http://stackoverflow.com/comment/44680730
score: 1
upvote count: 1
has body: You must pass to delete the key of the record, and you defined timeStamp to be the key, not text. Replace html5rocks.indexedDB.deleteTodo(row.text); with html5rocks.indexedDB.deleteTodo(row.timeStamp); Demonstration
has comment: http://stackoverflow.com/comment/44680719
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28154397
has comment: http://stackoverflow.com/comment/44680774
accepted answer of: http://stackoverflow.com/q/28154397
type: Answer
has comment: http://stackoverflow.com/comment/44680833

arrays
tags question: http://stackoverflow.com/q/28264386
tags question: http://stackoverflow.com/q/28168572
tags question: http://stackoverflow.com/q/28210667
tags question: http://stackoverflow.com/q/28265850
tags question: http://stackoverflow.com/q/28163514
tags question: http://stackoverflow.com/q/28197179
tags question: http://stackoverflow.com/q/28178120
tags question: http://stackoverflow.com/q/28263709
type: Tag
tags question: http://stackoverflow.com/q/28198200
tags question: http://stackoverflow.com/q/28226049
tags question: http://stackoverflow.com/q/28147641
tags question: http://stackoverflow.com/q/28270364
tags question: http://stackoverflow.com/q/28166993
tags question: http://stackoverflow.com/q/28136129
tags question: http://stackoverflow.com/q/28124204
tags question: http://stackoverflow.com/q/28276433
tags question: http://stackoverflow.com/q/28212681
tags question: http://stackoverflow.com/q/28240984
tags question: http://stackoverflow.com/q/28202744
tags question: http://stackoverflow.com/q/28201488
tags question: http://stackoverflow.com/q/28268203
tags question: http://stackoverflow.com/q/28259917
tags question: http://stackoverflow.com/q/28202359
tags question: http://stackoverflow.com/q/28253540
tags question: http://stackoverflow.com/q/28234904
tags question: http://stackoverflow.com/q/28236260
tags question: http://stackoverflow.com/q/28245571
tags question: http://stackoverflow.com/q/28225782
tags question: http://stackoverflow.com/q/28228663
tags question: http://stackoverflow.com/q/28139154
tags question: http://stackoverflow.com/q/28271043
tags question: http://stackoverflow.com/q/28132494
tags question: http://stackoverflow.com/q/28237163
tags question: http://stackoverflow.com/q/28205234
tags question: http://stackoverflow.com/q/28186017
tags question: http://stackoverflow.com/q/28140772
tags question: http://stackoverflow.com/q/28269228
tags question: http://stackoverflow.com/q/28139962
tags question: http://stackoverflow.com/q/28164405
tags question: http://stackoverflow.com/q/28240173
tags question: http://stackoverflow.com/q/28138155
tags question: http://stackoverflow.com/q/28170707
tags question: http://stackoverflow.com/q/28129409
tags question: http://stackoverflow.com/q/28238082
tags question: http://stackoverflow.com/q/28268635
tags question: http://stackoverflow.com/q/28131173
tags question: http://stackoverflow.com/q/28159283
tags question: http://stackoverflow.com/q/28205654
tags question: http://stackoverflow.com/q/28277782
tags question: http://stackoverflow.com/q/28260659
tags question: http://stackoverflow.com/q/28204280
tags question: http://stackoverflow.com/q/28170143
tags question: http://stackoverflow.com/q/28243850
tags question: http://stackoverflow.com/q/28234004
tags question: http://stackoverflow.com/q/28228327
tags question: http://stackoverflow.com/q/28256506
tags question: http://stackoverflow.com/q/28184948
tags question: http://stackoverflow.com/q/28275473
tags question: http://stackoverflow.com/q/28178578
tags question: http://stackoverflow.com/q/28179509
tags question: http://stackoverflow.com/q/28237707
tags question: http://stackoverflow.com/q/28207007
tags question: http://stackoverflow.com/q/28226898
tags question: http://stackoverflow.com/q/28235300
tags question: http://stackoverflow.com/q/28261625
tags question: http://stackoverflow.com/q/28263773
tags question: http://stackoverflow.com/q/28278486
tags question: http://stackoverflow.com/q/28242404
tags question: http://stackoverflow.com/q/28142424
tags question: http://stackoverflow.com/q/28187213
tags question: http://stackoverflow.com/q/28185001
tags question: http://stackoverflow.com/q/28262971
tags question: http://stackoverflow.com/q/28139116
tags question: http://stackoverflow.com/q/28135844
tags question: http://stackoverflow.com/q/28243775
tags question: http://stackoverflow.com/q/28249381
tags question: http://stackoverflow.com/q/28181384
tags question: http://stackoverflow.com/q/28197739
tags question: http://stackoverflow.com/q/28202764

http://stackoverflow.com/q/28202427
favorite count: 0
has title: Sails: how to properly join two tables?
linked to: http://stackoverflow.com/q/19480008
has body: I have two models: Node and NodeMessage. They share a many-to-many relationship (There are messages in the nodes and a message can be in more than one node) Node module.exports = { attributes: { [...] // Messages within the node messages: { collection: 'NodeMessage', via: 'nodes' }, [...] } NodeMessage module.exports = { attributes: { [...] // Nodes where this message appear nodes: { collection: 'Node', via: 'messages' }, // Users who liked this message likes: { collection: 'User', via: 'likes' } [...] } } It's a basic Many-to-Many sails relationship. Now I want to get all the messages contained in a group of Nodes. I mean, lets take 1 node and its 8 neighbors (9 in total): I want to get all the messages of these nodes. I have been able to retrieve these messages by querying the nodes and using populate (messages), but I need to populate the likes attribute of these messages, which I can't. The solution I am considering is to get all the IDs of these not populated messages and make another query so as to get them, but this would mean 2 queries and that wouldn't make me happy :( Any suggestions? Thanks in advance.
tagged with: node.js
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/54325000
type: Question
tagged with: sails.js
tagged with: many-to-many
score: 1
has comment: http://stackoverflow.com/comment/54329296
tagged with: waterline
upvote count: 1
tagged with: javascript

python
tags question: http://stackoverflow.com/q/28229306
tags question: http://stackoverflow.com/q/28222705
tags question: http://stackoverflow.com/q/28235956
tags question: http://stackoverflow.com/q/28269998
tags question: http://stackoverflow.com/q/28253168
tag name: python
tags question: http://stackoverflow.com/q/28262069
tags question: http://stackoverflow.com/q/28173352
tags question: http://stackoverflow.com/q/28237111
tags question: http://stackoverflow.com/q/28204466
tags question: http://stackoverflow.com/q/28224737
tags question: http://stackoverflow.com/q/28126852
tags question: http://stackoverflow.com/q/28124306
tags question: http://stackoverflow.com/q/28216298
tags question: http://stackoverflow.com/q/28128803
tags question: http://stackoverflow.com/q/28200686
type: Tag
tags question: http://stackoverflow.com/q/28151729
tags question: http://stackoverflow.com/q/28226675
tags question: http://stackoverflow.com/q/28170340
tags question: http://stackoverflow.com/q/28132494
tags question: http://stackoverflow.com/q/28230170
tags question: http://stackoverflow.com/q/28264024
tags question: http://stackoverflow.com/q/28275075
tags question: http://stackoverflow.com/q/28147213
tags question: http://stackoverflow.com/q/28162090
tags question: http://stackoverflow.com/q/28258579
tags question: http://stackoverflow.com/q/28151584

http://stackoverflow.com/comment/46154346
type: Comment
comment on: http://stackoverflow.com/a/28787808
has text: Hey @Chris, WP8 is just a bit different, I've updated the answer.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28196670
upvote count: 1
type: Question
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44760466
has answer: http://stackoverflow.com/a/28197699
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/44760403
has comment: http://stackoverflow.com/comment/44762331
type: UnansweredQuestion
has body: I was wondering if it's possible to pass an array of IDs or strings via the URL attribute in a Backbone Collection? I'd like to do something like this: var MyCollection = Backbone.Collection.extend({ url: '/api/mystuff/categoryID', getStuff: function(ArrayOfThings) { this.fetch({ url: this.url + '/' + ArrayOfThings }); } }); And call it like this: ArrayOfThings = [12342, 364556, 333236, 33763, 4212456433221, 335] var myCollection = new MyCollection(); myCollection.getStuff(ArrayOfThings); So I tried that, but my URL string looks like this: api/mystuff/theCategoryID/12342,364556,333236,33763,4212456433221,335 Which my server does not like. I was wondering if there is a way to do this. Thanks!
has title: Pass an array or object via the URL
has comment: http://stackoverflow.com/comment/44760554

http://stackoverflow.com/a/28185965
has comment: http://stackoverflow.com/comment/44740711
answers question: http://stackoverflow.com/q/28185809
has body: getHours returns the range 0-23, so if it's greater than 11, subtract 12. You could even get fancy and do like (getHours() + 24) % 12 || 12
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44740929

http://stackoverflow.com/comment/44726248
comment on: http://stackoverflow.com/a/28177785
type: Comment
has text: fixed! replies[i] was just replies, sorry. seems to hang though, not sure why.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44872681
type: Comment
type: QuestionComment
has text: Yes, public is included in my route. 4 version. public/js/MyScript.js - location of Js files. I'am using xamp with Apache 2.4. Without using php artisan serve
score: 0
comment on: http://stackoverflow.com/q/28255851

http://stackoverflow.com/comment/44632425
comment on: http://stackoverflow.com/q/28129474
score: 0
type: Comment
has text: I added the hole file with the code. I simply cannot figure out what can cause this. Its part of a larger project and its been working fine. Need to backtrace what changed.
type: QuestionComment

http://stackoverflow.com/q/28231451
downvote count: 0
tagged with: javascript
tagged with: template-engine
has body: When I'm converting my jade to html, I'm getting this error in index.jade: /usr/local/lib/node_modules/jade/lib/runtime.js:231 throw err; ^ TypeError: index.jade:50 48| i.fa.fa-plus-square 49| | Add new Question &gt; 50| li 51| a(runat='server', href='/q/about') 52| i.fa.fa-question-circle 53| | About Cannot read property 'length' of undefined at jade_debug.unshift.lineno (eval at &lt;anonymous&gt; (/usr/local/lib/node_modules/jade/lib/index.js:216:8), &lt;anonymous&gt;:331:31) at eval (eval at &lt;anonymous&gt; (/usr/local/lib/node_modules/jade/lib/index.js:216:8), &lt;anonymous&gt;:428:4) The index.jade at line number 50 looks like: .navbar.navbar-default.navbar-fixed-top .container .navbar-header button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse') span.icon-bar span.icon-bar span.icon-bar a.navbar-brand(runat='server', href='/') i.fa.fa-home | The Strings Project .navbar-collapse.collapse ul.nav.navbar-nav li a(runat='server', href='/q') i.fa.fa-list-ul | Questions li a(runat='server', href='/q/new') i.fa.fa-plus-square | Add new Question li a(runat='server', href='/q/about') i.fa.fa-question-circle | About li a(runat='server', href='#') i.fa.fa-phone-square | Contact Kindly suggest me where I have gone wrong? I'm using ejs as my template engine and running nodejs on an express server. Here's the picture with line numbers as well:
has comment: http://stackoverflow.com/comment/82679152
has comment: http://stackoverflow.com/comment/44844273
favorite count: 0
tagged with: ejs
has title: Cannot read property 'length' of undefined jade to html
tagged with: node.js
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44841146
score: 1
tagged with: pug

http://stackoverflow.com/q/28142332
downvote count: 0
has answer: http://stackoverflow.com/a/28144480
tagged with: javascript
tagged with: jquery
has title: CodeMirror extracting code and render HTML not working
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: codemirror
score: 1
has body: I've been messing around with CodeMirror to provide my textarea with syntax highlighting for HTML, but I also want to be able to click a button to render the HTML code in a separate div. This is what I have for my functions so far: &lt;script&gt; /*create the CodeMirror editor*/ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true}); /*Grab the text from the editor and return it*/ function extractCode() { var text = editor.mirror.getValue(); return text; } &lt;/script&gt; &lt;script&gt; /*When the showmeImg image is clicked, grab the code with extractCode and send it to the output div*/ $(document).ready(function(){ $("#showmeImg").click(function(){ $("#output").html($(extractCode).val()); }); }); &lt;/script&gt; I'm fairly new to javascript and jquery so I'm not sure if I'm doing this right at all. Any help is appreciated!
upvote count: 1
type: Question

http://stackoverflow.com/comment/44799074
has text: My only thought on the error with 'us' : { is that you may have removed the comma that is supposed to go after the proceeding country.
type: QuestionComment
comment on: http://stackoverflow.com/q/28201857
score: 0
type: Comment

http://stackoverflow.com/q/28257924
linked to: http://stackoverflow.com/q/22943892
tagged with: ruby-on-rails
answer count: 1
has comment: http://stackoverflow.com/comment/44881488
has answer: http://stackoverflow.com/a/30541688
has body: I have models: idea,item,product. I'm trying to add Products to Ideas through Items in a view of Idea's editing. My edit.html.erb - Idea &lt;div id="items"&gt; &lt;%= render @idea.items %&gt; &lt;/div&gt; &lt;div class="products"&gt; &lt;% @products.each do |p| %&gt; &lt;%= p.title %&gt;&lt;%= button_to '+', items_path(product_id: p.id, idea_id: @idea.id), remote: true %&gt; &lt;% end %&gt; &lt;/div&gt; My items controller: def create product = Product.friendly.find(params[:product_id]) @item = @idea.add_product(product.id) respond_to do |format| if @item.save format.js end end end idea.rb def add_product(product_id) item = items.find_by(product_id: product_id) if item else item = items.build(product_id: product_id) end item end My "create.js.erb" $('#items').html("&lt;%= escape_javascript render(@idea.items) %&gt;"); When I put "format.html {redirect_to :back}" in def create (items_controller) everything goes OK, but without AJAX=( Logs Completed 406 Not Acceptable in 91ms ActionController::UnknownFormat (ActionController::UnknownFormat): app/controllers/items_controller.rb:33:in `create' Help me, guys. I have googled the whole internet
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44881516
has comment: http://stackoverflow.com/comment/44876206
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/29310187
accepted answer: http://stackoverflow.com/a/30541688
type: Question
has comment: http://stackoverflow.com/comment/44874128
tagged with: ruby
has title: "ActionController::UnknownFormat" as a result of using AJAX with format.js
upvote count: 2

http://stackoverflow.com/a/28166136
score: 0
has comment: http://stackoverflow.com/comment/44735416
type: Answer
has body: you could use this selector var bookName="any bookName " ; var theBookTD = $("#booktable tr td:nth-child(1):contains('"+ bookName+"')"); if (theBookTD.length&gt;0 ) { //the book already exists in table var theBookQuantity = theBookTD.next().first().text(); }else { // the book doesn't exist in table; } take a look here http://jsfiddle.net/buuk2zjf/3/
has comment: http://stackoverflow.com/comment/44702969
has comment: http://stackoverflow.com/comment/44703395
has comment: http://stackoverflow.com/comment/44703072
answers question: http://stackoverflow.com/q/28165878

http://stackoverflow.com/q/28153390
favorite count: 0
tagged with: html-lists
tagged with: css
type: AnsweredQuestion
has title: Issue using :after selector to display icon in conjunction with slideToggle()
possible better answer: http://stackoverflow.com/a/28153612
has body: I am building out a mobile navigation menu and I am applying an icon to li elements which contain children(a dropdown arrow). I am applying the icon using the :after pseudo selector. The issue is that when I use slideToggle to open/close the menu, the arrow icons appear before the menu has slid into place. Is there any way to prevent this or will I have to use a different approach? #navbar li.has-child &gt; a:after { color: red; content: ' ▸'; display:inline-block; position:absolute; right:30px; } #navbar li.has-child &gt; a.open:after { content: ' ▾'; } Here's a JSFiddle to demonstrate the issue.
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/28153491
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/28153612
has answer: http://stackoverflow.com/a/28153491
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44679205
score: 0
type: AnswerComment
has text: your correct, it needs little tweaking, on start the deliver is visible and required, when pickup no textarea and not required. After adding a submit button it didn't work correct. I like this script thow
type: Comment
comment on: http://stackoverflow.com/a/28153415

http://stackoverflow.com/comment/44698170
has text: @gengkev Yes, I understand. From this post http://stackoverflow.com/questions/14426841/get-passwords-from-chrome I see there is no easy way of implementing this. Native client seems to be an alternative for NPAPI plugin. Might that work?
comment on: http://stackoverflow.com/q/28153982
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44774482
score: 0
type: Comment
has text: if you comment out that line, it will work. where are you getting the variable "type" from?
comment on: http://stackoverflow.com/a/28204037
type: AnswerComment

http://stackoverflow.com/q/28136275
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
has title: jquery ajax call on button click validation not working
has comment: http://stackoverflow.com/comment/44644487
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28136303
has body: I'm submitting a form on a btn click using jquery ajax call. I'm doing form validation and if input is not valid then need to stop the ajax call. I've tried the following code but form submits every time even when the conditions fail &lt;script type="text/javascript"&gt; $(document).ready(function () { $('#btnSubmit').click(function (evt) { if (ValidateUserInput()) { $.ajax({ type: 'GET', url: '@Url.Action("SearchResults", "Request")', data: { searchTerm: $("#searchTerm").val(), searchFilter: $("#searchFilter").val() }, success: function (data) { $('#Results').html(data); } }); } }); }); function ValidateUserInput() { if ($('#searchFilter').val() == 'RequestId' &amp;&amp; $('#searchTerm').val() != parseInt($('#searchTerm').val())) { $('#HiddenInvalidInputContainer').show(); return false; } else { alert('testing'); $('#HiddenInvalidInputContainer').hide(); return true; } } &lt;/script&gt; Any ideas?
score: 0
has answer: http://stackoverflow.com/a/28136303
answer count: 1

http://stackoverflow.com/q/28159142
upvote count: 2
has comment: http://stackoverflow.com/comment/44689775
has comment: http://stackoverflow.com/comment/44689879
has comment: http://stackoverflow.com/comment/44689651
linked to: http://stackoverflow.com/q/4793604
downvote count: 1
has comment: http://stackoverflow.com/comment/44690096
has comment: http://stackoverflow.com/comment/44689993
has comment: http://stackoverflow.com/comment/44690640
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28160200
has comment: http://stackoverflow.com/comment/44690512
score: 1
has answer: http://stackoverflow.com/a/28161113
has title: Javascript / Save input data into a table cell
has comment: http://stackoverflow.com/comment/44690174
possible better answer: http://stackoverflow.com/a/28160200
type: Question
has comment: http://stackoverflow.com/comment/44690994
answer count: 2
accepted answer: http://stackoverflow.com/a/28161113
has body: The structure is: You click on a cell, The pop-up window appears, You type something on the input fields. What I want is to store the typed data into the cell which was clicked. This could be perfectly done with Angular.js, but I need to do it using Javascript only (no frameworks, libraries etc.). Here's my table with the pop-up window where the input fields are. I have been trying to store the data simply by using .innerHTML method, but it just deletes the dates and inserts my text. var cell = document.getElementsByTagName('td'); for (var i=0; i&lt;cell.length; i++) { cell[i].onclick = function() { var data = this.getAttribute('data-cell'); editEvent = document.getElementById('addevent');//The pop-up window editEvent.style.cssText ='display: block;'; this.style.position = 'relative'; this.innerHTML = " "//??? I want the inputs data to be inserted here I also have those input data stored in localStorage. Perhaps, there's an easier way to transfer the data from localStorage into the cell? Because it is exactly what I need there. Please, help! Thank you in advance!
tagged with: javascript
has comment: http://stackoverflow.com/comment/44689831
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44690882
favorite count: 0
has comment: http://stackoverflow.com/comment/44689819
has comment: http://stackoverflow.com/comment/44690163
has comment: http://stackoverflow.com/comment/44689694
has comment: http://stackoverflow.com/comment/44699481

http://stackoverflow.com/q/28220306
has body: I have a question regarding scope chain in javascript. I have the following code: var num = 10; function addFunction(num){ var fun = function(num2) { return num + num2; } num++; return fun; } console.log(addFunction(5)(5)); I am not sure why it will print 11 in the console. can someone help me with that? i thoug that it will print 15. though i'm having hard time to understand the scope of the function. Thanks
has comment: http://stackoverflow.com/comment/44805745
has answer: http://stackoverflow.com/a/28253409
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/50770490
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/31397463
has title: Function scope chain - javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28220437

http://stackoverflow.com/q/28140705
score: 30
favorite count: 0
has answer: http://stackoverflow.com/a/75862209
tagged with: jquery-select2
upvote count: 30
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/79246970
has answer: http://stackoverflow.com/a/79247147
tagged with: css
has answer: http://stackoverflow.com/a/28141064
has answer: http://stackoverflow.com/a/73714079
has comment: http://stackoverflow.com/comment/70568018
has answer: http://stackoverflow.com/a/35899306
has answer: http://stackoverflow.com/a/61059820
type: Question
has title: select2 MULTIPLE placeholder does not work
has answer: http://stackoverflow.com/a/64271681
has answer: http://stackoverflow.com/a/69631303
tagged with: placeholder
has answer: http://stackoverflow.com/a/73009327
tagged with: javascript
answer count: 16
has answer: http://stackoverflow.com/a/59887496
has answer: http://stackoverflow.com/a/63066397
has answer: http://stackoverflow.com/a/30738457
has answer: http://stackoverflow.com/a/53579596
has answer: http://stackoverflow.com/a/52898977
has answer: http://stackoverflow.com/a/60261810
has body: I'm using the following piece of code to select item but placeholder already is not visible. I am using this example select2-bootstrap ahoj more ideme na pivo? $(document).ready(function () { $("#select2").select2({ multiple:true, placeholder: "haha", });
downvote count: 0

http://stackoverflow.com/comment/44697374
score: 0
type: Comment
has text: So based on the first date in the range, you want the corresponding nth ordinal week day for each month? E.g. if the first date is the 2nd Monday of the month, get the second Monday for each month in the range?
type: AnswerComment
comment on: http://stackoverflow.com/a/28163096

http://stackoverflow.com/q/28168020
has answer: http://stackoverflow.com/a/28168061
type: AnsweredQuestion
has title: How can I check if all radio buttons are checked
has body: I have a number of radio buttons with the option, 'yes' or 'no'. Is there a simple way with jQuery to check if they all have 'yes' selected? HTML is: &lt;input type="radio" id="yes1" name="group1" value="yes"&gt;Yes&lt;br&gt; &lt;input type="radio" name="group1" value="No"&gt;No&lt;br&gt; &lt;hr&gt; &lt;input type="radio" id="yes2" name="group2" value="yes"&gt;Yes&lt;br&gt; &lt;input type="radio" name="group2" value="No"&gt;No&lt;br&gt; &lt;hr&gt; &lt;input type="radio" id="yes3" name="group3" value="yes"&gt;Yes&lt;br&gt; &lt;input type="radio" name="group3" value="No"&gt;No&lt;br&gt; I'm guessing it's something along the lines of yes1 = $("#yes1").prop("checked", true); yes2 = $("#yes2").prop("checked", true); yes3 = $("#yes2").prop("checked", true); if (yes1 &amp; yes2 &amp; yes3) { // do something ? }
has answer: http://stackoverflow.com/a/28169989
has answer: http://stackoverflow.com/a/52190462
possible better answer: http://stackoverflow.com/a/28168079
type: Question
has answer: http://stackoverflow.com/a/28168079
tagged with: javascript
tagged with: jquery
answer count: 6
score: 0
accepted answer: http://stackoverflow.com/a/28168061
has answer: http://stackoverflow.com/a/28168538
has answer: http://stackoverflow.com/a/28169321

http://stackoverflow.com/comment/44729085
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28179950
has text: Also, what is your HTML structure?

http://stackoverflow.com/q/28165397
type: Question
has comment: http://stackoverflow.com/comment/44701377
has title: Find an Object by id via angular
has comment: http://stackoverflow.com/comment/44701116
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44701206
has body: I'm currently handing down JSON data from Rail in the DOM. It looks like this: &gt; gon.posts [ { id: 1, name: "Post 1", related_post_ids: [3] }, { id: 2, name: "Post 2", related_post_ids: [2, 3] }, { id: 3, name: "Post 3", related_post_ids: [1, 2] } ] How would I be able to write some AngularJS (I'm ruby) so that I could execute this pseudocode: // Using "Post 1" and mapping to its related posts. &gt; gon.posts[0].related_posts [ { id: 3, name: "Post 3", related_post_ids: [1, 2] } ] // Then being able to do this recursively to make development with the JSON easier: &gt; gon.posts[0].related_posts[0].related_posts [ { id: 1, name: "Post 1", related_post_ids: [3] }, { id: 2, name: "Post 2", related_post_ids: [2, 3] } ] It would also be helpful if you could show how to do this via a map or each function with AngularJS. A user commented that Array.prototype.filter() would be useful, but I'm not looking for a gross solution, I'm looking for the best, minimal, DRYest solution via AngularJS. Ember Data has a find() method. If I was able to use Ember and load the data up, I would be able to easily search, but I would still need something like an ActiveRecord::Proxy object in JS to be able to handle the delegations and I'm not sure how to meta program new object types in JS.
has answer: http://stackoverflow.com/a/28165537
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44701157
linked to: http://stackoverflow.com/q/14302267
has comment: http://stackoverflow.com/comment/44701302

http://stackoverflow.com/q/28152150
has answer: http://stackoverflow.com/a/28895472
tagged with: d3.js
has title: Simplifying KML for use with D3
has comment: http://stackoverflow.com/comment/45447962
score: 0
has comment: http://stackoverflow.com/comment/44682146
has comment: http://stackoverflow.com/comment/44791072
has body: I am working with D3 Maps and have a fairly large KML. On each path I have a mouseover event attached that changes colour and displays a tooltip. All works, but the size of the polygon paths and their complexity slows interactivity down. For my intended purpose, it is not necessary to have such high detail for the map. So I would like to slim down my KML and the polygons inside it, similar to this but without the interactivity. MAP CODE var width = 1000; var height = 1100; var rotate = 60; // so that [-60, 0] becomes initial center of projection var maxlat = 55; // clip northern and southern poles (infinite in mercator) // normally you'd look this up. this point is in the middle of uk var center = [-1.485000, 52.567000]; // instantiate the projection object var projection = d3.geo.conicConformal() .center(center) .clipAngle(180) // size of the map itself, you may want to play around with this in // relation to your canvas size .scale(10000) // center the map in the middle of the canvas .translate([width / 2, height / 2]) .precision(.1); var zoom = d3.behavior.zoom() .scaleExtent([1, 15]) .on("zoom", zoomed); var svg = d3.select('#map').append('svg') .attr('width', width) .attr('height', height); var g = svg.append("g"); svg.call(zoom).call(zoom.event); var tooltip = d3.select("body") .append('div') .style('position', 'absolute') .style('z-index', '10') .style('visibility', 'hidden') .attr('class', 'county-info') .text('a simple tooltip'); var path = d3.geo.path().projection(projection); d3.json("data/map-england.json", function(err, data) { g.selectAll('path') .data(data.features) .enter().append('path') .attr('d', path) .attr('class', 'border') .attr('stroke-width', '.5') .attr('id', function(d) { return d.properties.Name.replace(/ /g,'').toLowerCase(); }) .on("mouseover", function(d) { d3.select(this).classed("active", true ); tooltip .style('left', (d3.event.pageX - 15) + 'px') .style('top', (d3.event.pageY - 50) + 'px') .text(d.properties.Description) .style("vi…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44746458
has comment: http://stackoverflow.com/comment/44791109
accepted answer: http://stackoverflow.com/a/28895472
type: Question
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/44792040
has comment: http://stackoverflow.com/comment/44723077
has comment: http://stackoverflow.com/comment/44709236
linked to: http://stackoverflow.com/q/28235034

http://stackoverflow.com/comment/44728922
type: Comment
type: QuestionComment
has text: BTW, why do you have `recursive(++i, length);` on two separate lines? I think one of them doesn't belong there.
score: 0
comment on: http://stackoverflow.com/q/28179694

google-sheets
tags question: http://stackoverflow.com/q/28185218
tags question: http://stackoverflow.com/q/28259010
tags question: http://stackoverflow.com/q/28256218
tags question: http://stackoverflow.com/q/28204680
tags question: http://stackoverflow.com/q/28161670
tags question: http://stackoverflow.com/q/28231029
tags question: http://stackoverflow.com/q/28174964
type: Tag
tags question: http://stackoverflow.com/q/28267961
tags question: http://stackoverflow.com/q/28258732
tags question: http://stackoverflow.com/q/28225439
tags question: http://stackoverflow.com/q/28245173
tags question: http://stackoverflow.com/q/28163274
tag name: google-sheets
tags question: http://stackoverflow.com/q/28178089

http://stackoverflow.com/q/28248337
has title: Difficulties parsing an array
has body: This function call of parsePre is stopping after the first element in the array [ 1, "PHYS112", "PHYS122" ]. It is not continuing onto the next element into the array. I was wondering if there is something stopping the for-loop from continuing on the first call? var stuff = { "subject":"PHYS", "catalog_number":"375", "title":"Stars", "prerequisites":"Prereq: PHYS 112 or 122 and two of PHYS 234, 241, 242, 256, 258\/358, 263, 275", "prerequisites_parsed":[ [ 1, "PHYS112", "PHYS122" ],[ 2,"PHYS234","PHYS241","PHYS242","PHYS256", [ 1, "PHYS258", "PHYS358"], "PHYS263", "PHYS275"]] }; var pr = stuff.prerequisites_parsed; var parsePre = function (pre){ console.log(pre); console.log(pre.length); for(i = 0; i &lt; pre.length; i++){ console.log(i); if(typeof pre[i] === 'number'){ console.log(pre[i] + " of: "); } else if(typeof pre[i] === 'string'){ console.log(pre[i] + ", "); } else { console.log("WE SHOULD RECURSE"); parsePre(pre[i]); } } } parsePre(pr);
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: for-loop
tagged with: arrays
has answer: http://stackoverflow.com/a/28248387
type: Question

http://stackoverflow.com/a/28131131
type: Answer
has body: It's actually not a that bad question, the 'use strict'; indicates that the code inside the function should be evaluated in strict mode which is part of ECMAScript5. With strict mode enabled, you can not use undeclared variables - which is important here. If your browser is capable of ECMAScript5 the this variable is undeclared i.e undefined. If your browser does not support ECMAScript5 this is usually the Window. So this is a compatibility check whether your browser supports ECMAScript5 or not: 'use strict'; var hasECMAScript5 = !this; Then, the expression !!Function.prototype.bind checks whether your browser has support for bound functions (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
accepted answer of: http://stackoverflow.com/q/28131017
score: 4
answers question: http://stackoverflow.com/q/28131017
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44815730
comment on: http://stackoverflow.com/q/28226233
type: Comment
type: QuestionComment
has text: You anchor the match to the start of the string (good); but then you say "anything in the set 1-9, a-z, or A-Z". Shouldn't it just be /^[0-9][0-9a-zA-Z \t]*$/ ?
score: 1

http://stackoverflow.com/comment/44785369
has text: can't ..it's seem like two function crashed together .. I set "TimerOut" function for modal window after page loaded and display .On the other side , I set cookie for it too ,I just need modal window display in once .Now the TimerOut function was overlapping the cookie function . http://cloudsblack.com/modalwindow.html
type: QuestionComment
comment on: http://stackoverflow.com/q/28210179
type: Comment
score: 0

http://stackoverflow.com/a/28184341
answers question: http://stackoverflow.com/q/28184330
has body: You aren't concatenating the selectors properly. Try: $('#myTableId tr#cart_' + cart_id).each(function() { var book_name = $(this).find('#book_' + book_id).html(); console.log(book_name); }); Side note: I removed the space between tr#cart_ because I presume that the tr elements have the id.
has comment: http://stackoverflow.com/comment/44737827
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44737748
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44737757

http://stackoverflow.com/comment/44803906
has text: Edited the code to pass `{q:$scope.query}` to the `query()` method
comment on: http://stackoverflow.com/a/28219643
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28218863
has comment: http://stackoverflow.com/comment/44801059
has comment: http://stackoverflow.com/comment/44801256
has body: This is a duplicate question. It has been asked many times before, with dozens of answers, some of them rated very highly. Unfortunately, as far as I have been able to tell, every single one of those answers is a variant of "You don't, it's bad programming practice. Use setTimeout instead". This is Not. An. Answer! There are some use cases - rare but they exist - where you might want the entire page's execution to halt for a second or two, and I find it very frustrating that nobody seems interested in answering the actual question. (have a look at the comments here for some examples). I am sure it's possible to halt javascript executing; for instance, if I use firebug to insert a breakpoint, then the execution stops when it hits that point. So, firebug can do it. Is there some way that the program can halt execution of the current thread until some timeout occurs? Just some thoughts: How does firebug do it? Is there some browser-specific method? Is it possible to trigger a stop, without specifying a timeout to continue? Could I programmatically insert a breakpoint, or remove one? Could I get a closure representing the current thread to pass to setTimeout? I don't have a specific use case in mind; I am just looking for advise from someone who knows the browser/javascript design better than me, as to how this can most effectively be done. So far, I have come up with only one solution: endtime=Date.now()+1000; while(Date.now() &lt; endtime) $.ajax(window.location.origin,{'async':false}); This appears to work. The problem with it is, it makes hundreds of excess requests. I would replace the location.origin with something like mysite/sleep?delay=X and write a server side script to provide the delay, which would but it down to one, but the whole thing still seems really hacky. There must be a better way to do this! How does the jquery.ajax function manage it? Or is there a busy-wait buried in it somewhere? The following do not answer the question and will be downvoted, ju…
has comment: http://stackoverflow.com/comment/44801492
answer count: 2
downvote count: 4
tagged with: thread-sleep
has comment: http://stackoverflow.com/comment/44801440
has title: Is it possible to implement a sleep() in javascript?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44801083
favorite count: 0
linked to: http://stackoverflow.com/q/951021
has answer: http://stackoverflow.com/a/28219165
has comment: http://stackoverflow.com/comment/44801136
has comment: http://stackoverflow.com/comment/44801115
score: -3
has comment: http://stackoverflow.com/comment/44801739
type: UnansweredQuestion
tagged with: multithreading
upvote count: 1
has comment: http://stackoverflow.com/comment/44825672
type: Question
has answer: http://stackoverflow.com/a/28219154
has comment: http://stackoverflow.com/comment/44801393
tagged with: sleep

http://stackoverflow.com/comment/44847375
type: Comment
type: QuestionComment
has text: There's not an error that I can see. Please ignore the extra }, I copied the parts I thought were relevant, and deleted some others, and missed some things. The click event is definitely firing, It does the other things inside it, and creates the .unit object. It's just that afterwards, it does not allow me to do the .unit click event.
score: 0
comment on: http://stackoverflow.com/q/28242324

http://stackoverflow.com/q/28122120
has body: So I have an incredibly simple HTML survey form that I created that only has one select drop down input and one text input field. The text input only shows up if the select field is on the "other" option. So that is all well and good, I have JavaScript handling all of it and it works great. Now the problem appears when I try POST the form values to the PHP file and then insert the values into my database table. I have been receiving this error every time I try to submit the form: Error: INSERT INTO survey (select, other) VALUES ('flyer','') You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' other) VALUES ('flyer','')' at line 1 Because of the odd single quote that seems to cut off the first part of sql string, I am lead to believe I am somehow SQL injecting myself on my form POST or my PHP validation. I have gone through the code many times searching for weird quotes, have re-written the form completely from scratch, triple checked the table and row names from my database, and even grabbed a SQL string that I know works other places changed it to work here. Unfortunately I always get the same error, so I would greatly appreciate any insight or help you all can lend me. My HTML Form: How did you here about us? Flyer left on door Email from Troop SODO News Conway News Southwest Orlando Bulletin Winter Park Observer Baldwin Park Living Facebook Neighborhood posting Other Where else did you hear about us? My PHP: require_once 'db_con.php'; require_once 'functions.php'; $selectErr = ""; $otherErr = ""; //validating inputs if ($_SERVER["REQUEST_METHOD"] == "POST"){ if (empty($_POST["hear_select"])){ $selectErr = "* An answer is required"; $valid = false; }else{ $select = test_input($_POST["hear_select"]); $valid = true; } if (empty($_POST["other_type"])) { $other = test_input($_POST["other_type"]); $valid = true; }else{ if((strlen($_POST["other_type"]) < 200)){ $other = test_input($_POST[…
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/44618300
score: 0
upvote count: 1
downvote count: 1
answer count: 1
has title: PHP error when trying to POST "select" HTML form input
linked to: http://stackoverflow.com/q/2889871
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
accepted answer: http://stackoverflow.com/a/28122147
duplicate of: http://stackoverflow.com/q/23446377
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23446377
tagged with: mysql
has answer: http://stackoverflow.com/a/28122147
type: Question

tags
tags question: http://stackoverflow.com/q/28164029
tags question: http://stackoverflow.com/q/28255883
tags question: http://stackoverflow.com/q/28141144
tags question: http://stackoverflow.com/q/28158339
type: Tag
tags question: http://stackoverflow.com/q/28177160
tag name: tags
tags question: http://stackoverflow.com/q/28164923
tags question: http://stackoverflow.com/q/28175986

http://stackoverflow.com/comment/44653088
comment on: http://stackoverflow.com/q/28140698
score: 0
has text: In HTML you provided all ` ` elements initially have class `landscape`. Isn't it a typo?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44675823
comment on: http://stackoverflow.com/a/28152188
score: 0
type: AnswerComment
type: Comment
has text: Yeah I was using the generic var in place of a name. Updated for less confusion.

http://stackoverflow.com/q/28154504
has comment: http://stackoverflow.com/comment/44680903
score: -1
type: Question
has answer: http://stackoverflow.com/a/28154631
has answer: http://stackoverflow.com/a/28154620
upvote count: 0
has answer: http://stackoverflow.com/a/28154574
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28154581
favorite count: 0
has answer: http://stackoverflow.com/a/28154581
has comment: http://stackoverflow.com/comment/44680487
has comment: http://stackoverflow.com/comment/44680569
has body: I have str1, str2 and I want to add them. For example, str1 = '5' and str2 = '2.50000'. I would like to add them together and get 7.50. I have tried many (unsuccessful) variations, the latest is: str1 = "5.00000"; str2 = "2.50000"; new_st1 = parseFloat(str1).toFixed(2); new_str2 = parseFloat(str2).toFixed(2); str3 = parseFloat(( new_str1 + new_str2 )).toFixed(2); This produces (absurdly) 5.00. I would like to get 7.50. And then, of course, to be able to generalize the solution to other more complex additions. All help very gratefully received.
answer count: 4
has title: how can I convert 2 strings to numbers and add them using javascript?
has comment: http://stackoverflow.com/comment/44680926
accepted answer: http://stackoverflow.com/a/28154574
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/45075388
has text: Thanks Dude, basically I am trying to built a dummy commenting system as a learning experience like discuss or livefyre. I am putting up small blocks together, while I have done good progress but there is something where I get stuck and I hook up to stackoverflow. Basically I have a problem where I am unable to call a function when called from a directive defined element. I reprodiced the same problem as in the fiddle. If you can help that would be awesome. But please, I dont want you to waste time on building somethng that I need. I am doing this as a learning thing and I appreciate your help
comment on: http://stackoverflow.com/a/28255775
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44845511
type: Comment
has text: Thanks rahul.. Yes i understood it.
comment on: http://stackoverflow.com/a/28242392
type: AnswerComment
score: 0

http://stackoverflow.com/a/28230849
type: Answer
upvote count: 1
score: 1
has body: did you use jQuery? if not, you can try like this: img = document.getElementById('yourID') img.src = "your image url" make sure the image path is work.
answers question: http://stackoverflow.com/q/28230808
downvote count: 0

http://stackoverflow.com/a/42120371
has comment: http://stackoverflow.com/comment/116983265
type: Answer
has body: This works too: $('#myModal').on('hide.bs.modal', function (e) { var tmpid = $(document.activeElement).attr('id'); alert(tmpid); }); It won't get the id of the 'X' on the modal unless you id it. Will return the id of the element which triggers the closing of the modal....
has comment: http://stackoverflow.com/comment/101346614
score: 9
upvote count: 9
answers question: http://stackoverflow.com/q/28270333
has comment: http://stackoverflow.com/comment/81851167
has comment: http://stackoverflow.com/comment/131798733
downvote count: 0

http://stackoverflow.com/comment/44834006
type: QuestionComment
has text: You could post json response sample. BTW, I guess that missing comma after `url: myServiceUrl` is a typo?
comment on: http://stackoverflow.com/q/28236130
score: 0
type: Comment

http://stackoverflow.com/comment/44897763
has text: Place the desired url in src attribute of the iframe when you are showing it, hope it helps!
comment on: http://stackoverflow.com/a/28264346
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44889990
has text: like this ? http://www.menucool.com/javascript-image-slider
comment on: http://stackoverflow.com/q/28265995
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28221031
score: 0
tagged with: regex
has title: How to split only the numbers and/or words from a string into an array in Javascript
has answer: http://stackoverflow.com/a/28221077
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28221077
type: Question
has body: I have the string "1, 2, 3" and the string "1, 2, 3 Go!" I would like to split into an array that only includes the numbers or the words without the punctuation. So first one becomes ["1", "2", "3"] The second one becomes ["1","2","3", "Go"] I can get the first one by "1, 2, 3".split(/[^0-9]/).filter(function(value){if(value) return value;} I use filter because I get ["1", "", "2", "", "3"] when I just use split. I don't know who to get the second array. Is there a regular expression pattern that will only split the string into either numbers and or words?
tagged with: arrays
answer count: 1
tagged with: javascript
tagged with: string

http://stackoverflow.com/comment/44775480
type: QuestionComment
score: 0
has text: any errors in the console?
comment on: http://stackoverflow.com/q/28204822
type: Comment

jquery-selectors
tags question: http://stackoverflow.com/q/28166025
type: Tag
tags question: http://stackoverflow.com/q/28162322
tags question: http://stackoverflow.com/q/28122957
tags question: http://stackoverflow.com/q/28143235
tags question: http://stackoverflow.com/q/28278291
tags question: http://stackoverflow.com/q/28248809
tags question: http://stackoverflow.com/q/28155601
tags question: http://stackoverflow.com/q/28158764
tags question: http://stackoverflow.com/q/28261363
tag name: jquery-selectors
tags question: http://stackoverflow.com/q/28132464

http://stackoverflow.com/comment/44741491
comment on: http://stackoverflow.com/a/28185038
score: 0
type: AnswerComment
has text: @user3697399 you were doing something wrong in if condition Now i works http://codepen.io/anon/pen/XJaKbB
type: Comment

http://stackoverflow.com/comment/44682871
comment on: http://stackoverflow.com/q/28154449
has text: The watch is working fine bcz I can see the html elements. But scope object is not attached to the elements.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28126201
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/28126125
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28126125
score: 3
has body: You could map it using outerHTML property and then join the array: var html = $('div').children('a').map(function(){ return this.outerHTML; }).get().join(' and '); -jsFiddle- For handling multiple DIVs specifically, you could use: $('div:has(a)').each(function () { this.innerHTML = $(this).children('a').map(function () { return this.outerHTML; }).get().join(' and ') }); -jsFiddle-

http://stackoverflow.com/comment/44694059
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28160013
type: Comment
has text: thanks! It still can't replace map/reduce in some cases though. I'm using your suggestion of data duplication, it reduce some queries!

http://stackoverflow.com/comment/44720633
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28175759
has text: take a look at formdata https://developer.mozilla.org/en-US/docs/Web/API/FormData

http://stackoverflow.com/a/28630018
downvote count: 1
has body: Node.js is not a way to organize your code and, as for now, javascript does not provide a strong OOP natively (with ensured interfaces, easy inheritance, dependency-injection, ...). However, it exists a lots of libraries or frameworks helping you to do some OOP. I can suggest you the framework Danf which is an OOP framework providing a strong way to organize your code.
answers question: http://stackoverflow.com/q/28221501
type: Answer
upvote count: 0
score: -1

http://stackoverflow.com/q/28182135
has comment: http://stackoverflow.com/comment/44733800
tagged with: ruby-on-rails
type: AnsweredQuestion
has body: I have an index view with many photos. I want to make a hover effect on each photo, but my code only places the effect on the first photo, because it doesn't have ids. I'm not sure on how to approach. Any help please? This will add the effect (show an overlay) on the same item everytime, and I need each item to have a unique effect. <li id="product_<%= product.id %>"> <%= link_to small_image(product, :itemprop => "image"), url, :itemprop => 'url' %> More <% end %>
linked to: http://stackoverflow.com/q/28290487
type: Question
has comment: http://stackoverflow.com/comment/44733754
accepted answer: http://stackoverflow.com/a/28182291
has comment: http://stackoverflow.com/comment/44733695
tagged with: javascript
score: 0
answer count: 1
has title: Dynamic javascript hovers with rails?
has answer: http://stackoverflow.com/a/28182291

http://stackoverflow.com/comment/44817807
score: 0
comment on: http://stackoverflow.com/a/28226906
type: Comment
has text: See also http://stackoverflow.com/questions/338482/can-you-determine-timezone-from-request-variables but the principle for the simple way of doing this (2) is the same. The hard way (1) is by using geo location based on IP which involves a lot of fun, I think ...
type: AnswerComment

http://stackoverflow.com/a/28254131
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28254004
type: Answer
has body: For validation purposes, i suggest you to use anchors. \S* matches zero or more non-space characters. ^www\.youtube\.com\/embed\/\S*$ DEMO &gt; /^www\.youtube\.com\/embed\/\S*$/.test('www.youtube.com/embed/tqJDf7IB4HI?rel=0&amp;controls=0') true &gt; /^www\.youtube\.com\/embed\/\S*$/.test('www.youtube.com/embed/tqJDf7IB4HI') true
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44867407
accepted answer of: http://stackoverflow.com/q/28254004

http://stackoverflow.com/q/28144615
type: Question
accepted answer: http://stackoverflow.com/a/28148947
has comment: http://stackoverflow.com/comment/44663842
has comment: http://stackoverflow.com/comment/44664803
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: backbone.js
has body: I am in the process of creating a JS snippet that users can include on their site. This snippet depends on jQuery (and Backbone). It works fine if I embed it in a site that doesn't already have jQuery loaded, but if it does, it's still generally okay, unless they have written custom jQuery extensions, which then get overwritten. Is it possible to scope my jQuery so that it doesn't overwrite any existing jqueries?
has answer: http://stackoverflow.com/a/28148947
has title: Creating Embeddable JS that requires jQuery, how to not overwrite existing jQuery
type: AnsweredQuestion
tagged with: ruby-on-rails

iframe
tags question: http://stackoverflow.com/q/28166583
tags question: http://stackoverflow.com/q/28258976
tags question: http://stackoverflow.com/q/28155708
tags question: http://stackoverflow.com/q/28172431
tags question: http://stackoverflow.com/q/28180722
tags question: http://stackoverflow.com/q/28243144
tags question: http://stackoverflow.com/q/28241823
tags question: http://stackoverflow.com/q/28174609
tags question: http://stackoverflow.com/q/28222548
tag name: iframe
tags question: http://stackoverflow.com/q/28275816
tags question: http://stackoverflow.com/q/28243439
tags question: http://stackoverflow.com/q/28209705
tags question: http://stackoverflow.com/q/28268609
tags question: http://stackoverflow.com/q/28268574
tags question: http://stackoverflow.com/q/28234767
tags question: http://stackoverflow.com/q/28142646
tags question: http://stackoverflow.com/q/28266884
tags question: http://stackoverflow.com/q/28169897
tags question: http://stackoverflow.com/q/28279076
tags question: http://stackoverflow.com/q/28149141
tags question: http://stackoverflow.com/q/28127327
tags question: http://stackoverflow.com/q/28273611
tags question: http://stackoverflow.com/q/28221806
tags question: http://stackoverflow.com/q/28261698
tags question: http://stackoverflow.com/q/28180672
tags question: http://stackoverflow.com/q/28181832
tags question: http://stackoverflow.com/q/28270008
tags question: http://stackoverflow.com/q/28230365
tags question: http://stackoverflow.com/q/28211384
tags question: http://stackoverflow.com/q/28216517
tags question: http://stackoverflow.com/q/28195228
tags question: http://stackoverflow.com/q/28149815
tags question: http://stackoverflow.com/q/28137461
tags question: http://stackoverflow.com/q/28273526
type: Tag
tags question: http://stackoverflow.com/q/28275960
tags question: http://stackoverflow.com/q/28203564
tags question: http://stackoverflow.com/q/28155751
tags question: http://stackoverflow.com/q/28181890
tags question: http://stackoverflow.com/q/28193993
tags question: http://stackoverflow.com/q/28214222
tags question: http://stackoverflow.com/q/28135785
tags question: http://stackoverflow.com/q/28181723
tags question: http://stackoverflow.com/q/28159920
tags question: http://stackoverflow.com/q/28156849
tags question: http://stackoverflow.com/q/28200428
tags question: http://stackoverflow.com/q/28244999
tags question: http://stackoverflow.com/q/28144152

http://stackoverflow.com/a/28220763
downvote count: 0
upvote count: 61
has body: You initialized all of the elements which have data-toggle="tooltip" attribute using the elements container (the body) trough delegation (fiddle): $("body").tooltip({ selector: '[data-toggle=tooltip]' }); so in order to disable it using destroy you need to do it on the body: $('body').tooltip('dispose'); If you want to do it without delegation you can initialize each of the elements (fiddle): $('[data-toggle="tooltip"]').tooltip(); and destroy it: $('[data-toggle="tooltip"]').tooltip('dispose'); // used in v4 $('[data-toggle="tooltip"]').tooltip('destroy'); // used in v3 and older If you still want to initialize trough delegation and stop it from working using disable (fiddle): $('body').tooltip({ selector: '[data-toggle=tooltip]' }); $('body [data-toggle="tooltip"]').tooltip('disable'); Explanation about difference between destroy and disable taken from Jasny's answer: $('[rel=tooltip]').tooltip() // Init tooltips $('[rel=tooltip]').tooltip('disable') // Disable tooltips $('[rel=tooltip]').tooltip('enable') // (Re-)enable tooltips $('[rel=tooltip]').tooltip('dispose') // Hide and destroy tooltips This is the answer I got in Bootstraps github - Since you're using delegation (i.e. the selector option), I believe there's only one actual tooltip instance (on the body). Thus, trying to destroy nonexistent tooltip instances on the trigger elements themselves has no effect. Compare the non-delegated version: http://jsfiddle.net/zsb9h3g5/1/
type: Answer
answers question: http://stackoverflow.com/q/28220597
accepted answer of: http://stackoverflow.com/q/28220597
has comment: http://stackoverflow.com/comment/44805359
score: 61
type: AcceptedAnswer

http://stackoverflow.com/q/28154201
type: UnansweredQuestion
has body: So, I've made my website and I'm trying to give it some style. I have the following code to change class. It makes the navigation background appear if you scrolled 600pixels or more. &lt;script&gt; $(document).scroll(function() { if ($(document).scrollTop() &gt;= 600) { $('.navbar-default').addClass('sticky'); } else { $('.navbar-default').removeClass('sticky'); } }); &lt;/script&gt; My question is, is there any way to add or remove classes besides the scroll function? I was thinking something like: "If I'm in div with id #example, then add class .sticky", because I don't know how many pixels the div will have if you are watching it in your phone or tablet. Website: googledrive.com/host/0B7F-fUHZZLadcE1QRXhUNnp5enM Edit: Any tutorial on how to send contact forms using ajax?
has title: How to add class when you're placed in a section
tagged with: css
type: Question
has answer: http://stackoverflow.com/a/28154357
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28154556

http://stackoverflow.com/q/28259485
accepted answer: http://stackoverflow.com/a/28263371
tagged with: formatting
has comment: http://stackoverflow.com/comment/44876651
has body: I've read a lot of articles on JavaScript formatting and the rules etc. But my question here is how to format core JavaScript elements (i.e. functions, arrays, and objects) Usually for functions I use the following: function myFunction(argument1 , argument2 , optionalargument3) { optionalargument3 === undefined ? optionalargument3 : "default value"; return optionalargument1; } or: var myFunction = function(argument1 , argument2 , optionalargument3) { optionalargument3 === undefined ? optionalargument3 : "default value"; return optionalargument1; } but this is controversial. For objects I use: var Car = { model : undefined make : "Sudan" MPG : 7.5 highway-mpg : 11.5 }; of course, this is highly controversial and most people use different methods. and for for loops, I use: for(var i = 0; i &lt; (array.length + 1); i++) { console.log(array[i]); } People also seem to have devolved the idea to write out global in a list before objects or functions. eg: var winMessage = "You Win!"; var loseMessage = "Loser!"; var cash = 0; var intrest = null; function randomInteger(low , high) { return Math.floor((Math.random())*(high-low))+low } var Car = { model : undefined make : "Sudan" MPG : 7.5 highway-mpg : 11.5 }; Are there any universal accepted, or a generically "proper" way to format your JavaScript code?
type: Question
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44876614
has comment: http://stackoverflow.com/comment/44876763
has comment: http://stackoverflow.com/comment/44876780
has answer: http://stackoverflow.com/a/28263371
type: AnsweredQuestion
has title: How to "properly" format js core elements?

http://stackoverflow.com/comment/44666117
has text: It has to python? Because links have a tendency (especially nowadays) to be added to the DOM later on, or to respond to certain events, triggered by the user, which makes a headless browser a better option here (IMHO). I'd look into PhantomJS or similar tools
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28147213

http://stackoverflow.com/comment/44895129
comment on: http://stackoverflow.com/q/28269528
type: QuestionComment
type: Comment
score: 0
has text: I had used the wrong button in the code snippets, corrected now @aug

http://stackoverflow.com/comment/44864625
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28251946
type: Comment
has text: But when I enter 3 in the Discount Percentage field, the output becomes 100%.

http://stackoverflow.com/comment/44893999
has text: Too bad, thanks for answering anyway. Saved me an enormous amount of searching for an answer, since I couldn't find it in the docs.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28268604

http://stackoverflow.com/comment/44816446
type: QuestionComment
has text: It is version 1.9.0.
score: 0
comment on: http://stackoverflow.com/q/28226516
type: Comment

http://stackoverflow.com/a/28143316
has body: There seem to be a number of problems with the above code including an extra [ in the data, which should be: var data=[ {"key":[2000,1,1,12],"value":1000}, {"key":[2000,2,1,12],"value":38965}, {"key":[2000,7,1,24],"value":289}, {"key":[2000,8,1,24],"value":389} ] Other than that, the way you parse the data seems fine, but there are some issues with the way you set up the chart. I've created a new line chart using your data here: http://jsfiddle.net/henbox/9etp0xap/, based on this example: http://bl.ocks.org/mbostock/3883245 You'll probably find it easier to modify that jsfiddle rather than to debug the specific issues.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28133543

http://stackoverflow.com/q/28213683
accepted answer: http://stackoverflow.com/a/28214476
has answer: http://stackoverflow.com/a/34956811
answer count: 3
has comment: http://stackoverflow.com/comment/44791593
has comment: http://stackoverflow.com/comment/44790925
has comment: http://stackoverflow.com/comment/44791847
has comment: http://stackoverflow.com/comment/44791597
has comment: http://stackoverflow.com/comment/44791935
has answer: http://stackoverflow.com/a/28214476
possible better answer: http://stackoverflow.com/a/36430074
has comment: http://stackoverflow.com/comment/44790990
has answer: http://stackoverflow.com/a/36430074
has comment: http://stackoverflow.com/comment/44792304
has comment: http://stackoverflow.com/comment/44791193
upvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44791397
downvote count: 0
has title: DIV losing focus when clicking on elements inside it
tagged with: javascript
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/44790973
has body: Why does the DIV lose focus when i click on elements inside it? I have an JS that hides the DIV when it loses focus. But that should not happen when clicking on elements inside the DIV. It needs to be done with .on because there is some ajax loading going on. $(document).on('focusout', '#geomodal', function(e) { console.log('.focusout'); }); Bla Blabla http://jsfiddle.net/2g41su81/2/ jQuery Documentation: The focusout event is sent to an element when it, or any element inside of it, loses focus.
has comment: http://stackoverflow.com/comment/44791331
has comment: http://stackoverflow.com/comment/44790968
favorite count: 0
score: 4

http://stackoverflow.com/q/28133185
has comment: http://stackoverflow.com/comment/44662902
has comment: http://stackoverflow.com/comment/44640594
favorite count: 0
has comment: http://stackoverflow.com/comment/44639141
has comment: http://stackoverflow.com/comment/129308143
has title: How to add loading page until webpage loads
has comment: http://stackoverflow.com/comment/44640899
has comment: http://stackoverflow.com/comment/44640669
type: AnsweredQuestion
score: -5
has answer: http://stackoverflow.com/a/28133222
has comment: http://stackoverflow.com/comment/44640845
linked to: http://stackoverflow.com/q/55701200
has comment: http://stackoverflow.com/comment/44638892
downvote count: 5
accepted answer: http://stackoverflow.com/a/28133222
has comment: http://stackoverflow.com/comment/44639111
type: Question
has comment: http://stackoverflow.com/comment/44639053
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44640539
has body: I am designing a web page for my school containing high resolution images and videos. So, I need Js/jquery code for adding a loading page until the whole web page loads.

http://stackoverflow.com/comment/44893953
type: Comment
comment on: http://stackoverflow.com/a/28268523
score: 1
type: AnswerComment
has text: @Bergi `this.then()` is used several times internally :D A warning could be good for non-function value that is not a null or undefined though because that is 99.99% surely a mistake however it wouldn't have helped this specific OP but many others that pass promise to .then.

http://stackoverflow.com/comment/44788696
type: AnswerComment
has text: A client represents a pool of connections to multiple hosts, you should use a single client instance and reuse it in all your modules: http://www.datastax.com/documentation/developer/nodejs-driver/1.0/nodejs-driver/faq/njdFaq.html
comment on: http://stackoverflow.com/a/28166417
type: Comment
score: 2

http://stackoverflow.com/q/28154220
has comment: http://stackoverflow.com/comment/44680070
has body: In my options form I have a few color inputs that I would like to have load their preset values, but currently it won't select and display the value that it is given. The Html: Search Bar Background Color: Search Bar Placeholder Text Color: Search Bar Text Color: Go Button Background Color: The Javascript Load Function: window.onLoad = loadOptions(); function loadOptions() { var defaultBarBackground = '#000000'; var defaultGoBackground = '#000000'; var defaultBarColor = '#ffffff'; var defaultPlaceColor = '#999999'; chrome.storage.local.get('barBackgroundOption', function (x) { $('#barBackground').attr("value", x.barBackgroundOption); }); chrome.storage.local.get('barColorOption', function (x) { $('#barColor').attr("value", x.barColorOption); }); chrome.storage.local.get('placeColorOption', function (x) { $('#placeColor').attr("value", x.placeColorOption); }); chrome.storage.local.get('goBackgroundOption', function (x) { $('#goBackground').attr("value", x.barBackgroundOption); }); I'm pretty sure that the problem is simply selecting that value, because when I inspect the element on the page it has the right value - it just doesn't display it.
has comment: http://stackoverflow.com/comment/44679931
tagged with: javascript
tagged with: jquery
score: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/44680039
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Selecting Color Value With Javascript
type: UnansweredQuestion
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28154303
type: Question

http://stackoverflow.com/q/28181384
type: Question
tagged with: object
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44732046
has body: I'm trying to build an array of javascript objects based on a variable that also has objects like this: time #1: console.log(obj_initial); //{ evt1 : 'value1', evt2 : 'value2', evt3 : 'value3' } This variable change theirs properties in the time. time #2: console.log(obj_initial); //{ evtA : 'value9', evtB : 'value8', evtC : 'value7', evtD : 'value6' } How do I build an array of objects? like this: obj_final = [ { evt1 : 'value1', evt2 : 'value2', evt3 : 'value3' }, { evtA : 'value9', evtB : 'value8', evtC : 'value7', evtD : 'value6'}, { ... }] Anyone please.. thanks in advance.
has comment: http://stackoverflow.com/comment/44752129
answer count: 3
duplicate of: http://stackoverflow.com/q/122102
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28181563
has answer: http://stackoverflow.com/a/28181483
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44732428
linked to: http://stackoverflow.com/q/122102
has title: How to build a array of objects from a variable that contains objects dynamically
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44732266
has answer: http://stackoverflow.com/a/28181485

http://stackoverflow.com/a/28171082
answers question: http://stackoverflow.com/q/28170705
has body: Ended up solving this on my own: var bundler = watchify(browserify({ basedir: "./public/js/src" })); // Browserify our code gulp.task('js', ['clean'], function() { // Browserify/bundle the JS. return bundler.bundle() // log errors if they happen .on('error', function(err) { return notify().write(err); }) .pipe(source('index.js')) .pipe(gulp.dest('public/js/dist')); }); Main thing to understand is that source uses browserify's basedir, whereas gulp.dest does not.
type: Answer
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/comment/44691836
type: AnswerComment
comment on: http://stackoverflow.com/a/28159001
type: Comment
has text: Ah, totally forgot about trying html local storage. I'll look into that. So I guess that I could just use a regular innerHtml javascript function to write the updated value to the screen in real-time, and use the local html storage until I submit to the db. Am I on the right track with that?
score: 0

http://stackoverflow.com/comment/44849769
type: Comment
type: QuestionComment
has text: In the typical php application setup, `/` would target the `index.php` in the root folder of your website root. However, that behavior can be modified by .htaccess, or by whatever you are using to serve files (apache, nginx, iis, node.js, etc)
comment on: http://stackoverflow.com/q/28244494
score: 0

http://stackoverflow.com/a/28227751
upvote count: 3
answers question: http://stackoverflow.com/q/28208819
has comment: http://stackoverflow.com/comment/44820309
has body: To add public permissions to the selected file. You will need to use the drive api to add file permissions Please see https://developers.google.com/drive/v2/reference/permissions/insert You will need to insert a permission to the file with role set to 'reader' and the type to 'anyone' You can refer to the javascript implementation in the example /** * Insert a new permission. * * @param {String} fileId ID of the file to insert permission for. * @param {String} value User or group e-mail address, domain name or * {@code null} "default" type. * @param {String} type The value "user", "group", "domain" or "default". * @param {String} role The value "owner", "writer" or "reader". */ function insertPermission(fileId, value, type, role) { var body = { 'value': value, 'type': type, 'role': role }; var request = gapi.client.drive.permissions.insert({ 'fileId': fileId, 'resource': body }); request.execute(function(resp) { }); }
downvote count: 0
type: Answer
score: 3

http://stackoverflow.com/q/28214297
has answer: http://stackoverflow.com/a/28214606
has comment: http://stackoverflow.com/comment/44792075
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44792088
tagged with: javascript
has comment: http://stackoverflow.com/comment/44794400
favorite count: 0
has body: As per title, I need to clone an object in Javascript like that below and set each values to zero. Of course the object properties can change. { _id: { action: null, date: null }, avg: null, min: null, max: null, total: null }
accepted answer: http://stackoverflow.com/a/28214606
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44794635
has comment: http://stackoverflow.com/comment/44792107
downvote count: 3
score: -3
has title: How can I clone an object and set every properties value to null?
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/44792149
tagged with: clone

http://stackoverflow.com/a/28175524
has comment: http://stackoverflow.com/comment/73076539
answers question: http://stackoverflow.com/q/28175522
has body: I would suggest starting out from a secure token, and then improving it through JavaScript according to dynamic form Creation. Eg, like: &lt;input type="hidden" name="csrftoken" value="hgdillksdbgjksdbkvbskb"&gt; Where the "value" parameter is generated on server-side when page loads. And then you have a script like: csrftoken = document.mainform.csrftoken.value; # Do something with the CSRF token, like add dynamic values, like sha256(csrftoken + "dynamicvalue"); document.mainform.csrftoken.value = csrftoken; The main idea of this, is to prevent, that even if they manage to get a exploit that would allow a adverisary to read the JavaScript code, they still cannot make up a valid CSRF token, since they cannot read the original "csrftoken" value that was inside the form at page load. This can also be used to "chain" AJAX requests, like that you start out with the token X during page load. Then you transform it to Y using JavaScript, send it in a AJAX request. In the next AJAX request, you can use Y as base in the algoritm, to create Z, and send to the server. A attacker cannot gain access to X, thus they cannot either get access to Y neither Z, even if they would in some way be able to exploit running JavaScript code to reveal itself. Note that page contents cannot be read by a adversiary due to Same origin policy. But Javascript can contain exploits that would make it possible to read the actual running JavaScript code. Theres no such exploits currently, but better be safe than sorry.
has comment: http://stackoverflow.com/comment/73059556
downvote count: 0
has comment: http://stackoverflow.com/comment/73056687
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45049810
score: 0
type: Comment
has text: thanks for that, but still, the main problem is the focus :( i think it's impossible... unless i use an iframe on the input or the text editor... im screwed.
type: AnswerComment
comment on: http://stackoverflow.com/a/28323467

http://stackoverflow.com/comment/44831482
comment on: http://stackoverflow.com/q/28234904
type: Comment
type: QuestionComment
has text: @demo I tried several solutions available on SO. No one really worked for me or too complex for a simple problem. Otherwise I'm aware of the worth of time.
score: 1

http://stackoverflow.com/q/28252208
tagged with: javascript
tagged with: mediaelement.js
downvote count: 0
has comment: http://stackoverflow.com/comment/44889556
favorite count: 0
has comment: http://stackoverflow.com/comment/44884904
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44867985
answer count: 0
score: 1
has title: Skip back button in MediaElementJs?
has body: Is there a skip back button (say 10 seconds) for the MediaElementJs player? Thanks
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/28203617

http://stackoverflow.com/comment/44783873
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28198665
has text: @RémiDoolaeghe When `.then()` is called on a promise that has already been resolved, the handler will be called asynchronously on Promises/A+-compliant promises, and immediately on jQuery promises and a few other kinds of promises.
score: 0

http://stackoverflow.com/q/28139861
has comment: http://stackoverflow.com/comment/44651285
has answer: http://stackoverflow.com/a/28139914
upvote count: 1
has body: I am trying to do the show/hide function with some containers and text. When i click on a certain container I want a paragraph to hide. At the moment I am trying to work out when I click the "left" container, the paragraph "barbertext" to disappear. We are Thairapy, an independent hair and beauty Salon located in the heart of Exeter. At Thairapy, we care about our clients and our main aim is to go that extra mile and look after every one of our happy customers. Our beautician, Shail Dutt has over 10 years of experience within the beauty industry. Shail is a very dedicated and passionate person, she strives to make her clients feel loved and special. A decent Mens haircut needn't cost the Earth. We offer top quality Men's haircuts from £7. HAIR BEAUTY BARBERS The Javascript that I am working with is this: If anyone could help I would be most appreciated.
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: show-hide
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28139902
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/28140930
accepted answer: http://stackoverflow.com/a/28140930
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28139928
has title: Javascript show and hide function
score: 1
has answer: http://stackoverflow.com/a/28139902
type: Question

http://stackoverflow.com/comment/44639330
has text: I ended up changing to contentType: "application/json; charset=utf-8", dataType: 'html', in the ajax function and was able to receive the html string. I didn't json encode it in the php function.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28132380

http://stackoverflow.com/comment/44674976
has text: It displays a bunch of HTML String. Is that the way?
comment on: http://stackoverflow.com/a/28148475
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28185095
type: AcceptedAnswer
score: 0
type: Answer
has body: Thanks for your answers, But those were not what I was looking for. Here is how I did it: First of, I already had a hidden field used for another purpose (which I forget to mention here). $('.select_class').change(function () { var $currentselect = $(this); var $currentorder = $('input[name=' + $(this).attr('name') + '_current' + ']'); $("select[name^='select_order_']").each(function () { var $checkcurrent = $('input[name=' + $(this).attr('name') + '_current' + ']'); if (!$(this).is(':disabled')) { if($(this).prop('name') != $currentselect.prop('name')){ if($(this).val() == $currentselect.val()){ $(this).val($currentorder.val()) $checkcurrent.val($currentorder.val()) } } } }); $currentorder.val($(this).val()) }); The $currentselect takes the field that was modified and keeps it as a variable to be used in the below sections The $currentorder take the name of the .class_select and add _current (which becomes the hidden field with the current data. For all the "select_order" I do the following checks: Create the checkcurrent variable to modify it later if it is needed Is it disabled, If it is just skip it does the $currentselect value has the same value has the "select_order" If it has the same value, change the current "select_order" with the $currentorder value and then allow the change to the $currentselect change checkcurrent with the new value so the _current has the proper number for each
answers question: http://stackoverflow.com/q/28177765
accepted answer of: http://stackoverflow.com/q/28177765

http://stackoverflow.com/comment/44662145
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28145155
has text: what are you hoping to accomplish by setting your own indices with gaps in them?
type: Comment

http://stackoverflow.com/q/28279336
linked to: http://stackoverflow.com/q/503093
has comment: http://stackoverflow.com/comment/44912813
has answer: http://stackoverflow.com/a/28279468
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/44912700
has title: How to redirect to next page using AJAX?
type: Question
score: -5
has comment: http://stackoverflow.com/comment/44912789
has body: $(document).ready(function () { $("#btn").on("change", function() { var val = $(this).val(); $.ajax({ url: "1.php", data: { id: val }, success: function( result ) { alert("Hi, testing"); alert( result ); } }); }); }); I want to redirect to 2.php?name=iamchecking it shows alert msg "hi testing" but I want to send it to 2.php and get the value of name from get on PHP. How can I do so?
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
downvote count: 6
tagged with: ajax
has comment: http://stackoverflow.com/comment/44912695
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/comment/44855130
score: 6
has text: To be perfectly clear, he is saying that `function`s come before `var`s, which is Theory 3 in the OP.
comment on: http://stackoverflow.com/a/28246653
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28181145
type: Answer
has body: It may be easier to define your own function. Something like this: function parseFloatSeparator(str, sep) { sep = sep || "."; str = str.replace(new RegExp("[^0-9"+sep+"]","g"),""); if( sep != ".") str = str.replace(sep,"."); return parseFloat(str); }
has comment: http://stackoverflow.com/comment/44731517
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28181066
upvote count: 1

http://stackoverflow.com/a/28225523
type: Answer
answers question: http://stackoverflow.com/q/28225452
score: 0
has comment: http://stackoverflow.com/comment/44814327
has comment: http://stackoverflow.com/comment/44814385
has body: To dispatch events manually in JavaScript, use the element.dispatchEvent(evt) method. You can create events to be dispatched using document.createEvent(). Alternatively, if you're using jQuery, you can do this more simply by simply calling $.mousedown() or $.trigger("mousedown").
has comment: http://stackoverflow.com/comment/44814694

http://stackoverflow.com/q/28258153
upvote count: 2
has body: I have an ordering form, the user needs to signup before he/she can order, so I can create an account then process the order like this. router.post('/project/new', passport.authenticate('local-signup'), function(req, res) { gateway.customer.find(req.user.id, function(err, customer) { if(customer) { // method for a customer inside the vault } else { // add a non existing customer to vault } }); }); The problem is if someone is logged in already and wants to make an order. I need to check if they are logged in, if they are then I can proceed with the order, if they are NOT then I need to authenticate then log them in. So something like this makes sense to me. //prefer this!! router.post('/project/new', function(req, res) { if(req.user) { // do stuff for existing logged in user } else { // user is NOT logged in need passport passport.authenticate('local-signup', function(err, user, info) { // do stuff for new user })(req, res, next); } }); The problem with that is I get next is not defined, I see in the passportjs docs Jared uses this custom callback inside a get route. Can someone help me make a custom callback? Does anyone have a better strategy?
tagged with: node.js
type: AnsweredQuestion
has title: Custom callback passportjs?
accepted answer: http://stackoverflow.com/a/28258333
type: Question
tagged with: javascript
tagged with: passport.js
tagged with: express
score: 2
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28258333
favorite count: 0

http://stackoverflow.com/a/28171507
has comment: http://stackoverflow.com/comment/44747038
type: Answer
has comment: http://stackoverflow.com/comment/44747579
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44747539
accepted answer of: http://stackoverflow.com/q/28168471
answers question: http://stackoverflow.com/q/28168471
type: AcceptedAnswer
downvote count: 0
has body: On your "doc" route, you should use the waitOn in order to have the data ready on page load. Add a loading template in the Router.configure as well I recommend you to upgrade to the new iron:router routes declarations and also add meteorhacks:subs-manager for better cache on the subscriptions. This is an example that should work in your case var subs = new SubsManager(); Router.route('/doc/:_id', { name: 'doc', template: 'doc', waitOn: function() { return subs.subscribe('aPix', this.params._id); }, data: function() { return { apix: MyPix.findOne({ _id: this.params._id }) }; } }); and on the server side create a publications.js Meteor.publish('aPix', function(id) { check(id, String); return MyPix.find(id); });

http://stackoverflow.com/q/28263221
has answer: http://stackoverflow.com/a/28263469
favorite count: 0
has answer: http://stackoverflow.com/a/28263453
accepted answer: http://stackoverflow.com/a/28263453
has body: I am looking for a way to save state of text areas. Right now if I click the save button I am getting html without changes that I have made in text areas. Is there any way to save the html file with the comments inserted into text area? So basically a user is getting a simple html file locally, he opens it in browser and makes comments to the table rows on the left. After he finish, he clicks the save button, saves the file so another person can read his comments. Test Test2 Insert comment here... Test Test2 Insert comment here... The number of rows to comment will be created dynamically.
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44883521
possible better answer: http://stackoverflow.com/a/28263469
type: Question
tagged with: javascript
answer count: 2
upvote count: 1
has title: Save html textarea state

http://stackoverflow.com/a/28138474
has body: You can save the state of toggle button inside setOnCheckedChangeListener() in shared preferences. And whenever you load the activity for the second time you can use that shared preferences value inside oncreate() method to set the state of toggle button.
upvote count: 1
answers question: http://stackoverflow.com/q/28138358
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44648558
score: 1

http://stackoverflow.com/comment/45008387
type: QuestionComment
type: Comment
has text: Yes i saw this example and already made working prototype with 5 y-axes based on this example. But nvd3 (or another chart library) has a lot of other completed things, such as lines showing/hiding or changing chart type without reloading of the page and a lot of other stuff.
score: 0
comment on: http://stackoverflow.com/q/28278476

http://stackoverflow.com/comment/44837846
comment on: http://stackoverflow.com/q/28238297
score: 1
has text: Search for [dirty-checking](https://docs.angularjs.org/guide/scope). How is your code related with the question exactly?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/102459107
score: 0
type: Comment
has text: @JacobBudin Hi. How can I fix the distance between the blue, red and green bars? In my case when there is more data the bar comes close and if the data is for say only 1 then the bars are very far apart. Thanks in advance. :)
type: AnswerComment
comment on: http://stackoverflow.com/a/28181877

http://stackoverflow.com/q/28194814
has title: Confusion of WebStorm type recognition of function return types
answer count: 1
downvote count: 0
tagged with: javascript
has body: Using the following code: /** * @typedef {foo} MyFoo * @property {String} fooText * @property {Number} fooValue */ /** * @type {MyFoo} */ var foo = { fooText : '', fooValue : 0 }; /** * @param {MyFoo} someFoo * @returns {MyFoo} */ function doStuff(someFoo) { var result = Object.create(foo); result.fooText = someFoo.fooText + '!'; result.fooValue = someFoo.fooValue + 1; return result; } var someFoo = Object.create(foo); someFoo.fooText = 'Hello'; someFoo.fooValue = 3; var someOtherFoo = doStuff(someFoo); var anotherFoo = doStuff(someOtherFoo); I create a type MyFoo. I use this type as both the parameter and the return value of the function doStuff. Then, I repeatedly call the doStuff function, first with an object created with Object.create, then with the return value of the previous call. Here is the issue: Argument type MyFoo is not assignable to parameter type MyFoo Plus, someOtherFoo and anotherFoo are not auto-completed with the MyFoo properties anymore. What's happening?
tagged with: webstorm
favorite count: 0
accepted answer: http://stackoverflow.com/a/28196923
tagged with: jsdoc
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28196923

http://stackoverflow.com/a/28242901
downvote count: 0
has body: Posting answer... Call val() to set text on text area as you did in change function.. This is to answer why append() doesn't work. The append() just add another node to caller node in HTML DOM.
accepted answer of: http://stackoverflow.com/q/28241863
answers question: http://stackoverflow.com/q/28241863
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer

marker
tag name: marker
tags question: http://stackoverflow.com/q/28175986
type: Tag

http://stackoverflow.com/comment/44822660
has text: Using toggle breaks looping through the divs to rehide them :(
comment on: http://stackoverflow.com/q/28229459
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28151733
has body: Yes, they are the same. Well sortof--one of them will work in your project and one of them won't because of the url you use when you include the file. But the packages from github and cdn are the same.
upvote count: 0
type: Answer
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/28150592

fastclick.js
tags question: http://stackoverflow.com/q/28216483
tag name: fastclick.js
type: Tag

http://stackoverflow.com/a/28148058
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44668420
answers question: http://stackoverflow.com/q/28147755
has comment: http://stackoverflow.com/comment/44668281
has comment: http://stackoverflow.com/comment/44667761
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44668473
accepted answer of: http://stackoverflow.com/q/28147755
type: Answer
has comment: http://stackoverflow.com/comment/44668509
has body: Try below code: - Use setInterval 1st Step : You should create one common function which will fetch all data form Database as below. function fetchData(){ $(".data-contacts-js tbody").empty(); // this will remove all . $.get("http://localhost:8080/Hotels/reservation/getAllBookingDetails", function(data) { $.each(data, function(i, contact) { $(".data-contacts-js").append( " " + contact.custId + " " + " " + contact.custName + " " + " " + contact.custMobile + " " + " " + contact.custEmail + " " + " " + contact.custAddress + " " + " " + contact.Date + " " + " " + contact.Time + " " ); }); }); } Step 2: Make function which will call function automatically in every 10 sec. using SetInterval as below. $(document).ready(function(){ setInterval(function(){ fetchData(); },10000); // this will call your fetchData function for every 10 Sec. }); Step 3: Make one event function for refresh button click event and put this function in .ready() function. $('#fetchContacts').click(function() { fetchData(); });

http://stackoverflow.com/comment/44769581
type: Comment
comment on: http://stackoverflow.com/a/28190991
type: AnswerComment
has text: This works nearly exactly how I wanted. The only small "bug" I see is when you mouse over these 2 blue lines from your example they stay highlighted (both) unless you click one. When you click 1 of them one highligh gets reset and then the function works like it should. Have a look at my page http://members.upcpoczta.pl/w.racek/mapa.html I have refreshed it with your code. As you can see when the map loads, and you mouseover routes they keep getting highlighted. Only one route at a time should be highlighted. I hope you get me :) To be honest, I don't know how to do that.
score: 0

http://stackoverflow.com/a/28275861
answers question: http://stackoverflow.com/q/28275746
type: Answer
has comment: http://stackoverflow.com/comment/44906805
has body: If you need to call Javascript/jQuery function in an UpdatePanel you need place them inside the pageLoad() function: &lt;script type="text/javascript"&gt; function pageLoad() { $('body').flipLightBox(); } &lt;/script&gt; This will call it on every update of the UpdatePanel.
score: 0
has comment: http://stackoverflow.com/comment/44906422
has comment: http://stackoverflow.com/comment/44906374
has comment: http://stackoverflow.com/comment/44906632

http://stackoverflow.com/q/28266884
tagged with: iframe
has answer: http://stackoverflow.com/a/28270719
type: Question
has title: How can I execute code in an iFrame's onload event?
has answer: http://stackoverflow.com/a/28267417
tagged with: javascript
has answer: http://stackoverflow.com/a/28287968
has comment: http://stackoverflow.com/comment/59948676
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44892374
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/17158932
tagged with: onload
has comment: http://stackoverflow.com/comment/44892466
has body: I am currently using Ace (http://ace.c9.io/) to take code from an editor and execute it within an iFrame. My issue is that when I add something along the lines of Code in Editor to the head or body of the iFrame, the code is never executed. This is my current code: Injecting Code into iFrame $("#btnRun").click(function(event) { event.preventDefault(); // iFrame with id="preview" var preview = $("#preview").contents(); // Get code from editor and wrap in "; // Append code to head or body, in this case head preview.find("head").append(script); }); The code is successfully added to the iFrame, however it is never executed. I can also successfully add HTML/CSS and it displays in the iFrame, but the javascript is never touched. I have tried wrapping the code in script tags within the editor only, as well as using an escape character on the closing tag: " " but to no avail. This is the iFrame in my index.html document. iFrame in index.html #document After the code is injected the iFrame looks like this iFrame with Injected Code #document Also when calling the window.onload or window.top.onload event from within the iFrame, the code executes but only affects the page containing the iFrame and not the contents of the iFrame itself. Thank you. Note: When the code is not within window.onload it runs fine. However I wish to be able to execute this code when the frame's onload function is executed.
has comment: http://stackoverflow.com/comment/44890775
has comment: http://stackoverflow.com/comment/44891124

http://stackoverflow.com/comment/44836174
type: QuestionComment
score: 0
has text: @LightnessRacesinOrbit: OK. thanks for your valuable comment. what is the solution with safely, cleanly and robustly for this problem ? Teach me...
comment on: http://stackoverflow.com/q/28190200
type: Comment

http://stackoverflow.com/q/28209900
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/44784505
has comment: http://stackoverflow.com/comment/44784429
tagged with: kendo-ui
answer count: 1
downvote count: 0
favorite count: 0
has title: How to create Telerik MVC Combobox via JavaScript
has answer: http://stackoverflow.com/a/28215860
tagged with: telerik
upvote count: 1
tagged with: combobox
has comment: http://stackoverflow.com/comment/44784402
type: AnsweredQuestion
score: 1
has body: I want to implement the ability to dynamically add comboboxes and I have to use Telerik ComboBox for that. I put this logic into button click. $('#add-presenter').click(function (e) { e.preventDefault(); var combobox = '@(Html.Telerik().ComboBox() .Name("Presenters[" + (Model.Count) + "]") .BindTo(new SelectList(LeaderList, "ID", "Value")) .ClientEvents(ev => ev.OnChange("onSelect")) .DataBinding(bnd => bnd.Ajax().Select("_LoadJournalist", "MonitoringFRadio")) .Filterable(filter => filter.FilterMode(AutoCompleteFilterMode.StartsWith)) .HtmlAttributes(new { style = "width:320px;vertical-align:middle;" }))'; combobox = combobox.split('Presenters[' + index + ']').join('Presenters[' + (index + 1) + ']'); index++; $('#presenters-block').append(combobox); } This code renders in browser as this: $('#add-presenter').click(function (e) { e.preventDefault(); var combobox = ' select '; combobox = combobox.split('Presenters[' + index + ']').join('Presenters[' + (index + 1) + ']'); index++; $('#presenters-block').append(combobox); combobox = $('#Presenters\\['+index+'\\]').data('tComboBox'); }); The problem is in data-binding. This code generates proper HTML, but newly added list doesn't "drop" When I do combobox = $('#Presenters\\['+index+'\\]').data('tComboBox'); for newly added item I get undefined (it exists, but data isn't set), so combobox.dataBind(dataSource) approach doesn't work.
type: Question
has comment: http://stackoverflow.com/comment/44789050
accepted answer: http://stackoverflow.com/a/28215860

http://stackoverflow.com/a/28534382
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28205036
has body: Resolved - the issue was the server version of Shoutcast being used. Updating the server version fixed the problem.
answers question: http://stackoverflow.com/q/28205036

http://stackoverflow.com/a/28226623
has body: I think you are looking for 'closure' here. Try: function MyObject(/* constructor params */) { //assign properties to 'this' return function() { return this; //&lt;== placeholder implementation }.bind(this); } var obj1 = new MyObject(); Now if you do console.log(obj1) you will see function() { [...] } and you will be able to do obj1() to execute your function. As a bonus in the code above, I also added this binding in the 'closure' as you will need it in most cases that you are doing anything interesting.
answers question: http://stackoverflow.com/q/28226461
type: Answer
score: 0

http://stackoverflow.com/comment/44935575
comment on: http://stackoverflow.com/a/28276699
type: AnswerComment
has text: If you need more help with `urllib2.Request` please ask a new question (after searching for existing answers first, of course).
score: 0
type: Comment

http://stackoverflow.com/q/28154190
has body: I have this code: Hi friends I need to get in a new div called result as i showed, an array of td's parentNodes until I get BODY. The result should be like this: TD TR TABLE DIV BODY I tried with: function mouseEventHandler(mEvent) { // Internet Explorer if (mEvent.srcElement) { alert(mEvent.srcElement.nodeName); } // Netscape and Firefox else if (mEvent.target) { var ularraydom = document.getElementById("ularraydom"); ularraydom.innerHTML = " " + mEvent.target.parentNode.nodeName; + " "; } }
has comment: http://stackoverflow.com/comment/44680104
has comment: http://stackoverflow.com/comment/44680216
possible better answer: http://stackoverflow.com/a/28154469
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28154469
accepted answer: http://stackoverflow.com/a/28154395
type: Question
has title: print parentNode until body
tagged with: arrays
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28154395

http://stackoverflow.com/comment/44791161
type: QuestionComment
score: 0
has text: What are trying to do by preventing reload?
comment on: http://stackoverflow.com/q/28213613
type: Comment

http://stackoverflow.com/comment/44626955
comment on: http://stackoverflow.com/q/28126918
has text: Awesome! I need a lot of practise in my ability to ask questions clearly as well as getting my code across as intended! Thanks for your time.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44778802
comment on: http://stackoverflow.com/a/28206720
score: 0
has text: @Sethe23 or you can use brackets: `localStorage["member-data"]`
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28137557
answer count: 1
has title: Chrome Extension - Turn background page on / off programatically
has answer: http://stackoverflow.com/a/28140176
type: AnsweredQuestion
score: 0
has body: Is it possible to turn a Chrome Extension background page off and on programatically rather than disable it through the Extensions page in Chrome? I have a Chrome Extension that uses a background page to access a user's webcam (getUserMedia) - however nothing can turn off the webcam once started. Is there a way to disable the background page or pause it, then restart it later programatically? Or once you had turned it off would it then be disabled and unable to receive the call to turn back on? Any help appreciated. Feel like I'm banging my head against a brick wall with this one.
tagged with: google-chrome
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28140176
tagged with: google-chrome-extension

http://stackoverflow.com/a/28197965
type: Answer
has body: I'd suggest coming at the problem from a different approach. The values come from the language: why create computed fields when you can more tightly couple the language and the values? http://jsfiddle.net/Quango/m80L37y8/ First, I added a values property to each language, that has the text you wanted in an array: self.langSet = [{ langTxt: "English", langVal: langVal1, values: [{ theDropTxt: "Three Twenty", theDropVal: selVal1 }, { theDropTxt: "Four Eighty", theDropVal: selVal2 }, { theDropTxt: "Two Fifty", theDropVal: selVal3 }] }, { langTxt: "Français", langVal: langVal2, values: [{ theDropTxt: "Trois-cent Vingt", theDropVal: selVal1 }, { theDropTxt: "Quatre cent quatre-vingt", theDropVal: selVal2 }, { theDropTxt: "Deux cent cinquante", theDropVal: selVal3 }] }]; I changed the selectionSet to an observableArray self.selectionSet = ko.observableArray([]); Lastly I added a .subscribe to the setLang observable so we can spot when it changes: // subscribe to changes in language and change selections self.setLang.subscribe(function (newValue) { // change the array self.selectionSet(newValue.values); }); When the setLang is changed, this triggers the subscription. This then changes the second dropdown source to use the new language. I think this is a neater solution that using computed values.
upvote count: 1
has comment: http://stackoverflow.com/comment/44776119
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28189865
answers question: http://stackoverflow.com/q/28189865

http://stackoverflow.com/comment/44807166
score: 2
has text: `s.value = {x}`? Maybe you wanted `s.textContent = x`?
comment on: http://stackoverflow.com/q/28222002
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28245548
type: Answer
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28170340
has body: Using the EventSocket or simply a shell script calling fscli -x "reloadxml"
answers question: http://stackoverflow.com/q/28170340

http://stackoverflow.com/q/28175032
answer count: 1
has comment: http://stackoverflow.com/comment/44720353
favorite count: 0
type: UnansweredQuestion
tagged with: php
has body: Ok so i'm trying to count IP. I have a PHP version and a JQuery/Javascript version. PHP works a dream, except for not outputting to screen until the PHP script has finished but i'm ok with that. The issue I'm having is with the jquery/javascript version. Counting the 4th Octet is fine but when it comes to counting the 3rd Octet i'm having a strange issue. Basically if my range is 10.211.55.254 - 10.211.56.2, i'm good. But if i was to increase to 10.211.56.3 or above ip addresses i get the following results: 10.211.55.250 10.211.56.250 This only happens if increase, reducing to below 10.211.55.254 still works. So here are the scripts from each, where i'm i going wrong/missing on the Javascript? The Javascript var startiparrayslice = startiparray.slice( 0, 2); for ( var octet3 = startiparray[2] ; octet3 &lt;= endiparray[2]; octet3++) { var pingip2 = startiparrayslice.join(".") + "." + octet3; if (startiparray[3] &gt; endiparray[3]) { endiparrayorig = endiparray[3]; endiparray[3] = 255; } for ( var octet4 = startiparray[3] ; octet4 &lt;= endiparray[3]; octet4++) { if (octet4 == endiparray[3]) { startiparray[3] = 0; endiparray[3] = endiparrayorig; } var pingip = pingip2 + "." + octet4; $.post("ping-query-process.php", { pingformip:pingip }, . The PHP $ipnetwork = array_slice($iprangestartex,0,2); $ip = implode(".",$ipnetwork); for ($octet3=$iprangestartex[2];$octet3&lt;=$iprangeendex[2];$octet3++) { $ipaddress = $ip . "." . $octet3; if ($iprangestartex[3] &gt; $iprangeendex[3]) { $iprangeendexorig = $iprangeendex[3]; $iprangeendex[3] = "255"; } for ($octet4=$iprangestartex[3];$octet4&lt;=$iprangeendex[3];$octet4++) { if ($octet4 == $iprangeendex[3]) { $iprangestartex[3] = "0"; $iprangeendex[3] = $iprangeendexorig; } $ipaddress4 = $ipaddress . "." . $octet4; $pingresult = exec("/bin/ping -c 1 $ipaddress4", $result, $status); if (0 == $status) { $status = "alive"; } else { $status = "dead"; } echo "The IP Address, $ipaddress4, is ".$status."&lt;br /&gt;&lt;br /&gt;"; } }
score: 1
has comment: http://stackoverflow.com/comment/44724759
has comment: http://stackoverflow.com/comment/44721764
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28183070
downvote count: 0
has comment: http://stackoverflow.com/comment/44727867
tagged with: javascript
tagged with: jquery
has title: PHP vs Javascript For Iteration

http://stackoverflow.com/comment/44787780
comment on: http://stackoverflow.com/a/28211058
has text: Could you please answer my above question. Thanks.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28134244
has title: JSON Data Assigning to Javascript Var Value
has answer: http://stackoverflow.com/a/28134282
has comment: http://stackoverflow.com/comment/44640791
upvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44640793
tagged with: chart.js
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: Im retrieving JSON Data and assigning those into Javascript and display Chart (im using Chart.js). [{"name":"yasiru","col1":"300","col2":"50","col3":"100","col4":"40","col5":"120"}] var pieData = [ { value: obj[0].col1, color:"#F7464A", highlight: "#FF5A5E", label: obj[0].name }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ]; when i run this. label : obj[0].name correctly show the Yasiru name without any problem. but Value is not. so i tried just alert(obj[0].col1); then it shows 300 as i needed. am i doing something wrong? Here PHP code im using. FYI $row = mysqli_fetch_array($result); $response = array('name' =&gt; $row['username'], 'col1' =&gt; $row['first'], 'col2' =&gt; $row['second'], 'col3' =&gt; $row['third'], 'col4' =&gt; $row['fourth'], 'col5' =&gt; $row['five'] ); $responses[]=$response;
has comment: http://stackoverflow.com/comment/44640790
accepted answer: http://stackoverflow.com/a/28134282
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28134265
has answer: http://stackoverflow.com/a/28134265
favorite count: 0

http://stackoverflow.com/comment/44722177
type: QuestionComment
score: 0
type: Comment
has text: You do not have ng-controller="UserController" right? you should be good.
comment on: http://stackoverflow.com/q/28175785

http://stackoverflow.com/comment/44632171
type: Comment
has text: And that's exactly why you always need to add a column class like `.col-xs-12`. Never use use Bootstrap's grid without understanding you need to have a `.container`, `.row` and a column class
comment on: http://stackoverflow.com/a/28126137
score: 0
type: AnswerComment

http://stackoverflow.com/a/28171330
type: Answer
answers question: http://stackoverflow.com/q/28170707
score: 1
has comment: http://stackoverflow.com/comment/131885531
has comment: http://stackoverflow.com/comment/131885387
upvote count: 1
has comment: http://stackoverflow.com/comment/132151998
has body: With pure JavaScript: var defaults = { "shares": 0, "comments": 0, "likes": 0 }; var arr = [{"shares":50,"comments":10},{"likes":40,"shares":30},{"comments":10}]; arr.slice().map(function(e) { for (var key in defaults) { e[key] = e[key] || defaults[key]; } return e; }); This keeps you original array as it was. If you want to change your original array you can do following: var defaults = { "shares": 0, "comments": 0, "likes": 0 }; var arr = [{"shares":50,"comments":10},{"likes":40,"shares":30},{"comments":10}]; arr.forEach(function(e) { for (var key in defaults) { e[key] = e[key] || defaults[key]; } }); You can get the default values from the array with following snippet: var defaults = arr.reduce(function(m,v) { for (var key in v) { m[key] = 0; } return m; }, {});
downvote count: 0

http://stackoverflow.com/a/28139037
type: Answer
has comment: http://stackoverflow.com/comment/44666004
has comment: http://stackoverflow.com/comment/46044920
has body: You can just use a loop and do: var a = 5; var arr = []; for(var i=0; i&lt;a; i++) { arr.push(i); } As others have stated in their answers, Array direct assignment is even faster than Push Having used jsperf, that appears to be incorrect for Chrome/Firefox. See below: http://jsperf.com/js-array232 From this, I would use push as stated in my answer above.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28139015
has comment: http://stackoverflow.com/comment/44662656
accepted answer of: http://stackoverflow.com/q/28139015
downvote count: 1
score: 8
upvote count: 9
has comment: http://stackoverflow.com/comment/44665715
has comment: http://stackoverflow.com/comment/44666898

http://stackoverflow.com/a/28221273
has comment: http://stackoverflow.com/comment/44805861
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44805700
downvote count: 0
has comment: http://stackoverflow.com/comment/44805992
has body: jsFiddle Demo You need to delegate the click event to a selector instead of assigning it once the first time the code runs. This will allow it work for future elements and not just the elements it finds when it is first run. $('body').on('click','span.element.anotherClass',function(e) { alert("ANOTHER ACTION"); }); You may also want to make sure you only add the class once. Further, in order to make sure the previous onclick events are removed, you will need to iterate through them and remove the onclick assignment. $('.addButton').click(function(e){ $('span.element').not('.anotherClass').each(function(){ this.onclick = void 0;//void 0 is just undefined }).addClass("anotherClass"); });
type: Answer
answers question: http://stackoverflow.com/q/28221193
has comment: http://stackoverflow.com/comment/44805961

http://stackoverflow.com/comment/44626582
comment on: http://stackoverflow.com/a/28126694
has text: @Vader: Right. That implies that the `User` function just set a *global variable*, which is bad practice. If you tried to create three users this way, each new user's name would simply overwrite the previous one. All you're doing at that point is setting properties on a global object, not creating new ones.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44823994
comment on: http://stackoverflow.com/a/28230492
type: Comment
has text: yes i m getting data for $results when i did pr($results) i m getting array as i mention in above question you can see the array
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44828778
comment on: http://stackoverflow.com/q/28232312
score: 0
has text: That's the error I'd have expected when you were still missing the `B`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28244963
upvote count: 1
has comment: http://stackoverflow.com/comment/44851021
has comment: http://stackoverflow.com/comment/44851129
has body: The reason it does nothing is because Javascript doesn't execute setTimeout callbacks synchronously. It will execute it asynchronously by adding it to the event loop and then continue on to your next command while it waits to execute your callback. You need to pass your second animation into the timeout, instead of whatever donothing() is. function runAnimation() { // Do your first step document.getElementById("object1").style.WebkitAnimation = "fadein 1.7s"; //Then pass a function to setTimeout that will execute your second step setTimeout(function(){ document.getElementById("object2").style.WebkitAnimation = "fadein 1.7s"; }, 5000); //wait 5 seconds } MDN - WindowTimers.setTimeout() A basic example about how setTimeout uses async callbacks to 'break' the execution flow. // this first console call will be executed immediately console.log('I will execute immediately!'); // this function will be scheduled to execute after 2 seconds. // Even though its defined second, it will execute last! setTimeout(function(){ console.log('Ill execute last, event though Im defined second!') }, 2000) // Javascript will just continue forward, making a note that in // 2 seconds it has to execute that ^ function. // That means this next call will come next despite the // previous function not being executed yet. console.log('Ill come second!');
accepted answer of: http://stackoverflow.com/q/28244895
has comment: http://stackoverflow.com/comment/44851261
answers question: http://stackoverflow.com/q/28244895
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44851645
type: Answer
has comment: http://stackoverflow.com/comment/44850948
score: 1

http://stackoverflow.com/comment/44728666
type: Comment
type: QuestionComment
score: 0
has text: What about `.setAttribute()` function?
comment on: http://stackoverflow.com/q/28179689

http://stackoverflow.com/q/28267808
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44892272
has comment: http://stackoverflow.com/comment/44892362
upvote count: 1
has comment: http://stackoverflow.com/comment/44895002
has comment: http://stackoverflow.com/comment/44892161
downvote count: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44893210
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44891858
has title: jquery error $ is not a function
score: 0
has body: I'm trying to use highchart library for an application. I don't understand why I have this error: TypeError: $ is not a function $(function () { I tried to add jQuery.noConflict(); but it doesn't work Here's my code: I tried: Sorry i'm french i don't really understand your post. I added one script you give me and jQuery.noConflict() but i have always the same error Test Test
has comment: http://stackoverflow.com/comment/44891794
has answer: http://stackoverflow.com/a/28267897
has answer: http://stackoverflow.com/a/28267833
has comment: http://stackoverflow.com/comment/44893415

http://stackoverflow.com/q/28135741
tagged with: css
has body: I m a beginner to angular.. Help me with this code.. How to inherit name property of callme controller to mee controller? I don know how to use broadcast in this code... Name: hello {{name}}! age: hello {{name}} {{age}}!!!
tagged with: angularjs
downvote count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28136212
tagged with: angularjs-scope
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28136447
has title: Angular js inherit properties of one controller form another controller
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44643767
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28126661
answer count: 1
favorite count: 0
tagged with: geometry
type: AnsweredQuestion
downvote count: 0
tagged with: famo.us
score: 1
tagged with: math
type: Question
has body: I am struggling with connecting two circles with a line. I am using the famo.us library. DEMO on Codepen a.k.a. "Two balls, one line." The Problem Angle and length of the line are correct, but the position is wrong. First attempt The important part should be lines 114-116: connection.origin = [.5, .5]; connection.align = [.5, .5]; connection.body.setPosition([ Math.min(sourcePos.x, targetPos.x), Math.min(sourcePos.y, targetPos.y) ]); Appearently i am doing something wrong with the math. Playing around with those values gives me all kinds of results, but nothing is close to correct. Intended solution (1) The minimal solution would be to connect the centres of the circles with the line. (2) The better solution would be a line that is only touching the surface of both circles instead of going to the center. (3) The ideal solution would have arrows on each end of the line to look like a directed graph.
accepted answer: http://stackoverflow.com/a/28127457
tagged with: graphics
tagged with: javascript
has answer: http://stackoverflow.com/a/28127457
has title: Connect two circles with a line (with DOM elements)
upvote count: 1

http://stackoverflow.com/q/28258201
has comment: http://stackoverflow.com/comment/44888521
has body: I want to get the result from a JsonRPC call to a PHP server per JavaScript for further usage (drawing chart with Chart.js). For this I have a function which should do the call and return the result. I use this jQuery plugin: https://github.com/datagraph/jquery-jsonrpc $.jsonRPC.setup({ endPoint: '/jsonserver.php' }); var res; // first place function getMyStuff() { var res; // second place as alternative $.jsonRPC.request('getResultsById', { params: [1], success: function(result) { alert(JSON.stringify(result, null, 4)); // works well res = result; }, error: function(result) { alert("error: " + JSON.stringify(result, null, 4)); } }); return res; } My problem is that I don't know how to get the result out of the success block. If I call the function I always get undefined.
type: Question
tagged with: chart.js
accepted answer: http://stackoverflow.com/a/28266155
tagged with: javascript
has comment: http://stackoverflow.com/comment/44887850
has title: Drawing chart with Chart.js filled with data gotten per JsonRPC
possible better answer: http://stackoverflow.com/a/28269085
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28269085
tagged with: jquery
tagged with: callback
has comment: http://stackoverflow.com/comment/44875181
tagged with: json-rpc
has answer: http://stackoverflow.com/a/28266155
has comment: http://stackoverflow.com/comment/44874975
type: AnsweredQuestion

http://stackoverflow.com/q/28210320
has answer: http://stackoverflow.com/a/28211445
has comment: http://stackoverflow.com/comment/44785645
favorite count: 0
accepted answer: http://stackoverflow.com/a/28211445
upvote count: 1
has body: My search script lists 10 MP3 results from MySQL using while. I want to open a player when the user clicks the "play" button, then change the text to "stop". Every thing is working fine in the following script, but it works only for the first result. If I click other results, they play the first result only. How can I toggle the "play/stop" buttons on all my search results? Javascript: PHP: if(mysql_num_rows($raw_results) > 0){ while($results = mysql_fetch_array($raw_results)) { $title = $results['title']; $download = $results['url']; $album = $results['album']; $size = $results['size']; echo ' '; echo ' '; echo $size; echo ' '; echo ' '; echo ' '.$title.' '; echo ' Movie : '.$album.' '; echo ' '; echo ' Download '; echo ' '; echo 'Play'; echo ' Player '; echo ' '; echo ' '; } } CSS: #playtext { padding-left:10px; float:left; height:27px; font-size:13px; padding-top:4px; } #player { display: none; }
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44785155
score: 1
tagged with: toggle
type: Question
has comment: http://stackoverflow.com/comment/44785454
has comment: http://stackoverflow.com/comment/44785817
downvote count: 0
has title: Toggle each button in a set of results
tagged with: javascript
has comment: http://stackoverflow.com/comment/44785227
answer count: 1

http://stackoverflow.com/comment/45003453
has text: I have an update! I remember you saying the external id needed to be unique, so I added a random id (for testing of course). Now I am able to create the task with the external data, and I can retrieve the task successfully with the tasks/external:12345 url, BUT i still do not see the external data i set being returned in the response at all. I believe the 500 error i was experiencing was because of the external ID being the same on multiple create requests (i have run a lot of tests, apparently one of them worked to create it!).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28223618
type: Comment

http://stackoverflow.com/q/28240051
possible better answer: http://stackoverflow.com/a/28240196
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44841148
answer count: 4
has title: Showing a span that has been dynamically added
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28240215
has comment: http://stackoverflow.com/comment/44841373
upvote count: 1
has answer: http://stackoverflow.com/a/28240175
type: Question
score: 1
has answer: http://stackoverflow.com/a/28240196
accepted answer: http://stackoverflow.com/a/28240215
has answer: http://stackoverflow.com/a/28240195
has body: I asked a question in relation to adding a click event to dynamically added elements and I learned to use on() to enable event delagation. However I'm still having an issue targeting the dynamically created content. Specifically a span with a class desc. This is where I add the dynamic content: $('#jobs-list-2').append(" " + title + "" + ", " + location + " " + "Department: " + dept + " "); $('#jobs-list-2').append(" " + description + " "); $('#jobs-list-2').append("Click for Details"); I then assign a click event to the details_btn class: $('#jobs-list-2').on("click", ".details_btn", function () { $(this).parent().closest('.desc').show(); }); However it doesn't seem to find an element with this class and nothing is shown. I'm not sure how I could go about fixing this. Any help would be much appreciated.
downvote count: 0

http://stackoverflow.com/a/28222388
answers question: http://stackoverflow.com/q/28222276
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/68138173
has comment: http://stackoverflow.com/comment/77595053
has comment: http://stackoverflow.com/comment/67730099
has comment: http://stackoverflow.com/comment/75776017
score: 109
upvote count: 110
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/88010466
accepted answer of: http://stackoverflow.com/q/28222276
has body: These setter and getter allow you to use the properties directly (without using the parenthesis) var emp = new Employee("TruMan1"); if (emp.name) { // uses the get method in the background } emp.name = "New name"; // uses the setter in the background This is only to set and get the value of the property.

http://stackoverflow.com/comment/44753210
type: Comment
type: QuestionComment
has text: I read that "one" does what "on" does but just once. Where should I put on("keydown", function () { $("label [for='" + $(this).attr('name') + +"']").removeClass("error"); self.removeClass("error"); }); ? I really appreciate your time
score: 0
comment on: http://stackoverflow.com/q/28192859

http://stackoverflow.com/comment/44723546
type: QuestionComment
comment on: http://stackoverflow.com/q/28177110
score: 0
has text: you can't 2 way bind primitives. which is why you should always have a dot in `ng-model` which means you are using an object to bind to
type: Comment

http://stackoverflow.com/q/28202389
tagged with: livereload
upvote count: 1
type: Question
has title: Gulp-livereload, -webserver and -embedlr. How to use them together?
has answer: http://stackoverflow.com/a/28266432
tagged with: javascript
tagged with: gulp-watch
accepted answer: http://stackoverflow.com/a/28266432
answer count: 1
downvote count: 0
tagged with: gulp
favorite count: 0
tagged with: gulp-livereload
has body: I try to understand how to use gulp with these useful and popular plugins. There are what I have: runned go(lang) server on localhost:8000 static/local html files under app folder which are used by server to form pages scss files under the same directory, which are converted into css and then autoprefixed Here is my gulpfile.js: var gulp = require('gulp'), sass = require('gulp-sass'), watch = require('gulp-watch'), autoprefixer = require('gulp-autoprefixer'), livereload = require('gulp-livereload'); // "./" - it's "app" directory gulp.task('default', function() { return gulp.src('./*.scss') .pipe(watch('./*.scss')) .pipe(sass()) .pipe(autoprefixer('&gt; 5%')) .pipe(gulp.dest('./')); }); So what I need: watch html, css/scss files for change and make reload on localhost:8000 (chrome's open tab) it will be great if there is no need to use: livereload chrome plugin expressjs framework reload html pages if it opened directly just like file without server I've read that it is possible to achieve this by using gulp-embedlr and gulp-webserver. If so, how to do it?
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44823816
comment on: http://stackoverflow.com/a/28230620
type: AnswerComment
type: Comment
has text: @iamabin: Why don't you just try it?
score: 1

http://stackoverflow.com/q/28214955
has answer: http://stackoverflow.com/a/30559711
has comment: http://stackoverflow.com/comment/49190744
has body: Consider the following very simplified example: var some_module = { func_a: function() { return 'a'; }, func_b: function(character) { if (character == 'b') { console.log(this); //refers to window return this.func_a; } else { return 'X'; } }, func_c: function() { console.log(this); //refers to some_module return "abcdefgh".replace(/[abc]/g, this.func_b); } }; some_module.func_c(); This fails because in func_b, "this" refers to window because of the call context (as far as i know). I am aware of workarounds, that usually work when nesting functions, however how can I get it to work in this case where the function is used as a callback in .replace()?
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: JavaScript "this" context in .replace callback
possible better answer: http://stackoverflow.com/a/30559711
type: Question
score: 0
answer count: 2
tagged with: this
tagged with: javascript
tagged with: callback
favorite count: 0
linked to: http://stackoverflow.com/q/3127429
has answer: http://stackoverflow.com/a/28215029
accepted answer: http://stackoverflow.com/a/28215029

http://stackoverflow.com/a/28196777
score: 1
upvote count: 1
downvote count: 0
has body: I have found a better solution for this where the bug is resolved: Alternative to iFrames with HTML5
type: Answer
answers question: http://stackoverflow.com/q/28193993

http://stackoverflow.com/comment/44804709
type: QuestionComment
has text: @sawsan Guess, you should think about your app design, cause the way when you need multiple listeners for resize event is a sign that smth. went wrong during design/development. Probably, pub/sub pattern usage suits for your app. But it's difficult to give advices without seeing the code.
comment on: http://stackoverflow.com/q/28220550
score: 0
type: Comment

http://stackoverflow.com/comment/44708592
comment on: http://stackoverflow.com/q/28169455
score: 0
type: Comment
type: QuestionComment
has text: If you're not familiar with currying then you probably won't have an answer to my question (which is about implementing it). I've added Wikipedia's description anyway.

http://stackoverflow.com/q/28271043
tagged with: javascript
tagged with: sorting
accepted answer: http://stackoverflow.com/a/28271299
has comment: http://stackoverflow.com/comment/44898508
has title: Sorting multiple arrays based on one
score: 0
has answer: http://stackoverflow.com/a/28271257
has comment: http://stackoverflow.com/comment/46678713
favorite count: 0
has comment: http://stackoverflow.com/comment/44898484
has body: I have 2 arrays: the first one contains a list of score numbers, and the second contains a list of countries with the same number of elements. Each country is linked with its proper score during the input. So, let's say the input arrays are the following: var scores = [2, 5, 3, 1, 4]; var countries = ["Canada", "Macau", "Sweden", "France", "China"]; I need the following output: scores = [1,2,3,4,5] countries = [ "France", "Canada", "Sweden", "China", "Macau" ] A possible solution I can know of is to transform the arrays into a single array containing a list of "score=country" pairs. But I wonder if it's possible to do a miracle with the Array.sort() method, since it accepts a callback function. Any other solutions are welcome too.
upvote count: 2
answer count: 5
downvote count: 2
has comment: http://stackoverflow.com/comment/44898102
has answer: http://stackoverflow.com/a/28271299
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28271180
has comment: http://stackoverflow.com/comment/44897944
has answer: http://stackoverflow.com/a/28271297
has comment: http://stackoverflow.com/comment/44898536
has comment: http://stackoverflow.com/comment/44898782
type: Question
possible better answer: http://stackoverflow.com/a/28271093
has answer: http://stackoverflow.com/a/28271093
tagged with: arrays

http://stackoverflow.com/comment/86369691
score: 0
type: AnswerComment
has text: @SaschaM78 sure :-) i placed a working Fiddle hope this helps?
type: Comment
comment on: http://stackoverflow.com/a/49671541

http://stackoverflow.com/comment/44622906
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28123421
type: QuestionComment
has text: @AndreaLigios, How to pass audio with the url? and how to receive it?

http://stackoverflow.com/comment/44645205
has text: Just use the index to access the data, e.g. `data[0][0]` would be the datum in the first row, first column.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28136410
score: 1

http://stackoverflow.com/comment/97682956
score: 0
type: Comment
type: QuestionComment
has text: https://i.imgur.com/rFPvvjE.gif no longer works... :(
comment on: http://stackoverflow.com/q/28171188

http://stackoverflow.com/comment/44879374
comment on: http://stackoverflow.com/q/28259019
type: Comment
type: QuestionComment
has text: also if you want your code rewritten you should look at the code review stack exchange
score: 0

http://stackoverflow.com/q/28138609
has comment: http://stackoverflow.com/comment/44648843
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44648943
has comment: http://stackoverflow.com/comment/44685055
has body: I am creating content dynamically inside a Main div , the content is stored in another div with classes... but the content is not visible since the page and all the java scripts are already loaded ... I think I need to refresh the main div with all the classes in order for the content to be visible.....If one can please help me with the code would be great...... Sample code: &lt;div id="grid"&gt; --- Dynamically generated &lt;div class="Test" &gt; &lt;/div&gt; &lt;/div&gt;
type: Question
tagged with: javascript
tagged with: jquery
has title: How to reload a div with ID xyz once the dynamic content is generated

http://stackoverflow.com/comment/44816741
type: Comment
has text: I thought you just wanted a floating-like initial position, without manually calculating it. If you can elaborate on what exactly are you trying to achieve, I might be able to help.
comment on: http://stackoverflow.com/a/28224099
score: 0
type: AnswerComment

http://stackoverflow.com/q/28215797
has comment: http://stackoverflow.com/comment/44800386
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28223872
tagged with: performance
upvote count: 3
has title: AngularJS ng-repeat Performance & Benchmark
type: Question
has body: I am testing the performance of AngularJS in order to decide whether it is suitable for our application or not. In order to measure and compare the speed of DOM creation, I created a JSFiddle example where one can play around with different numbers of items to create. The objective is to display n random users ordered by their project. There is content based on the type of project and if the user is secret, he should not be displayed at all. HTML: &lt;div ng-repeat="user in users | orderBy:'project'" post-repeat-directive ng-if="user.secretagent == false" class="user" ng-class="{male: (user.gender == 'm'), female: (user.gender != 'm')}" ng-switch="user.project"&gt; &lt;h2&gt;{{user.name}}&lt;/h2&gt; Project: {{user.project}} &lt;em ng-switch-when="fame"&gt;[fame]&lt;/em&gt; &lt;em ng-switch-when="idol"&gt;[idol]&lt;/em&gt; &lt;/div&gt; Javascript: angular.module('AngularBench', []) .config(['$compileProvider', function ($compileProvider) { $compileProvider.debugInfoEnabled(false); }]) .controller("benchmarkController", ['$scope', 'TimeTracker', function($scope, TimeTracker) { $scope.result = undefined; $scope.users = []; $scope.benchmark = function(size) { TimeTracker.clockStartDate(size); var users = getUsers(size); $scope.users = users; $scope.$watch( function () { return TimeTracker.getDuration(); }, function(newVal, oldVal) { $scope.result = newVal; }, true ); }; }]) .factory('TimeTracker', function() { var start, end, duration; return { clockStartDate: function() { start = Date.now(); }, clockEndDate: function() { end = Date.now(); duration = (end - start) / 1000; }, getDuration: function() { return duration; } }; }) .directive('postRepeatDirective', ['$timeout', 'TimeTracker', function($timeout, TimeTracker) { return function(scope, element, attrs) { if (scope.$last){ $timeout(function(){ TimeTracker.clockEndDate(); }); } }; }]); function getUsers(size) { var users = []; for (var i=0; i&lt;size; i++) { var user = { name: 'User ' + i, gender: Math.random() &gt;…
has comment: http://stackoverflow.com/comment/44833730
tagged with: javascript
has comment: http://stackoverflow.com/comment/44795023
answer count: 1
downvote count: 0
tagged with: angularjs-ng-repeat

http://stackoverflow.com/comment/44765723
comment on: http://stackoverflow.com/q/28197735
type: QuestionComment
has text: No, because `&&` does [short-circuit evaluation](https://en.wikipedia.org/wiki/Short-circuit_evaluation).
type: Comment
score: 1

metro-ui-css
tags question: http://stackoverflow.com/q/28228585
tag name: metro-ui-css
type: Tag

http://stackoverflow.com/a/28204092
answers question: http://stackoverflow.com/q/28202866
type: Answer
accepted answer of: http://stackoverflow.com/q/28202866
has body: I ended up in a solution,that has given me desired result.What I did is,call initMap() function onload event as usual,but hide the map at first using visibility:hidden.When sub_map button would be clicked, map visibility will be visible. $lee=" ";
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28208225
answers question: http://stackoverflow.com/q/28207913
type: Answer
has body: I think it's not a good way to make index of element's name. Rather you can get the selected value and set it to it's immediate next text element, $("select[name=a]").change(function(){ // get index of your select control console.log($(this).index("select")); // this line will set the selected value to it's immediate next element. You can also handle on which elements you want to show the selected value by specifying the type ,name or class of the element. $(this).next().val($(this).val()); }); jsFiddle
score: 0

http://stackoverflow.com/comment/44801500
score: 0
has text: Are you using `session_start()` before you try to set a cookie in PHP?
comment on: http://stackoverflow.com/q/28219038
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44635042
comment on: http://stackoverflow.com/q/28131219
score: 0
type: Comment
type: QuestionComment
has text: You will need to declare those two functions as require modules. Currently, you're just defining global functions.

http://stackoverflow.com/q/28262074
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/44881725
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28275138
tagged with: amcharts
has body: How can I retrieve data from Parse.com through javascript or API and display it with amcharts.js or highcharts.js? Or are there any other chart js I can try? Thanks in advance.
type: Question
tagged with: highcharts
tagged with: javascript
score: 0
answer count: 1
has title: Retrieve data from Parse.com and Display it in amcharts.js or highchart.js
accepted answer: http://stackoverflow.com/a/28275138

http://stackoverflow.com/comment/44682132
type: Comment
comment on: http://stackoverflow.com/a/28154107
type: AnswerComment
has text: That's exactly what `.toolbar` is doing in OP's code, it "selects" a correct window, or an (i)frame element depending on the used browser and attributes within the (i)frame tag.
score: 0

http://stackoverflow.com/q/28244885
has answer: http://stackoverflow.com/a/28244945
tagged with: module
type: UnansweredQuestion
has title: IIFE VS anonymous closesure.
score: 2
has comment: http://stackoverflow.com/comment/44850487
has body: Javascript rookie here. While reading module patterns. I noticed this anonymous function which has parenthesis inside function scope. I have not used this before. I'd like to understand it better. // first example (function(){ //this is IIFE I always use to avoid globle var. I think the simple form of this is F(); })(); // second example (function () { //However, what is this concept? what's the formal name of this function? }()); what are major differences between these two? How I understand the second example?
has comment: http://stackoverflow.com/comment/44853244
has comment: http://stackoverflow.com/comment/44850515
type: Question
upvote count: 2
downvote count: 0
answer count: 1
tagged with: self-invoking-function
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44755584
type: QuestionComment
comment on: http://stackoverflow.com/q/28193382
score: 0
type: Comment
has text: it seems as if the exports module wasn't a global object. It has a local scope as a helper to export your modules. That's why it's empty in main. In fact, you don't need to require it nor use it in your main module.

http://stackoverflow.com/a/28195723
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44759653
has comment: http://stackoverflow.com/comment/44760961
accepted answer of: http://stackoverflow.com/q/28195438
score: 4
answers question: http://stackoverflow.com/q/28195438
has body: Angular's jqLite (built-in light version of jQuery) doesn't support .focus(). You'll need to get the actual DOM element and use the Javascript's built-in .focus() element[0].focus() (element[0] gets the DOM element object from a jqLite wrapper element) With .select() it is a bit trickier if you are trying to select the text that comes via ng-model, because by the time the link function runs, the ng-model's value has not yet been interpolated and inserted into the DOM. You'd need to wait until the end of the digest cycle, and the common way I've seen this being done is via $timeout: $timeout(function(){ element[0].select(); });
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/44758779
has comment: http://stackoverflow.com/comment/44760816

http://stackoverflow.com/q/28155421
has title: Using javascript navigate to a page and also send querystring?
has comment: http://stackoverflow.com/comment/44682524
has comment: http://stackoverflow.com/comment/44682199
has comment: http://stackoverflow.com/comment/44682437
type: Question
upvote count: 4
has body: I want to navigate from page1.html to page2.html and at the same time adding querystring in URL using javascript. I tried: window.location.href = 'page2.html?uname=mustafa'; It does navigate to page2.html but "?uname=mustafa" is not added in URL. So am unable to parse querystring on page2. How can I achieve it?
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
answer count: 3
has comment: http://stackoverflow.com/comment/44682338
has comment: http://stackoverflow.com/comment/44683384
tagged with: http://stackoverflow.com/tag/html
tagged with: query-string
has answer: http://stackoverflow.com/a/71047899
favorite count: 0
has comment: http://stackoverflow.com/comment/44682491
has answer: http://stackoverflow.com/a/28156077
has comment: http://stackoverflow.com/comment/44682314
has answer: http://stackoverflow.com/a/28155821
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44682290

http://stackoverflow.com/comment/44783223
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28209243
has text: @surajck: No, that's not correct.
score: 1

http://stackoverflow.com/comment/44678995
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28153678
has text: `console.log(data);` What does it return in the console? Is it what you expect?
score: 4

http://stackoverflow.com/comment/44618923
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28121918
has text: hi have found the error :) i didn't leave the spaces between the comment tag and the words. and i also edited your answer. as your code will work only once. thanks :)
score: 0

http://stackoverflow.com/comment/44763203
score: 1
comment on: http://stackoverflow.com/q/28198049
has text: Hi. maybe this will work for you. The idea is to push null values before your data. This will move all the collumns to the right and will reduce the space between them. http://jsfiddle.net/x6djt6c7/
type: QuestionComment
type: Comment

activexobject
tags question: http://stackoverflow.com/q/28226615
type: Tag
tag name: activexobject

http://stackoverflow.com/comment/44865737
comment on: http://stackoverflow.com/a/28244021
type: AnswerComment
type: Comment
has text: I don’t think you can get a reliable value without actually creating an element that contains sufficiently many characters. You can set it to invisible if desired. If the browser freezes, the problem is elsewhere (e.g. you tried using the code without adding the `span` to the document; it won't work, since its width will remain zero then).
score: 0

http://stackoverflow.com/comment/44751008
has text: Looks like typo.. `smtp` object has property called `servre` and you are using `smtp.server` while setting env variable
score: 1
comment on: http://stackoverflow.com/q/28191677
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44909339
type: AnswerComment
type: Comment
has text: How do i link that to an external XML Source?
comment on: http://stackoverflow.com/a/28277177
score: 0

http://stackoverflow.com/a/28260696
has comment: http://stackoverflow.com/comment/44893339
score: 0
has comment: http://stackoverflow.com/comment/44879835
type: Answer
answers question: http://stackoverflow.com/q/28260537
has comment: http://stackoverflow.com/comment/44878700
has body: The code you posted looks good. If you return this token as part of the JSON result from your server API call, you should be able to access it as a property on the data variable in your success method. Using the network tab of the developer tools in Chrome (F12), what do you see returned from the server when you call /api/signup? Do you see the token there?
has comment: http://stackoverflow.com/comment/44881468

http://stackoverflow.com/comment/44786467
has text: Now the functions running, but callback function gets called first, instead of at last, before all the functions finishes execution.
comment on: http://stackoverflow.com/q/28210730
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44831350
comment on: http://stackoverflow.com/a/28234725
score: 0
type: AnswerComment
type: Comment
has text: makes sense dude, it appears to have nothing to iterate.. Am aware of the `.split()` conversion just didn't know why it was happening. No doubt i've updated ie since coding in it, but get this.. i've just added the following line of code to the above `d1.innerText=cha:{str[0]` and lo-an-behold it displays `cha:{undefined}` in IE? Would this fall under the same indexing rules

http://stackoverflow.com/q/28161804
type: Question
has answer: http://stackoverflow.com/a/28161980
accepted answer: http://stackoverflow.com/a/28161980
has body: I want to get the url in this link: CODE:
tagged with: null
tagged with: javascript
tagged with: get
score: 0
answer count: 2
has title: Jquery ajax POST response is null
tagged with: ajax
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28161845
has answer: http://stackoverflow.com/a/28161845

http://stackoverflow.com/a/28273676
has body: I didn't understood where you are using that js code, but I believe you are trying to use anchor points and if that is the case you can append it to the end of your link url adding #jump_here to the end of your url: f?p=APP_ID:PAGE_ID:SESSION:REQUEST:DEBUG:CLEAR_CACHE:ITEM_NAMES:ITEM_VALUE#ANCHOR_ID Looking at your sample code I think you are missing the Item value parameter in your url. And you could probably use APEX_UTIL.PREPARE_URL instead, read more in here.
answers question: http://stackoverflow.com/q/28269846
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44981492
has comment: http://stackoverflow.com/comment/44972975

http://stackoverflow.com/comment/44876666
type: QuestionComment
comment on: http://stackoverflow.com/q/28259462
has text: You have a typo ('height'), so the condition will never be met. Do you need both conditions to be met? Maybe `||` would be better. Also, do you mean `==`, or should it be `>`? And missing an opening `(` in your `if` statement.
score: 0
type: Comment

http://stackoverflow.com/comment/44878127
score: 2
has text: Sounds like an [XY Problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)
type: Comment
comment on: http://stackoverflow.com/q/28260389
type: QuestionComment

http://stackoverflow.com/comment/44721479
has text: Do you mean the window resizes based on the height of the page ? Lets says your page finished half way the borwser window then should the browser window be half size too ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28176061
score: 0

http://stackoverflow.com/comment/44885859
score: 0
comment on: http://stackoverflow.com/q/28264580
type: Comment
type: QuestionComment
has text: @Pointy You have a point, but in JavaScript we don't have types like decimal in C# to make monetary calculations. How we could achieve that you are talking about? Thank you very much in advance.

http://stackoverflow.com/comment/44777505
type: Comment
type: QuestionComment
has text: It is wrong, you cannot do that
score: 0
comment on: http://stackoverflow.com/q/28205914

http://stackoverflow.com/comment/44838483
has text: There is basically no way to do this properly in ES5. You can do it with [`WeakMap`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) in ES6 but that would mean you can only support very recent browsers.
score: 1
comment on: http://stackoverflow.com/q/28238387
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44906590
type: Comment
type: QuestionComment
score: 4
has text: Check the third example in the entry for `map` in the docs: http://api.jquery.com/map/
comment on: http://stackoverflow.com/q/28276058

http://stackoverflow.com/q/28159782
has title: flash embed does not load settings.xml
answer count: 0
has comment: http://stackoverflow.com/comment/44691638
type: Question
tagged with: flash
tagged with: javascript
tagged with: actionscript
score: 0
has comment: http://stackoverflow.com/comment/44691070
has body: That's it! I need to load a graph from an external website on a different HTML file. I copied the embed code for the flash object and changed paths and sources. However, the flash embed would give me the following message: error loading file: /reports/settings.xml I can't get out of this. I tried typing in the full src and even creating the file myself taking it from the network window of the inspector, but none of this seems to work. The flash would not display. Here I list the code of the embeded object: &lt;embed type="application/x-shockwave-flash" src="https://www.website.com/reports/amline" width="100%" height="400" style="undefined" id="am_chart" name="am_chart" bgcolor="#FFFFFF" quality="high" wmode="transparent" flashvars="path=http://www.website.com/external/amline/&amp;amp;data_file=http://www.website.com/reports/748c120eb849d2436b5eeaa852d2df5c/data.xml&amp;amp;settings_file=/reports/settings.xml&amp;amp;preloader_color=#000000"&gt; There is also this script which seems to be the loader of the flash variables: &lt;script type="text/javascript"&gt; // &lt;![CDATA[ so = new SWFObject("/reports/amline", "am_chart", "100%", 400, "8", "#FFFFFF"); so.addVariable("path", "/external/amline/"); so.addVariable("data_file", "/reports/3b34fac79ddaa7876a7ea4408ae80092/data.xml"); so.addVariable("settings_file", "/reports/settings.xml"); so.addVariable("preloader_color", "#000000"); so.addParam('wmode', 'transparent'); so.write("am_chart"); function resizeFlashDiv() { so.write("am_chart"); // this is to help browsers repaint the div. document.getElementById('am_chart').style.display = 'none'; document.getElementById('am_chart').style.display = ''; } window.addEventListener('resize', resizeFlashDiv, false); // ]]&gt; &lt;/script&gt; I am just stuck in this any help on how to properly embed a flash graph is really appreciated. Thanks!!
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44691229
has comment: http://stackoverflow.com/comment/44691315
has comment: http://stackoverflow.com/comment/44691465
tagged with: http://stackoverflow.com/tag/xml
type: UnansweredQuestion

http://stackoverflow.com/q/28265270
has comment: http://stackoverflow.com/comment/45014442
has comment: http://stackoverflow.com/comment/45136345
tagged with: javascript
tagged with: event-handling
tagged with: dom-events
has comment: http://stackoverflow.com/comment/45331329
score: 0
tagged with: drag-and-drop
has body: I am having trouble trying to get a canvas based square to follow the mouse. Here is the method I am trying to use: canvas.addEventListener('mousedown', function(event) { document.getElementById('debug3').innerHTML = 'works';//Just debug stuff. for (i=0;i&gt;10;i++) { //to loop through squares. document.getElementById('debug5').innerHTML = 'works'; if (mouseX &gt;= square[i].x - 20 &amp;&amp; mouseX &lt;= square[i].x + 40 &amp;&amp; mouseY &gt;= square[i].y - 20 &amp;&amp; mouseY &lt;= square[i].y + 40) {//To see if mouse coordinates equal square ones. square[i].x = mouseX;//Just defining that mouse coordinates equal square ones. square[i].y = mouseY; document.getElementById('debug6').innerHTML = 'works'; } } }, true); I have ten squares I want to choose from, so I put they're coordinates in a array. The -20 and +40 are so I can have a imaginary square that signifies the range which the click is accepted (It is very hard to click on one pixel). These squares are supposed to be animated, so I have a range twice their area (the squares have an area of 400 pixels). The for loop is to loop through the possible squares the user choose. After that, it's pretty obvious. My problem is that that doesn't happen. I stopped animating the squares to make them easier to click for me, but the code just isn't working. According to my debug statements, when I press, the event listener works. That's the first debug statement. The thing is that the for loop never gets triggered and my second debug statement never works. Therefore, nor does my third (you might see them labelled 3, 5, and 6: the first two are my mouse coordinates and the fourth is the mouse up event, which has the same problem). EDIT: Here is the code that defines mouseX and mouseY. function initCanvas() { context.canvas.addEventListener('mousemove',function(event) { var mouseX = Math.floor(event.clientX); var mouseY = Math.floor(event.clientY); document.getElementById('debug1').innerHTML = mouseX; document.getElementBy…
has comment: http://stackoverflow.com/comment/45088033
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45081199
has comment: http://stackoverflow.com/comment/45135557
has title: How do I get a square to follow the mouse coordinates on a mouse click?
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/44923041
has comment: http://stackoverflow.com/comment/45139952
has comment: http://stackoverflow.com/comment/44887149

http://stackoverflow.com/q/28232039
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: websocket
tagged with: web
favorite count: 0
has answer: http://stackoverflow.com/a/28232544
possible better answer: http://stackoverflow.com/a/28232689
has answer: http://stackoverflow.com/a/28232689
has body: I am building a WebApp (ERP) and I need to display the people currently logged in and active on the page. I managed to get something pretty accurate by listening on the mouse/keyboard events and periodically reporting to the DB. I don't know how to mark people offline when they close the page. I tried using onbeforeunload, but it obviously fires when the user simply changes pages (click a link inside the ERP, that point to another page in the ERP). I then tried to use WebSockets, but the problem is the same : everytime the page is realoded, the WebSockets connection is closed. So I can think of two ways: Use WebSockets indeed, and replace all links by a call to a javascript function that would somehow tell the server that the user is going to change page (so that the server doesn't mark it as offline). But that doesn't feel right, semantically speaking, links should be links, it simply points to another location. Use either WebSockets or AJAX and never actually change page: links are replaces by a function that will call for the content, and display it on screen (updating the DOM with Javascript). But again, it doesn't feel right either, because semantically speaking the page would have no meaning and the URL would never change, so the user can't "copy paste" the link of the page to refer to it, right ? So, is there a proper, clean way of doing this? Thanks for your help.
linked to: http://stackoverflow.com/q/24865561
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28232347
accepted answer: http://stackoverflow.com/a/28232544
has title: Proper way to detect user's leaving page
type: Question
upvote count: 4
tagged with: javascript
score: 4
tagged with: ajax
answer count: 3

http://stackoverflow.com/comment/44911022
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28273598
has text: You have save me again! Thank you so much. I believe I need to spend sometime reading about the link that you gave me. I will post more questions in the future, and I will invite you for sure. Any awesome angular book that you recommend me to read(I mean the angular book that I need)? again THANK YOU!

http://stackoverflow.com/a/28182810
answers question: http://stackoverflow.com/q/28182755
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28182755
has body: You first try mixes native methods with jquery methods so it should create an error (the removeClass is a jQuery method, so it only applies to jQuery objects) On your second attempt you try to remove a class with no value.. You should use the jquery method removeAttr() and pass it the attribute name you want removed. $('#page').removeAttr('class'); will completely remove the class attribute If you want to remove the id then use $('#page').removeAttr('id');
type: Answer
score: 0

http://stackoverflow.com/a/28208845
score: 9
upvote count: 9
answers question: http://stackoverflow.com/q/28208732
has body: You could iterate though the data array and add key &amp; value to each element. data[0]["foo"] = bar; // this can be useful if the key is not constant or data[0].foo = "bar"
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28208732

http://stackoverflow.com/q/28270885
has title: Unit test for a funtion in AngularJS controller which calls to a function in Onsen UI with Jasmine
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/44897773
tagged with: javascript
has comment: http://stackoverflow.com/comment/44899701
tagged with: onsen-ui
has comment: http://stackoverflow.com/comment/48980968
score: 0
has comment: http://stackoverflow.com/comment/44897400
has comment: http://stackoverflow.com/comment/44897458
linked to: http://stackoverflow.com/q/19563369
has body: I am making a unit test for a function of a controller in AngularJS code, this function will call to a function in Onsen UI code. But I fail when run it. My code and my test code as bellow: - In app.js file: var module = angular.module('app', ['onsen']); module.controller('myctrl', ['$scope', function($scope) { $scope.startpop = function(index) { $scope.index = index; ons.navigator.popPage(); }; }]); - in test.spec.js file: describe("test myctrl:", function() { var $controller; beforeEach(function() { angular.module('onsen'); module('app'); }); beforeEach(inject(function(_$controller_) { $controller = _$controller_; })); it('test startpop() function', function() { var $scope = {}; var controller = $controller('myctrl', {$scope: $scope}); $scope.startpop(3); expect($scope.index).toEqual(3); }); But I met error when run unit test as bellow: TypeError: Cannot read property 'popPage' of undefined Please help me to solve it ?
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44906111
has comment: http://stackoverflow.com/comment/44897694
has comment: http://stackoverflow.com/comment/44897438

http://stackoverflow.com/q/28220138
upvote count: 2
type: UnansweredQuestion
has body: We are using HP fortify Audit Workbench 3.80 to assess vulnerabilities in our applications. Fortify marks the the following ExtJs JavaScript code as a Critical (the "worst") DOM XSS vulnerability: function doAjaxCall(param1, param2, div) { var options = { url : url, params : { param1 : param1, param2 : param2 }, method: 'GET', success: function(response, options) { processResponse(response, div); }, failure: function(response, options) { doSomethingElse(); } }; Ext.Ajax.request(options); } function processResponse(response, div) { // SECURITY ISSUE HERE document.getElementById(div).innerHTML = '&lt;br&gt;' + 'An error occurred with status code ' + response.status + '&lt;br&gt;&lt;br&gt;'; } response is the response returned from an AJAX request. Fortify says : method "processResponse" sends unvalidated data to a web browser on line 100, which can result in the browser executing malicious code. I understand the issue and why it is an issue. What I do not know is how to sanitize the input with ESAPI. We are using ESAPI successfully for issues in our Java code, but I am not sure to resolve this specific issue in JavaScript. I did find this JavaScript ESAPI library, ESAPI4JS, but I work in an extremely high security environment, and I do not have access to this library whatsoever. How can I use ESAPI to sanitize the response? EDIT Added full ajax request code per user request.
has comment: http://stackoverflow.com/comment/44806208
has answer: http://stackoverflow.com/a/79407003
type: Question
has title: How to use ESAPI to resolve JavaScript DOM XSS?
answer count: 2
has comment: http://stackoverflow.com/comment/44804364
has comment: http://stackoverflow.com/comment/44804085
downvote count: 0
tagged with: javascript
tagged with: esapi
tagged with: ajax
tagged with: xss
tagged with: extjs
has comment: http://stackoverflow.com/comment/44803614
has answer: http://stackoverflow.com/a/28220288
favorite count: 0
score: 2

http://stackoverflow.com/comment/44737295
comment on: http://stackoverflow.com/a/28184009
has text: I also had the feeling that this was a behavior of older browsers. But the question lacked context. Good find though :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28153462
has comment: http://stackoverflow.com/comment/44678438
answers question: http://stackoverflow.com/q/28153400
has comment: http://stackoverflow.com/comment/44678809
type: Answer
has body: It looks like you a trying to move the topbar element to be directly before and element with the class body. This can be achieved using the insertBefore() method: JSFIDDLE DEMO window.onload = function () { //find the element to insert before and then get its parent element var beforeElement = document.getElementById('body'); var parentElement = beforeElement.parentNode; //find the element we want to move //you need the array syntax because 'getElementsByClassName' returns an array of matching elements (even if there is only one match) var moveElement = document.getElementsByClassName('topbar')[0]; //insert the moveElement into the parentElement before the theFirstChild parentElement.insertBefore(moveElement, beforeElement); }; Note: since this code accesses and manipulated the DOM, you need to wrap this whole block in a window.onload = function () { ...script goes here... }; to ensure the DOM has loaded before the script runs. insertBefore() method reference
has comment: http://stackoverflow.com/comment/44686434
score: 0
has comment: http://stackoverflow.com/comment/44686362

http://stackoverflow.com/a/28269705
has body: Why not just use classes and CSS to toggle? Check this fiddle out: //Navbar Hide On Scroll (function ($) { $(document).ready(function () { // hide .navbar first $(".navbar").addClass('hideme'); // fade in .navbar $(function () { $(window).scroll(function () { // set distance user needs to scroll before we fadeIn navbar if ($(this).scrollTop() &gt; 100) { $('.navbar').removeClass('hideme'); } else { $('.navbar').addClass('hideme'); } }); }); }); }(jQuery)); /* Show navbar */ $(function () { $('#shownav').hover(function () { $('.navbar').removeClass('hideme'); }); }); /* when navbar is hovered over it will override previous */ $(function () { $('.navbar').hover(function () { $('.navbar').removeClass('hideme'); }, function () { $('.navbar').addClass('hideme'); }); }); CSS #shownav { height: 20px; } .navbar { position: fixed; top: 0; width: 100%; opacity: 1; -webkit-transition: opacity 0.5s ease-in-out; -moz-transition: opacity 0.5s ease-in-out; -ms-transition: opacity 0.5s ease-in-out; -o-transition: opacity 0.5s ease-in-out; transition: opacity 0.5s ease-in-out; } .navbar.hideme { opacity: 0; }
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28269552
has comment: http://stackoverflow.com/comment/44904637

http://stackoverflow.com/a/28241573
type: Answer
answers question: http://stackoverflow.com/q/28237926
has body: For those who are interested. Here is how I solved the Bower.json issue. I am now using the package grunt-bower-task, which is really nice. Here is my Gruntfile.js module.exports = function(grunt) { require('load-grunt-config')(grunt); }; The install.js at grunt/bower.js module.exports = { install: { options: { targetDir: "./assets/dev/", layout: "byType", install: true, verbose: false, cleanBowerDir: false, cleanTargetDir: true, bowerOptions: {} } } } And my bower.json { "name": "myProject", "version": "1.0.0", "dependencies": { "bootstrap": "latest", "fontawesome": "latest" }, "exportsOverride": { "bootstrap": { "vendor/js": "**/*.min.js", "vendor/css": "**/bootstrap.min.css" }, "jquery": { "vendor/js": "**/jQuery.min.js" }, "fontawesome": { "vendor/css": "**/*.min.css", "vendor/css/fonts": "**/fontawesome-webfont.*" } } } This automatically sorts all files into vendor/css and vendor/js folders in my dev/assets/ folder and only takes those files from the bower.packages, that I have specified. This really helps to keep the whole setup nice and clean!
score: 0

http://stackoverflow.com/q/28171398
tagged with: jquery-bootgrid
type: Question
accepted answer: http://stackoverflow.com/a/28172854
tagged with: plugins
has title: Change Icon in Bootgrid
score: 0
has body: how do I change the sorting icons in Bootgrid. I've tried the following as per the documentation but not working; $("#grid-basic").bootgrid({ icon: 'fa', iconColumns: 'fa-bars', ... }); Thanks,
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28172854
tagged with: jquery-plugins
type: AnsweredQuestion

http://stackoverflow.com/a/28144592
has body: If you already have a list of #ids, then all you have to do is use the document.getElementById query selector: var ids = [ "regpay", "overtime","absent", "nightdiff", "ctpa", "salary", "hdmf", "otallowance", "others"]; var r = []; ids.forEach(function (id) { r.push(document.getElementById(id).innerHTML); }) alert("text found:" + r); 0 1 2 3 4 5 6 7 8 (I used s here, since I didn't want to make a whole table structure, but the above will also work with s. If the above ids refer to input boxes, you should use document.getElementById(id).value instead. Your question wasn't clear on this front.)
accepted answer of: http://stackoverflow.com/q/28144549
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44661433
answers question: http://stackoverflow.com/q/28144549
upvote count: 1

http://stackoverflow.com/q/28267731
tagged with: npm
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47560421
tagged with: node.js
has comment: http://stackoverflow.com/comment/49389070
type: Question
tagged with: commonjs
score: 5
upvote count: 5
tagged with: javascript
has title: Wrapping require
has body: Given 3 Node.js projects Main - Framework - Repositories Main has the two other projects connected via npm link. In a test i wrapped the require in a method. I've got some problems resolving linked projects (details see below) Simplified code looks like this: module.export.resolve = function(file){ [...]//Some more logik to handle relative pathes return require(file) } This works fine in most scenarios. I also worked out to get handled with relatives pathes (looking up for caller and apply pathes based on this path) Now this is in Project Framework which is linked (npm link) to Project Main. Project main has also Project Repositories linked. Now in Project Main i have: require('ProjectRepositories/foo') // Works as expected myRequire.resolve('ProjectRepositories/foo') // Returns MODULE_NOT_FOUND "Cannot find module 'ProjectRepositories/foo' I assume the problem is that Repositories Project ist not linked in the Framework Project. But is there an other way than linking them ? I'd prefer to have less dependencies. Any hints on that?
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/30853171
favorite count: 0

http://stackoverflow.com/a/28239887
score: 5
type: AcceptedAnswer
downvote count: 0
has body: You need to search within the URL itself to find the domain. You can do this with indexOf: $("a").click(function() { var x = $(this).attr("href"); var Site_dont_go = ["#", "youtube.com"]; var validUrl = true; $.each(Site_dont_go, function(i, item) { if (x.indexOf(item) != -1) { validUrl = false; } }); if (!validUrl) { window.open('goto.php?url=' + x); return false; } }); Note that searching for # is not a great idea though, as you will end up excluding any URL with a fragment, eg. http://www.microsoft.com/#foo
type: Answer
has comment: http://stackoverflow.com/comment/44864572
answers question: http://stackoverflow.com/q/28239823
accepted answer of: http://stackoverflow.com/q/28239823
upvote count: 5

http://stackoverflow.com/q/28185809
has title: Calendar displays 24 hour clock and I need 12 hour clock
has body: I have this e-calendar JavaScript code that is displaying 24hour clock format. How do you get it to change to 12 hour clock? Forgive the chopped up code, I had to delete some of it to create the post. I have posted the code below: (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 print() { loadEvents(); var dWeekDayOfMonthStart = new Date(dYear, dMonth, 1).getDay(); var dLastDayOfMonth = new Date(dYear, dMonth + 1, 0).getDate(); var dLastDayOfPreviousMonth = new Date(dYear, dMonth + 1, 0).getDate() - dWeekDayOfMonthStart + 1; var cBody = $('&lt;div/&gt;').addClass('c-grid'); var cEvents = $('&lt;div/&gt;').addClass('c-event-grid'); var cEventsBody = $('&lt;div/&gt;').addClass('c-event-body'); cEvents.append($('&lt;div/&gt;').addClass('c-event-title c-pad-top').html(settings.eventTitle)); cEvents.append(cEventsBody); var cNext = $('&lt;div/&gt;').addClass('c-next c-grid-title c-pad-top'); var cMonth = $('&lt;div/&gt;').addClass('c-month c-grid-title c-pad-top'); var cPrevious = $('&lt;div/&gt;').addClass('c-previous c-grid-title c-pad-top'); cPrevious.html(settings.textArrows.previous); cMonth.html(settings.months[dMonth] + ' ' + dYear); cNext.html(settings.textArrows.next); cPrevious.on('mouseover', mouseOver).on('mouseleave', mouseLeave).on('click', previousMonth); cNext.on('mouseover', mouseOver).on('mouseleave', mouseLeave).on('click', nextMonth); cBody.append(cPrevious); cBody.append(cMonth); cBody.append(cNext); for (var i = 0; i &lt; settings.weekDays.length; i++) { var cWeekDay = $('&lt;div/&gt;').addClass('c-week-day c-pad-top'); cWeekDay.html(settings.weekDays[i]); cBody.append(cWeekDay); } var day = 1; var dayOfNextMonth = 1; for (var i = 0; i &lt; 42; …
downvote count: 4
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44740797
has answer: http://stackoverflow.com/a/28185965
score: -4
has comment: http://stackoverflow.com/comment/44740520
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44740270

http://stackoverflow.com/a/28229798
score: 0
has body: You can use window.performance API: var t0 = performance.now(); doSomething(); var t1 = performance.now(); console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.") https://developer.mozilla.org/en-US/docs/Web/API/Performance.now
type: Answer
answers question: http://stackoverflow.com/q/28204716

youtube-javascript-api
type: Tag
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/28149815
tags question: http://stackoverflow.com/q/28155241
tags question: http://stackoverflow.com/q/28268733

http://stackoverflow.com/comment/73239308
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/36558620
has text: The chart is already set to be responsive. This doesn't fix the problem and could cause problems if there are other charts that shouldn't be responsive.
score: 0

http://stackoverflow.com/a/28178949
has comment: http://stackoverflow.com/comment/44727590
has comment: http://stackoverflow.com/comment/44727449
has body: The closest thing to doing what you want that I can think of would be copying the PHP object to a JavaScript variable via json_encode and then passing that variable back to your PHP code during the AJAX event via the data parameter. PHP code doesn't persist in the way that you seem to be describing - once a page has been requested by a browser, your PHP code for that page is done, there are no variables persisted by the server after that point.
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28176036
answers question: http://stackoverflow.com/q/28176036
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44736801
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44817421
has text: What's the point? The user can get at it by using the Javascript console, and then copy it into the extension.
comment on: http://stackoverflow.com/q/28227093
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28178857
has comment: http://stackoverflow.com/comment/44727034
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28179866
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28179866
has comment: http://stackoverflow.com/comment/44727581
tagged with: ajax
has title: How to refresh PHP file with AJAX
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/44726961
has comment: http://stackoverflow.com/comment/44727071
type: AnsweredQuestion
has body: Okay, so I searched the web as much as I could and I couldn't find the solution on my problem. I also typed the question and searched for an answer as I saw similar questions to mine. Didn't help. I tried numerous solutions. Well I have an index page that loads includes/data.php which loads the data from database and echo the .js format that is then loaded by function and display data on the page, so I have at the end of my index.php something like this: &lt;script type="text/javascript" src="includes/data.php"&gt;&lt;/script&gt; On the same index page I have a form that inserts data to database. If you refresh the page I will see refreshed includes/data.php along with new data I just inputted. I am trying to implement AJAX so that when I click on the button I insert the data to database (already achieved this) and to refresh content of includes/data.php and index.php so it shows data right away without refreshing the index.php. This is my AJAX code: $('#addtocal').submit( function() { $.ajax({ url : $(this).attr('action'), type : $(this).attr('method'), data : $(this).serialize(), success : function( data ) { // This is the part where I am stuck. }, error : function(){ $(".error").fadeIn(2000); $(".error").fadeOut(2000); } }); return false; }); Just to mention that #calendar is where main jquery function is loading the html content based on the info from /includes/data.php. Thank you in advance for any help you can provide and let me know if you need any other information from me in order to better assist me. P.S. I saw many suggested using .load() to load content from includes/data.php but that is not working in my case as the content from includes/data.php needs to serve other jquery function that creates html on the fly and and place it in #calendar
type: Question

http://stackoverflow.com/q/28160175
has comment: http://stackoverflow.com/comment/44691876
answer count: 1
has title: prevent jQuery form submit if validation fail
has comment: http://stackoverflow.com/comment/44695471
has comment: http://stackoverflow.com/comment/44692017
tagged with: jquery
has comment: http://stackoverflow.com/comment/44695384
tagged with: ajax
has body: Hi I'm trying to prevent this AJAX submit form function when a validation fails on one of one of the various inputs. Edit: What I want to know exactly is what I need to include in //Adult age validation and var handleFormSubmit to stop saveForm($('#quotecriteria_form')); and performAjaxSubmit(formData, url); from occurring. Submit function: var handleFormSubmit = function( e ) { e.preventDefault(); var $submit = $('button[type="submit"]'); $submit.addClass('loading'); // Save the contents of the form to session cookie saveForm($('#quotecriteria_form')); var formData = $('#quotecriteria_form').serialize(); var url = $('#quotecriteria_form').attr('action'); performAjaxSubmit(formData, url); } validation functions initialized: IndexPageFunctions = { init: function() { //Validate date range this.validateToDate(); this.validateFromDate(); //Validate adult age this.validateAdultAge0(); this.validateAdultAge1(); this.validateAdultAge2(); this.validateAdultAge3(); //Validate child age this.validateChildAge0(); this.validateChildAge1(); this.validateChildAge2(); this.validateChildAge3(); this.validateChildAge4(); this.validateChildAge5(); this.validateChildAge6(); this.validateChildAge7(); this.validateChildAge8(); }, One of the many validation functions: //Adult age validation validateAdultAge0: function() { $('button[type="submit"]').on('click', function() { var inputVal = parseInt( $("input[name='adultAges[0]']").val()); if (inputVal &lt; 18) { $("input[name='adultAges[0]']").css("border-color","red"); $("div#under18").addClass('show').removeClass('hidden'); } }); },
has answer: http://stackoverflow.com/a/28163910
has comment: http://stackoverflow.com/comment/44692003
has comment: http://stackoverflow.com/comment/44692142
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44692230
has comment: http://stackoverflow.com/comment/44692269
tagged with: forms
has comment: http://stackoverflow.com/comment/44692223
has comment: http://stackoverflow.com/comment/44691750
type: Question
has comment: http://stackoverflow.com/comment/44692251
accepted answer: http://stackoverflow.com/a/28163910
has comment: http://stackoverflow.com/comment/44692179
tagged with: javascript
has comment: http://stackoverflow.com/comment/44691806
has comment: http://stackoverflow.com/comment/44692930
score: 0

http://stackoverflow.com/comment/44731570
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28181137
has text: Yes I know but I want to learn it the Angular way and sometimes Angular is really close to plain javascript.
score: 1

http://stackoverflow.com/comment/44892763
comment on: http://stackoverflow.com/q/28268203
type: Comment
has text: Below in that same function :/ but in the picture I deleted that line haha
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44733422
has text: Might be what you need. http://blessanmathew.com/2014/08/16/ember.js-list-filtering-using-a-multiple-selection-filter-component.html
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28179679
score: 0

http://stackoverflow.com/comment/44807787
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28208721
has text: changing it to 0 doesn't work

http://stackoverflow.com/a/28146555
score: 3
answers question: http://stackoverflow.com/q/28146528
accepted answer of: http://stackoverflow.com/q/28146528
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: section_mid is not a child of press thus your code is not working. You need to traverse the DOM correctly. Use $(this).closest('.section').find(".section_mid").css("height", "auto"); instead of $(".section_mid", this).css("height", "auto"); References .closest() .find()

http://stackoverflow.com/comment/44675777
has text: You asked a question and posted an answer by yourself in less than a minute. Is this point scoring
comment on: http://stackoverflow.com/a/28152264
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28268380
score: 0
tagged with: broccolijs
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28317205
has body: I'm trying to compile two different JS files using broccoli-requirejs. A logical way to go about this seemed to be to run the requireJs filter on my scripts tree twice, with two different configurations. Doing so produces some really strange errors that, to me, resembles a race condition or something. See below for Broccoli config and error output. var compileCoffee = require("broccoli-coffee"), compileStatic = require("broccoli-static-compiler"), mergeTrees = require("broccoli-merge-trees"), requireJs = require("broccoli-requirejs"), _ = require("lodash"); var scripts = compileStatic("app/coffee", { srcDir: "/", destDir: "scripts" }); scripts = compileCoffee(scripts, {bare: true}); var rjsOptions = { baseUrl: "scripts", inlineText: true, optimize: "uglify", stubModules: ["text"], paths: { knockout: "empty:" } }; var fooScript = requireJs(scripts, { requirejs: _.extend(rjsOptions, { include: ["foo"], insertRequire: ["main"], mainConfigFile: "scripts/main.js", name: "main", out: "scripts/main.js" }) }); var barScript = requireJs(scripts, { requirejs: _.extend(rjsOptions, { insertRequire: ["bar"], mainConfigFile: "scripts/main.js", name: "bar", out: "scripts/bar.js" }) }); module.exports = mergeTrees([ fooScript, barScript ]); I get the following error when building this: $ broccoli build build Error: Merge error: file scripts/bar.js exists in /home/fredrik/app/tmp/require_js_filter-tmp_dest_dir-yMHQNi3F.tmp and /home/fredrik/app/tmp/require_js_filter-tmp_dest_dir-C8Wv970J.tmp Pass option { overwrite: true } to mergeTrees in order to have the latter file win. at mergeRelativePath (/home/fredrik/app/node_modules/broccoli-merge-trees/index.js:98:21) at mergeRelativePath (/home/fredrik/app/node_modules/broccoli-merge-trees/index.js:122:17) at /home/fredrik/app/node_modules/broccoli-merge-trees/index.js:23:5 at $$$internal$$tryCatch (/home/fredrik/app/node_modules/broccoli-merge-trees/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:490:16) at $$$internal$$i…
has title: Error building two different files from same tree with broccoli-requirejs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44915679
has comment: http://stackoverflow.com/comment/44917449
type: Question
tagged with: requirejs
tagged with: lodash
answer count: 1
has answer: http://stackoverflow.com/a/28317205

http://stackoverflow.com/q/28159832
has answer: http://stackoverflow.com/a/28159909
accepted answer: http://stackoverflow.com/a/28159909
has title: Angular not showing non-English letters in ui-router views
type: Question
tagged with: angular-ui-router
has body: My web page contains Hebrew letters. I've added this at the beginning of index.html: &lt;html lang="he"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; And all the Hebrew letters are shown correctly. But when I load a state with ui-router, the letters in the view's html shown as symbols. Part of the page shows Hebrew, and the ui-view part shows only symbols. Thanks.
upvote count: 4
linked to: http://stackoverflow.com/q/64860
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/a/28259085
has body: Add a counter var count = 0; function markAsUpdated(){ if (count == 0) { updated = true; alert('updated') jQuery( ".sortable" ).off('sortupdate', '**', markAsUpdated); count++; } }
type: Answer
answers question: http://stackoverflow.com/q/28258982
has comment: http://stackoverflow.com/comment/44881925
score: 0

http://stackoverflow.com/q/28200299
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/8644428
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I want to have text that when click-dragged over, highlights the text and stores the highlighted text in a variable. I'm not sure where I would start with this, from my research it looks like it might be possible with html5 and canvas but I'm not too experienced with html5 so any help is greatly appreciated.
tagged with: css
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28200533
type: Question
type: AnsweredQuestion
has title: How can I "paint" a highlighter onto text?
linked to: http://stackoverflow.com/q/8644428
answer count: 1
accepted answer: http://stackoverflow.com/a/28200533

http://stackoverflow.com/q/28167017
tagged with: javascript
tagged with: jquery
tagged with: click
has title: Remove specific jQuery click event from element
tagged with: events
upvote count: 6
favorite count: 0
score: 6
has answer: http://stackoverflow.com/a/28167040
accepted answer: http://stackoverflow.com/a/28167040
type: AnsweredQuestion
has body: I understand event can be removed from an element by using .unbind() or .off(). However I am wondering if is that possible to remove specific click event and leave others attached. For example assuming I have a element with two events attached as follow: $("#MyDiv").click(function() { alert("I am first Event"); }); $("#MyDiv").click(function () { alert("I am second Event"); }); Is that possible to remove First event and leave second one attached, using some sort of key?
type: Question
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28242682
upvote count: 1
has body: works on SO?! this is referencing 1.2 follow the migration example to get ti working with 1.3 https://docs.angularjs.org/guide/migration Angular Demo {{author.name}} {{author.title + ', ' + author.company}}
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28242616

http://stackoverflow.com/q/28278486
downvote count: 1
has comment: http://stackoverflow.com/comment/44911516
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28278800
has body: I have an array of objects like this [Object, Object, Object] the structure of every object like this 0: Object children: Array[0] node_id: 0 parent_id: -2 text: "(r , e , w)" value: 6 1: Object children: Array[0] node_id: 1 parent_id: 0 text: "(r)" value: 3 2: Object children: Array[0] node_id: 2 parent_id: 0 text: "(e , w)" value: 3 first I have for loop and I want to get parent_id every iteration second I want to put last two objects into the children array inside first object Any help appreciated.
type: Question
upvote count: 0
tagged with: arrays
tagged with: javascript
has title: get and set values of object inside array in javascript
accepted answer: http://stackoverflow.com/a/28278800
answer count: 1
linked to: http://stackoverflow.com/q/18017869
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/44911312
has comment: http://stackoverflow.com/comment/44911395

http://stackoverflow.com/q/28218999
has comment: http://stackoverflow.com/comment/44802166
answer count: 3
has title: Incorrect day difference between two dates
downvote count: 1
has answer: http://stackoverflow.com/a/28220426
linked to: http://stackoverflow.com/q/28213029
favorite count: 0
linked to: http://stackoverflow.com/q/41948
has answer: http://stackoverflow.com/a/28219750
type: UnansweredQuestion
tagged with: datetime
upvote count: 0
has body: I have the following code that now calculates the correct minutes, but the days does not calculate correctly. Also, needed help added code that will calculate mon-fri only and exclude sat/sun. Date format I used subtract(DDMMYYY) : 01/01/2015 20:21 - 01/01/2015 20:22. This returns 4.1 using the code below. The ".1" is correct, one minute difference. The 4 is incorrect as its not more than a day. Note - I searched other threads and couldnt find the solution. my code is below: function stringToDate(s) { var dateParts = s.split(' ')[0].split('/'); var timeParts = s.split(' ')[1].split(':'); var d = new Date(dateParts[0], --dateParts[1], dateParts[2]); d.setHours(timeParts[0], timeParts[1]); return d; } function test() { var a = slat_1.value; var b = slar_1.value; var x = (new Date(stringToDate(a) - stringToDate(b))); //converting milliseconds x = 1000*Math.round(x/1000); // round to nearest second var d = new Date(x); alert( d.getUTCDay() + '.' + d.getUTCMinutes() ); }
type: Question
has comment: http://stackoverflow.com/comment/44801549
linked to: http://stackoverflow.com/q/3224834
tagged with: javascript
has answer: http://stackoverflow.com/a/28219091
has comment: http://stackoverflow.com/comment/44801562
score: -1
has comment: http://stackoverflow.com/comment/44801397

http://stackoverflow.com/comment/44637726
has text: *"it simply display the code"* - Is your file `.php` extension?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28132545
type: Comment

http://stackoverflow.com/comment/44812502
type: Comment
has text: I have already edited my question to make it clear then why is this negative vote ?
score: 0
comment on: http://stackoverflow.com/q/28224473
type: QuestionComment

bluebird
tags question: http://stackoverflow.com/q/28238074
tags question: http://stackoverflow.com/q/28164642
tags question: http://stackoverflow.com/q/28218329
tags question: http://stackoverflow.com/q/28222439
tags question: http://stackoverflow.com/q/28267376
tags question: http://stackoverflow.com/q/28221469
tags question: http://stackoverflow.com/q/28231970
tag name: bluebird
type: Tag
tags question: http://stackoverflow.com/q/28247389
tags question: http://stackoverflow.com/q/28250680

http://stackoverflow.com/comment/45529822
comment on: http://stackoverflow.com/a/28602033
type: AnswerComment
score: 1
has text: And how do I do it? I couldn't find any player full screen events
type: Comment

http://stackoverflow.com/a/28221616
has body: It's kind of obvious where you going wrong. You need to either escape your quotes or change to single quotes inside double quotes
score: 0
has comment: http://stackoverflow.com/comment/44806236
answers question: http://stackoverflow.com/q/28221566
type: Answer
has comment: http://stackoverflow.com/comment/44806238

http://stackoverflow.com/a/33199251
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/70968311
score: 23
upvote count: 23
has comment: http://stackoverflow.com/comment/63014017
answers question: http://stackoverflow.com/q/28251644
has comment: http://stackoverflow.com/comment/62990812
has body: I had to disable plugin if the screen width is bigger than 854px. Sure, you can change the code to fit your needs. Here is my solution: Check the viewport width before call the plugin. If width is good to call the plugin, call the plugin. Else add the 'off' class to show as if the plugin has already been called and destroyed. When resizing: 3.1. If width is good to call the plugin AND the plugin hasn't been called yet or it was destroyed earlier (I use the 'off' class to know it), THEN call the plugin. 3.2. if width isn't good to call the plugin AND the plugin is active now, THEN destroy it with Owl's trigger event destroy.owl.carousel and remove the unnecessary wrapper element 'owl-stage-outer' after it. $(function() { var owl = $('.owl-carousel'), owlOptions = { loop: false, margin: 10, responsive: { 0: { items: 2 } } }; if ( $(window).width() &lt; 854 ) { var owlActive = owl.owlCarousel(owlOptions); } else { owl.addClass('off'); } $(window).resize(function() { if ( $(window).width() &lt; 854 ) { if ( $('.owl-carousel').hasClass('off') ) { var owlActive = owl.owlCarousel(owlOptions); owl.removeClass('off'); } } else { if ( !$('.owl-carousel').hasClass('off') ) { owl.addClass('off').trigger('destroy.owl.carousel'); owl.find('.owl-stage-outer').children(':eq(0)').unwrap(); } } }); }); And a bit of CSS to show disabled Owl element: .owl-carousel.off { display: block; }

http://stackoverflow.com/a/28203274
answers question: http://stackoverflow.com/q/28203140
score: 7
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44892564
has body: Made small changes to your existing code: jsFiddle var today = new Date(); var dd = ("0" + (today.getDate())).slice(-2); var mm = ("0" + (today.getMonth() + 1)).slice(-2); var yyyy = today.getFullYear(); today = yyyy + '-' + mm + '-' + dd ; $("#todays-date").attr("value", today);
accepted answer of: http://stackoverflow.com/q/28203140
type: Answer
upvote count: 7
has comment: http://stackoverflow.com/comment/44801906

http://stackoverflow.com/a/28167416
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has body: Basic question, but there you go. Obviously, to do this you need JavaScript code. Chrome's Content Security Policy forbids inline code, so the code must go into a separate .js file (say, popup.js) and included in the HTML: The code should: a. Read the value from localStroage b. Find the element on the page c. Assign its src property. // Read the value var url = localStorage.url; // or = localStorage["url"]; // or = localStorage.get("url"); // Find the element var element = document.getElementById("myUrl"); // Assign the property element.src = url; // or .setAttribute("src", url); Of course, all of this can be compressed in a single line of code by removing the temp variables url and element (see below). There is a problem with this, however. The code will execute when the element is read - before the #myURL element is read. Therefore, it will fail, as element will not be found and will be undefined. There are two ways to fix it: a. Move the tag below the element it refers to, like you did in options.html b. Wrap your code in a listener for an event that page is fully parsed and ready for it. I prefer this solution. document.addEventListener("DOMContentLoaded", function() { document.getElementById("myUrl").src = localStorage.url; }); Further reading: DOMContentLoaded event HTML Storage An alternative: chrome.storage API.
has comment: http://stackoverflow.com/comment/44708238
accepted answer of: http://stackoverflow.com/q/28166076
type: Answer
answers question: http://stackoverflow.com/q/28166076

http://stackoverflow.com/comment/44640606
type: QuestionComment
comment on: http://stackoverflow.com/q/28127388
has text: Would you show us a script where `data` is coming from?
score: 0
type: Comment

http://stackoverflow.com/a/28176942
score: 0
has comment: http://stackoverflow.com/comment/44725795
has comment: http://stackoverflow.com/comment/44730909
type: Answer
answers question: http://stackoverflow.com/q/28174857
has body: The easiest way to do this is with a simple string of consecutive digits and the .indexOf() method. Assuming that you are looking for ONLY whether or not there are consecutive digits in the string and not what they are, the longest group of consecutive digits, or anything like that (that would take more coding :) ), then the following function would work: function hasConsecutiveDigits(sValue) { var sConsecutiveDigits = "012345678909876543210"; var regDigitPattern = /\d{2,}/g; var aDigitGroups = sValue.match(regDigitPattern); if (aDigitGroups !== null) { for (j = 0; j &lt; aDigitGroups.length; j++) { for (x = 0; x &lt; (aDigitGroups[j].length - 1); x++) { var sCurrDigits = aDigitGroups[j].substring(x, x + 2); if (sConsecutiveDigits.indexOf(sCurrDigits) !== -1) { return true; } } } } return false; } The sConsecutiveDigits string contains all of the possible consecutive digit patterns, so you can simply capture any group of one or more digits (using the regDigitPattern regex value) and then see if any two-digit subgroup of those groups exists as a substring of the sConsecutiveDigits string. Additionally, since you are only looking for "yes, it has consecutive digits" or "no, it does not have consecutive digits", you can exit from the check as soon as you have found a match, cutting down on the processing a little. I tested the function using the following code: var aTestData = ["ae12", "aeg12345km", "mea65", "ab2d43a21", "poe09ac", "adsas", "asd13sad", "asda1357sd", "sd4dfg3dfg5df"]; for (i = 0; i &lt; aTestData.length; i++) { var result = hasConsecutiveDigits(aTestData[i]); console.log("'" + aTestData[i] + "' " + ((result) ? "contains" : "does not contain") + " consecutive digits.") } . . . and recieved the following results: 'ae12' contains consecutive digits. 'aeg12345km' contains consecutive digits. 'mea65' contains consecutive digits. 'ab2d43a21' contains consecutive digits. 'poe09ac' contains consecutive digits. 'adsas' does not contain consecutive digits. 'asd13…
has comment: http://stackoverflow.com/comment/44726379

http://stackoverflow.com/q/28199396
answer count: 1
has title: Unsafe javascript error because of wrong query param in angular js
score: 0
has body: {{ angularvariable }} Lets say angularvariable = stack. When I'm trying to use the above, I get unsafe javascript error. In the query params, I see someparam=stack'); This must be the problem for unsafe javascript error, but how to solve this ? Below is newPopup function
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28199618
tagged with: angularjs
type: Question

http://stackoverflow.com/q/28127097
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28127415
tagged with: canvas
has title: Canvas make event activate when mouseover specific coordinate
tagged with: mouseover
tagged with: http://stackoverflow.com/tag/html
has body: So what I want to do is make it that when I mouseover the canvas somewhere around (340x, 100y) it will run whatever I tell it to do inside. ctx.canvas.addEventListener('mouseover', function(event){ ctx.clearRect(0, 0, 1000, 1000); }); All I have is that above, and I don't know how to make it use a specific coordinate. Also while I'm at it, how could I make the same thing happen but with an entire array? Thanks ahead of time for any helpful suggestions. Oh, and I'm NOT using JQuery. JUST Javascript and HTML.
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28127583
tagged with: javascript
tagged with: event-listener
accepted answer: http://stackoverflow.com/a/28127583
possible better answer: http://stackoverflow.com/a/28127415

http://stackoverflow.com/q/28254515
has answer: http://stackoverflow.com/a/67309031
favorite count: 0
upvote count: 16
has title: Push data into JSON array
answer count: 4
type: AnsweredQuestion
has body: I'm making a Chrome app and I want to save the name and the artist of a song into a json file. I know how that can be done, but I don't know how to put in the data (here: title and artist) into a json array. We assign: var favorites = []; So if someone presses the star, the artist and the name of the song should be put into favorites: $(document).on('click','.fa-star-o', function() { var title = $(this).parent().find('.tracktitle').text(), artist = $(this).parent().find('.artist').text(); $(this) .removeClass('fa-star-o') .addClass('fa-star'); $(' ') .append(''+ title +'') .append(''+ artist +'') .prependTo($favorites); });
accepted answer: http://stackoverflow.com/a/28254562
tagged with: http://stackoverflow.com/tag/json
score: 16
type: Question
has answer: http://stackoverflow.com/a/69356860
possible better answer: http://stackoverflow.com/a/28254875
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28254875
has comment: http://stackoverflow.com/comment/44867757
has answer: http://stackoverflow.com/a/28254562

http://stackoverflow.com/q/28123124
has comment: http://stackoverflow.com/comment/44620085
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44620257
upvote count: 2
has comment: http://stackoverflow.com/comment/44620179
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44620393
has title: How to get value form Input as numbers to calculate gcd?
score: 2
has body: I use math.js to calculate gcd for a series of numbers wich are taken from input. Among the tested options I mention: parseInt() and parseFloat() IaNr=document.getElementById("nrs").value math.gcd(nrs.value); math.gcd($("#nrs").val()) IaNr.toString() but it doesn't work. what am I missing, because it doesn't calculate the numbers from input. it works when I provide the numbers directly. ex: math.gcd(4, 8, 25,74) &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/1.2.0/math.min.js"&gt;&lt;/script&gt; $(function(){ IaNr=$("#nrs").val() DoGcd=math.gcd(IaNr) $("#show").html(DoGcd) }) &lt;input id="nrs" value="14,92,34,78"&gt; &lt;div id="show"&gt;&lt;/div&gt;
has answer: http://stackoverflow.com/a/28127360
has comment: http://stackoverflow.com/comment/44620047
tagged with: mathjs
type: Question
has comment: http://stackoverflow.com/comment/44620236
has answer: http://stackoverflow.com/a/28123575
has answer: http://stackoverflow.com/a/28123150
tagged with: math
tagged with: javascript
has comment: http://stackoverflow.com/comment/44620026

http://stackoverflow.com/a/28248877
answers question: http://stackoverflow.com/q/28248627
has body: In your Dropdown js code you have a event listener called close. In here you can grab the selected element by calling this.inputEl.val(). This will give you a id number thats assigned to that particular nav item you clicked. With that number create the url that would correspond with the Id and make a ajax call to that url. Get the contents from the url and append them where you want to. Maybe something like this if(this.inputEl.val() == 1){ herf = "test.com/home" }else if(this.inputEl.val() == 2){ href = "test.com/music" }//etc $.ajax({ method: 'GET', url: herf, success: function(content) { $('#apDiv2').html(content); } }); So you are going to have to put code like this into that close function in the dropdown js essentially.
has comment: http://stackoverflow.com/comment/44857979
has comment: http://stackoverflow.com/comment/44858141
type: Answer
has comment: http://stackoverflow.com/comment/44859178
score: 0
has comment: http://stackoverflow.com/comment/44858287

http://stackoverflow.com/comment/44889656
comment on: http://stackoverflow.com/q/28266557
has text: It runs every time you recompile the entire app. To avoid, recompile only the added directive. Or better yet, don't add directives or manipulate the DOM in the controller. Read this to understand how ["to think in Angular"](http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44889878
type: AnswerComment
has text: While this answer may be valid, it's better with an explanation. See [Help Center > How do I write a good answer?](http://stackoverflow.com/help/how-to-answer): *Brevity is acceptable, but fuller explanations are better*.
type: Comment
comment on: http://stackoverflow.com/a/28265377
score: 1

http://stackoverflow.com/comment/44764883
has text: You're doing the `typeof` test in the constructor, not when the event has occurred. You need to put that in another function that's triggered by the event.
comment on: http://stackoverflow.com/q/28199235
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28263980
upvote count: 0
answer count: 1
has title: Using Chakra(JsRT) engine, how to use JsRuntimeAttributeAllowScriptInterrupt?
tagged with: javascript
has answer: http://stackoverflow.com/a/28271444
favorite count: 0
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: internet-explorer
score: -1
has body: I am using JsRT script API interface to interact with MSIE script engine. There is a flag called 'JsRuntimeAttributeAllowScriptInterrupt' for runtime. How can I set callback or abort current evaluation of javascript? I am using following JsRT C# sample. Title : JavaScript Runtime Hosting Sample URL : https://code.msdn.microsoft.com/windowsdesktop/JavaScript-Runtime-Hosting-d3a13880

http://stackoverflow.com/comment/44844196
has text: sorry @XGreen, didn't get it...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28241602

http://stackoverflow.com/q/28226739
has title: Kendo pie chart best fit labels
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28226880
type: Question
tagged with: charts
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28226880
has body: Is it possible to position the Kendo Pie Chart labels depending on whether there is enough room for them to fit inside the Pie Chart, just like the best fit option in Excel? So if they can fit they go inside and if they can't an arrow will point to them from the outside. Possibly similar to this: Kendo barchart category labels left and right based on value I don't mind doing it manually if I have to because I don't think Kendo has the feature built in.
tagged with: kendo-ui
tagged with: kendo-dataviz
favorite count: 0
upvote count: 2
linked to: http://stackoverflow.com/q/19735935

http://stackoverflow.com/q/28256151
type: Question
tagged with: javascript
upvote count: 3
tagged with: javafx-webengine
tagged with: javafx-8
has answer: http://stackoverflow.com/a/39084193
answer count: 1
has body: I'm using JavaFX 8 embedded WebView. I want to build Blob URL from an Blob image. But, URL.createObjectURL gives me undefined. Is there any way (shim or eg.) to create Blob URL from Blob object in JavaFX 8 WebView environment??
favorite count: 0
type: UnansweredQuestion
score: 3
downvote count: 0
tagged with: java
tagged with: javafx
has title: JavaFX WebView URL.createObjectURL undefined

http://stackoverflow.com/q/28143151
has body: I know that in the following html + javascript/jquery code, the three items will all fade in simultaneously. What I don't really know is why. http://jsfiddle.net/jengzz9g/ My understanding is that each fadeIn effect would get added to the event loop FIFO queue. But don't all events in this queue get handled synchronously and each event handler runs to completion until the next in the queue is called? If so, shouldn't each fadeIn effect happen one at a time? Obviously, this is not what is happening (and it wouldn't be good if it did). Instead is something like this happening? foo fades in for 16ms (assuming 60hz repainting) and then the handler calls itself thus putting itself back on the queue; then bar fades in for 16ms, then its handler calls itself; then baz fades in and its handler calls itself. This cycle continues for 5000ms. Something like this would make sense, but I am just guessing and would like to know for sure how it works.
has answer: http://stackoverflow.com/a/28143236
has comment: http://stackoverflow.com/comment/44657979
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/28143171
has answer: http://stackoverflow.com/a/28143372
has answer: http://stackoverflow.com/a/28143256
accepted answer: http://stackoverflow.com/a/28143256
has answer: http://stackoverflow.com/a/28143171
has answer: http://stackoverflow.com/a/28143369
tagged with: javascript
has answer: http://stackoverflow.com/a/28143346
answer count: 6
tagged with: jquery
favorite count: 0
has title: Trying to understand the javascript event loop: Why do effects occur simultaneously?
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/44846921
score: 0
type: Comment
has text: I have a question. If I set this function like this: function compare(a, b) { if (b.x) return 1; } it does still work, because it always compare a to be, and if b is true (id doesn;t really matter what the a is) then it moves it one index back. Do you think it's still fine?
type: AnswerComment
comment on: http://stackoverflow.com/a/28237912

http://stackoverflow.com/comment/44828579
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28220977
has text: I would mention; when I use `text.attr({ "font-size": 25, "font-family": "FontName"...` it does go to **some Times New Roman-like font** (*not the one I've downloaded at all*). I even tried downloading the "whoa" font that Raphaeljs use on their fonts tutorial on their website, and it yielded identical results.
score: 0

http://stackoverflow.com/a/28215319
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44794264
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28215147
has body: Object.keys and some would do it: var id; Object.keys(ControlMap).some(function(key) { var entry = ControlMap[key]; if (entry.row == desiredRow &amp;&amp; entry.col == desiredCol) { id = key; return true; // Stops the loop } return false; }); Those are both ES5 features, but they're both polyfillable for IE8 and other older browsers. Alternately, you could just use for-in: var id; var key; var entry; for (key in ControlMap) { entry = ControlMap[key]; if (entry.row == desiredRow &amp;&amp; entry.col == desiredCol) { id = key; break; } }
score: 1
has comment: http://stackoverflow.com/comment/44794245
answers question: http://stackoverflow.com/q/28215147
type: AcceptedAnswer

http://stackoverflow.com/comment/44639420
comment on: http://stackoverflow.com/q/28133436
score: 1
has text: Use `==` when testing for equality, not `=`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28244416
possible better answer: http://stackoverflow.com/a/28244541
score: 0
has answer: http://stackoverflow.com/a/28244560
has answer: http://stackoverflow.com/a/28244541
tagged with: javascript
tagged with: jquery
has body: I have one option in a select with a color to indicate importance. it is red on the dropdown menu, but when it is selected it is black again. Is there a way to keep it red when it has been selected? Here is jsFiddle to demonstrate. Thanks. #red{color:red;} normal important normal
accepted answer: http://stackoverflow.com/a/28244560
has answer: http://stackoverflow.com/a/28244920
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: keep select value the color of the selected option
tagged with: css
has comment: http://stackoverflow.com/comment/44849700
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44849838
linked to: http://stackoverflow.com/q/2402146
type: Question

http://stackoverflow.com/comment/44810276
comment on: http://stackoverflow.com/q/28222430
score: 0
type: Comment
type: QuestionComment
has text: twitter bootstrap doesn't have a datepicker component. Are you using a 3rd pary one? If so which one?

http://stackoverflow.com/comment/44675424
has text: whenever angular is not parsing your markup and is outputting the raw expressions, it generally means that angular itself, your app, or one of your controllers failed to load correctly. What errors do you have in the console logs?
score: 2
comment on: http://stackoverflow.com/q/28152046
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28195917
accepted answer: http://stackoverflow.com/a/28200919
tagged with: jquery
has comment: http://stackoverflow.com/comment/44759625
has comment: http://stackoverflow.com/comment/44767932
has body: I have multiple text fields in my form which should contain only 5 alphabets and required fields. I am using jQuery Validation for this using class attribute. Sample code: Title <cfhtmlhead text="#headerJS#"> Name: But I am not getting any error message when I gave invalid input. Validation is working. I couldn't find the bug in it. Please help me to get through this.
has answer: http://stackoverflow.com/a/28200919
type: Question
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery-validate
score: 0
has title: jquery validation using class attribute
answer count: 1

http://stackoverflow.com/q/28160325
tagged with: jquery
has comment: http://stackoverflow.com/comment/44725574
tagged with: firefox-addon
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44692718
has answer: http://stackoverflow.com/a/28162405
upvote count: 2
has body: I am working on a firefox addon that will automatically populate the login form fields and login. What I have access to could be anything from id's classes' or the xpath to the login button depending on what the website gives. The priority captured will usually be id's if they exist. The specific website that won't trigger the click is: https://login.paylocity.com/escher/escher_webui/views/login/login.aspx I tried using $(element).trigger('click') or $(element).click() and they both don't trigger the click automatically. The error in the console log shows: XrayWrapper denied access to property callee (reason: value is callable). See https://developer.mozilla.org/en-US/docs/Xray_vision for more information. Note that only the first denied property access from a given global object will be reported. I also tried the Javascript method shown here: Is it possible to trigger a link's (or any element's) click event through JavaScript? That doesn't work either.
has title: Firefox addon - cannot trigger click event of any kind
linked to: http://stackoverflow.com/q/143747
score: 2
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28162405
has comment: http://stackoverflow.com/comment/44695070
tagged with: javascript

http://stackoverflow.com/comment/44800479
comment on: http://stackoverflow.com/q/28215400
score: 0
type: Comment
type: QuestionComment
has text: FYI: `reset` and `sync` are not the same event. `sync` is fired when you syncing collection with server, whereas `reset` is only fired when `reset` method is called. So you cannot use `reset` instead of `sync` and vice versa.

http://stackoverflow.com/comment/44643057
type: QuestionComment
has text: I need the show the datepicker every time someone visit the page. I insert it into the (document).ready(function() section, but it not showing the correct date until I refresh the page but sometime it showing it on the first try
type: Comment
comment on: http://stackoverflow.com/q/28134305
score: 0

http://stackoverflow.com/q/28262563
answer count: 1
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44882060
has comment: http://stackoverflow.com/comment/44882465
has title: Updating div that has dynamic content
has body: I have a div which displays messages sent by users, when a user clicks on the 'save_convo' button the div content is translated as a JS variable called 'story', passed along a querystring and shown on a different page. JS var element = document.getElementById('msg_display'); var story = element.textContent || element.innerText; // Getting text content as we only want to display the messages $( document ).ready(function() { // button that triggers passing of data $('#save_convo').click(function() { window.location.href = 'http://ex.com/publish.php?convo=' + story + ''; return false; }); }); HTML &lt;div id="msg_display"&gt; &lt;!-- messages are shown here --&gt; &lt;/div&gt; The problem is that because the div content is originally empty(on page load there are no messages), when a user clicks the button, they are taken to a blank page which doesn't show any of the messages sent by the users. How do I update the div after a message is sent to it? I've also considered reloading the div w/ AJAX but I reckon it will only refresh the div and get rid of the messages rather than retain them. Any suggestions?
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28262646
tagged with: javascript
has comment: http://stackoverflow.com/comment/44882040

http://stackoverflow.com/a/28179540
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28179391
upvote count: 0
has body: If you're only wanting the code to run once the DOM is ready, you could do something along the lines of: var selectedInput = $('input[name="radio-set"]:checked').attr('id'); $('div.' + selectedInput).addClass('whatever_style_you_want'); Clearly addClass could be changed to reflect css attributes instead.
score: -1

http://stackoverflow.com/a/28315404
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28261599
has body: process.on('uncaughtException', function (err) { console.error((new Date).toUTCString() + ' uncaughtException:', err.message) console.error(err.stack) }) Since nodejs is a single process server, you can place this code anywhere in js script for this to act as a catch all for unhandled/unforeseen errors.

http://stackoverflow.com/comment/132063055
type: Comment
has text: The OP topic only says "cloning object", though the OP question is entirely about classes. According to the detailed question, with classes, yes, this answer seems correct (in addition to others). However, if we just go by the phrase "cloning object", and the object is defined by an Interface and not a Class, then this solution won't work - whereas others involving spread or structuredClone() do work (2022).
score: 2
comment on: http://stackoverflow.com/a/68257750
type: AnswerComment

http://stackoverflow.com/comment/44712705
type: AnswerComment
score: 0
has text: `.btn` is child of `.user-name` which btw isn't valid and still btw, SPAN has no value
type: Comment
comment on: http://stackoverflow.com/a/28171769

http://stackoverflow.com/comment/58175643
has text: Try to include details in your answer instead of sharing a link.
comment on: http://stackoverflow.com/a/35230325
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44810972
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28223937
has text: You could also use your favorite editor to search for `=` and look at each occurrence manually.
type: Comment

http://stackoverflow.com/a/28145047
type: Answer
score: 3
answers question: http://stackoverflow.com/q/28144815
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28144815
type: AcceptedAnswer
downvote count: 0
has body: Here's an example of how to do this... no jquery required. chartData=[{"date":"2014-05-1","CAT1":0.1},{"date":"2014-05-1","CAT2":0.2},{"date":"2014-05-1","CAT3":0.3},{"date":"2014-05-1","UNSET":0.4},{"date":"2014-05-2","CAT1":0.4},{"date":"2014-05-2","CAT2":0.3},{"date":"2014-05-2","CAT3":0.2},{"date":"2014-05-2","UNSET":0.1}]; function groupProps(orig, key) { var newArr = [], groups = {}, newItem, i, j, cur; for (i = 0, j = orig.length; i &lt; j; i++) { cur = orig[i]; if (!(cur[key] in groups)) { groups[cur[key]] = {date: cur[key] }; newArr.push(groups[cur[key]]); } for (var prop in cur) { if (prop != key) { groups[cur[key]][prop] = cur[prop]; } } } return newArr; } console.log(groupProps(chartData, "date"))

http://stackoverflow.com/comment/44898876
type: QuestionComment
comment on: http://stackoverflow.com/q/28232660
has text: `ls /etc/nginx/conf.d/ default.conf ssl.conf virtual.conf`
score: 0
type: Comment

http://stackoverflow.com/q/28176378
accepted answer: http://stackoverflow.com/a/28176432
type: AnsweredQuestion
has body: I make one script to automaticaly include the images, it works well but the fancybox is not working.
type: Question
score: 0
has answer: http://stackoverflow.com/a/28176432
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: fancybox
has title: Issue with fancybox Jquery

http://stackoverflow.com/comment/44670789
comment on: http://stackoverflow.com/a/28149408
type: AnswerComment
has text: Thanks Raymond: but the main problem is that I am not getting the path correctly
score: 0
type: Comment

http://stackoverflow.com/q/28198832
has title: jQuery / CSS Animation - Pause in FF and Chrome jumps back and start is not correct
type: Question
tagged with: javascript
tagged with: jquery
tagged with: gsap
score: 0
has body: In IE and Safari the pausing and resuming of the progress bar that moves around works lovely however in firefox and chrome when you hit pause it does not pause at the correct time but seems to jump back and then stops and also when you initially start the animation it does not start from the top but a little ahead of itself. Really keen to get this fixed so its done but cannot work it out, would be great if someone could help me on a solution. In order to start it click on the big PINK circle FIDDLE: http://jsfiddle.net/uj4e5cw0/5/ - you will see what i mean when you start to play with it. JS: var playing = false; $(document).ready(function () { var animation = new TimelineMax(); var svgPaths = $("#ring"); for (var x = 0; x &lt; svgPaths.length; x++) { var path = svgPaths[x]; var pathDimensions = path.getTotalLength(); var strokeWidth = path.getAttribute("stroke-width"); path.style.strokeDasharray = (pathDimensions) + " " + (pathDimensions); path.style.strokeDashoffset = (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ? pathDimensions / strokeWidth : pathDimensions; //path.style.strokeDashoffset = (/Firefox/i.test(navigator.userAgent)) ? pathDimensions / strokeWidth : pathDimensions; animation.add(TweenMax.to(path.style, 20, { strokeDashoffset: 0, onUpdate: function () { var n = document.createTextNode(' '); document.body.appendChild(n); document.body.removeChild(n); } }), (x &gt; 0) ? "-=0.8" : ""); } $(document).on('click','#pause', function(e) { $(svgPaths).attr("class", "paused"); animation.pause(); }); $(document).on('click', '#resume', function (e) { $(svgPaths).attr("class", "active"); animation.resume(); }); $(document).on('click', '#restart', function (e) { //$(svgPaths).attr("class", ""); //$(svgPaths).attr("class", "active"); animation.restart(); }); $(document).on('click', '#loader', function (e) { if (!playing) { $("svg path").attr("class", "active"); /* $("#circle").attr("class", "active"); */ $("svg path#back").attr("stroke", "#034870"); $("svg path#ba…
answer count: 1
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/29618450
type: UnansweredQuestion

http://stackoverflow.com/comment/108123478
has text: event.preventDefault(); is not restricting the user while entering more characters than maxlength... @paddybasi is there any way to restrict the user to type the characters if he exceeds more than maxlength
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/38594032
type: Comment

http://stackoverflow.com/q/28275411
answer count: 1
has body: I'm using cordova 3.5 to develop an android application, I want to close the application when back button is pressed. I'm using the following code - document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { document.addEventListener("backbutton", backKeyDown, true); }; function backKeyDown(){ if(confirm("Exit Application?")) { navigator.app.exitApp(); } }; This code seems to work fine in android emulator and I get a confirm dialog when back button is pressed. But in real device, it just navigates back to previous page. I tried preventDefault() also, still no use. Someone help me with this.
tagged with: cordova
tagged with: android
type: AnsweredQuestion
has title: Cordova 3.5 - Back button event firing in Android emulator but not firing in real android device
has answer: http://stackoverflow.com/a/28448179
tagged with: back-button
type: Question
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/28448179

http://stackoverflow.com/comment/44655652
type: QuestionComment
has text: You know what.. It actually is ng-animates fault. I haven't any rules for ng-enter/move defined. After I removed ng-animate from the app modules it worked flawlessly. Thanks for the hint!
comment on: http://stackoverflow.com/q/28141788
score: 0
type: Comment

http://stackoverflow.com/comment/44801804
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28219256
score: 1
has text: did you check the console errors? I wonder you are loading app.js before loading jQuery.

http://stackoverflow.com/q/28251035
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28251195
score: 2
has comment: http://stackoverflow.com/comment/44861572
has answer: http://stackoverflow.com/a/28251187
type: Question
has answer: http://stackoverflow.com/a/28251159
tagged with: javascript
tagged with: jquery
has body: I have a button to call a php file with jQuery in my html file, &lt;script&gt; $('#mysubmit').bind('click', function(e){e.preventDefault(); var jqueryXHR = $.ajax({ 'type': 'POST', 'url': 'http://localhost/lt/resources/lists/update.php', 'dataType': 'json' }); &lt;/script&gt; &lt;input type="submit" id="mysubmit" value="Submit" /&gt; It works but I don't know how to get the result of the php file, i.e. the php file works, make an API POST and get the result as success or error, but I don't know how to get through jQuery if the php file response is success or error. Please help me I am a noob in Ajax and Jquery.
answer count: 3
downvote count: 0
has title: Get result of php with jQuery

http://stackoverflow.com/comment/44747476
type: Comment
score: 1
type: AnswerComment
has text: Inside a function you have access to all variables which are in scope at the point where the function is being defined. That's the "surrounding" scope, the surrounding scope around that, the surrounding scope around that etc. all the way up to the top level scope. If the function is executed asynchronously, as it is in your case, then those variables are *still* all accessible; in this case it's said that they're "closed over".
comment on: http://stackoverflow.com/a/28187448

http://stackoverflow.com/q/28191732
has body: I am getting the Error: Uncaught TypeError: Object [object Object] has no method 'addEventListener' hammer.js:168 my code is like this: &lt;script type="text/javascript" src="js/hammer.js"&gt;&lt;/script&gt; On device ready function: var resim = $('#kaydir'); Hammer(resim).on('swipeleft', function(ev){ console.log('left: ', ev); }); It seems the error is in hammer.js . What should I do?
upvote count: 17
type: Question
linked to: http://stackoverflow.com/q/38101901
accepted answer: http://stackoverflow.com/a/28191816
possible better answer: http://stackoverflow.com/a/28191805
answer count: 2
has answer: http://stackoverflow.com/a/28191805
downvote count: 0
tagged with: javascript
score: 17
favorite count: 0
has title: hammer.js object has no method addEventListener
tagged with: hammer.js
has answer: http://stackoverflow.com/a/28191816
type: AnsweredQuestion

http://stackoverflow.com/a/28156985
type: Answer
answers question: http://stackoverflow.com/q/28154539
score: 2
downvote count: 0
has body: You can do it by detecting the setExtremes() event on you axes, and fire a function to get the axis extremes and draw a line. (or, in this case, I used the afterSetExtremes() function) In my example I did it by using a line series. I assume you can adapt it to use the renderer since you've already used the renderer to draw the line initially. function redrawLine(chart) { var xExt = chart.xAxis[0].getExtremes(); var yExt = chart.yAxis[0].getExtremes(); chart.series[1].setData([ {'x':xExt.min,'y':yExt.min}, {'x':xExt.max,'y':yExt.max} ]); } Example: http://jsfiddle.net/jlbriggs/feLdzpux/ Of course, if your intent is to compare observed values to predicted values, then re-drawing the line when you zoom in is counter productive and misleading - the line should not move based on the zoom level - it should always be constant.
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28154539

http://stackoverflow.com/comment/44788882
has text: Before you'll get the answer, you can check these Q & A: http://stackoverflow.com/q/28188196/1679310 or http://stackoverflow.com/a/27754025/1679310 (one is html5mode on second off)
type: Comment
comment on: http://stackoverflow.com/q/28210656
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44775726
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28204637
score: 1
has text: @Malk that only makes sense if your CSS would only apply to half the page--which seems a bit odd (and impractical)

http://stackoverflow.com/q/28140341
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44653190
has answer: http://stackoverflow.com/a/28140672
has body: I am having trouble assigning the value of "$scope.returnPollings[i]" to "plrtn" during the loop. "$scope.returnPollings" is an object with a data and i can confirm there is a data in it when i console.log it. db.transaction (function(tx) { var sql = "INSERT INTO STATUSREPLY (reply, name, userCode, icon, target, repliedDate) VALUES (?, ?, ?, ?, ?, ?)"; var len = $scope.returnPollings.length; var plrtn; for (var i = 0; i &lt; len; i++) { plrtn = $scope.returnPollings[i]; // value is not being assigned here tx.executeSql(sql, [plrtn.message, plrtn.name, plrtn.userCode, plrtn.qWink, plrtn.target, plrtn.createdDate ], function(){ $scope.$apply(function(){ $scope.returnFstatus.push({ 'message':$scope.ie.message, 'createdDate':$scope.ie.createdDate, 'icon':$scope.ie.qWink, 'target':$scope.ie.target }); }) console.log('Status Inserted'); },function(tx, error) { console.log('polling INSERT ERROR: ' + error.message); }); } }); I will be glad if anyone can help me
has comment: http://stackoverflow.com/comment/44654211
has answer: http://stackoverflow.com/a/28140450
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44652477
has comment: http://stackoverflow.com/comment/44652335
tagged with: javascript
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44652541
linked to: http://stackoverflow.com/q/1470488
has title: Cannot assign value to a variable - Javascript
tagged with: sqlite
accepted answer: http://stackoverflow.com/a/28140672
has comment: http://stackoverflow.com/comment/44652567
has comment: http://stackoverflow.com/comment/44652306
has comment: http://stackoverflow.com/comment/44652629
has comment: http://stackoverflow.com/comment/44652457
possible better answer: http://stackoverflow.com/a/28140450

http://stackoverflow.com/a/28171317
score: 2
downvote count: 0
has body: Add dropdown-menu-right class to ul.dropdown-menu and it will align to the right side of the button, therefore expanding towards left.
upvote count: 2
answers question: http://stackoverflow.com/q/28170744
type: Answer

http://stackoverflow.com/q/28186636
has answer: http://stackoverflow.com/a/28186845
has answer: http://stackoverflow.com/a/28189256
type: Question
has comment: http://stackoverflow.com/comment/44741850
tagged with: javascript
has comment: http://stackoverflow.com/comment/44741827
has comment: http://stackoverflow.com/comment/44742267
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44741868
has comment: http://stackoverflow.com/comment/44742042
has comment: http://stackoverflow.com/comment/44741983
has body: Am working on the table, my aim is to display rows orderly based on its sum of columns. I mean, highest valued rows should be displayed first and then, second highest values, then, go on.. Have tried and could not make it. Just give me an idea, and that is good enough for me. Am not able to come to any idea on how to reshuffle the rows based on its sum values. Any idea on this? All Top5 head1 head2 head3 head4 head5 head6 head7 Subject1 501 501 501 550 560 570 Subject2 620 640 605 650 600 604 Subject3 730 730 740 750 760 790 Subject4 700 701 700 702 700 703 Subject5 220 201 202 222 210 203 Subject6 200 201 200 202 200 203 Subject7 200 201 200 202 200 203 Subject8 200 201 200 202 200 203 Total 202 201 200 202 200 203 After I pressed the 'Top5' button, then, the table should be displayed as follows[sample] All Top5 head1 head2 head3 head4 head5 head6 head7 Subject3 730 730 740 750 760 790 Subject4 700 701 700 702 700 703 Subject2 620 640 605 650 600 604 Subject1 501 501 501 550 560 570 Subject5 220 201 202 222 210 203 Hope this makes sense. For your kind information, i except code only in javascript not in jquery.
has answer: http://stackoverflow.com/a/28187886
accepted answer: http://stackoverflow.com/a/28187886
has comment: http://stackoverflow.com/comment/44741996
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: How to order the table rows based on its value in javascript
has comment: http://stackoverflow.com/comment/44742095
has comment: http://stackoverflow.com/comment/44742484
possible better answer: http://stackoverflow.com/a/28189256
has comment: http://stackoverflow.com/comment/44742594

http://stackoverflow.com/comment/44759754
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28196472
score: 0
has text: what is the console log you used to print the above data ?

http://stackoverflow.com/a/28136944
answers question: http://stackoverflow.com/q/28136806
accepted answer of: http://stackoverflow.com/q/28136806
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44645883
score: 2
has body: The easiest way to do this is with replace method fiddle http://jsfiddle.net/PrakharThakur/a9bk08c4/ var str = $('#t').text(); var res = str.substring(7, 14); newstr = str; while (newstr.indexOf("}") > -1) { newstr = newstr.replace("}"," "); } var k = 0; while (newstr.indexOf("{") > -1) { k++; newstr = newstr.replace("{"," "); newstr = newstr.replace("}","'>"); } document.getElementById("t").innerHTML = newstr; Hi this is a text with { as opening brace and somewhere I May have another { brace and then again An { brace, but now we have a } brace then followed by another } brace and not to forget the last one } use inspector tool to see the effect

http://stackoverflow.com/q/28162686
tagged with: browserify
tagged with: gulp
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/33827592
tagged with: watchify
has body: I am using Gulp as my task runner and browserify to bundle my CommonJs modules. I have noticed that running my browserify task is quite slow, it takes around 2 - 3 seconds, and all I have is React and a few very small components I have built for development. Is there a way to speed up the task, or do I have any noticeable problems in my task? gulp.task('browserify', function() { var bundler = browserify({ entries: ['./main.js'], // Only need initial file transform: [reactify], // Convert JSX to javascript debug: true, cache: {}, packageCache: {}, fullPaths: true }); var watcher = watchify(bundler); return watcher .on('update', function () { // On update When any files updates var updateStart = Date.now(); watcher.bundle() .pipe(source('bundle.js')) .pipe(gulp.dest('./')); console.log('Updated ', (Date.now() - updateStart) + 'ms'); }) .bundle() // Create initial bundle when starting the task .pipe(source('bundle.js')) .pipe(gulp.dest('./')); }); I am using Browserify, Watchify, Reactify and Vinyl Source Stream as well as a few other unrelated modules. var browserify = require('browserify'), watchify = require('watchify'), reactify = require('reactify'), source = require('vinyl-source-stream'); Thanks
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/33827592
downvote count: 0
has title: gulp browserify reactify task is quite slow
type: Question
has answer: http://stackoverflow.com/a/28246117
score: 9
accepted answer: http://stackoverflow.com/a/28246117
tagged with: reactjs
has answer: http://stackoverflow.com/a/35013754
tagged with: javascript
answer count: 3

http://stackoverflow.com/comment/92429445
comment on: http://stackoverflow.com/q/28123925
has text: Is there anyone who could solve this problem?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28171487
type: Question
has title: Cannot get variable to pass to array in JavaScript
tagged with: arrays
has body: I'm trying to recreate a PHP script I made in JS, but I'm getting stuck here: var array1 = []; var array2 = []; for (x = 0; x &lt; 100; x++) { do { var rand1 = Math.random(); var rand2 = Math.random(); var x1 = 2.0 * rand1 - 1.0; var x2 = 2.0 * rand2 - 1.0; var w = Math.pow(x1, 2) + Math.pow(x2, 2); } while (w === 0 || w &gt; 1); multiplier = Math.sqrt((-2 * Math.log(w)) / w); var y1 = x1 * multiplier; var y2 = x2 * multiplier; array1.push(y1); array2.push(y2); } for (i = 0; i &lt; array1.length; i++) { document.write(array1[i] . "&lt;br /&gt;"); } For some reason, I cannot print the array, and the script just stops working when I try to push y1 and y2 into arrays. What is causing this issue?
tagged with: javascript
tagged with: statistics
answer count: 1
accepted answer: http://stackoverflow.com/a/28171546
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/28171546
downvote count: 1
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44801831
type: QuestionComment
has text: @MichaelLaffargue I have added some code, as you can see i manually put my timezone in my events. I think we can discard timezone problems as in only 1 minute difference this happens
score: 0
comment on: http://stackoverflow.com/q/28219122
type: Comment

http://stackoverflow.com/comment/44712679
score: 1
comment on: http://stackoverflow.com/q/28171702
type: QuestionComment
has text: In ES6 you should be able to do `a**2`
type: Comment

http://stackoverflow.com/comment/44750222
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28191254
has text: It's a fairly crappy script.. I might just wrote an Ajax one that directly gets the time from the server. I did find a jquery plugin that supposedly does what I want.. However I had the same problem with that one too.
type: Comment

http://stackoverflow.com/q/28221206
type: Question
has body: I currently have a page that displays invoices for printing. I would like to create a page where I can feed in multiple invoices, so that I can print multiple invoices. Of course, I could just copy the code and loop it in the new file, but I thought it might be easier to just call the other pages and assemble them on a page. I saw some code similar to this, and tried to modify it, but I keep getting an error in the console: Uncaught SyntaxError: Unexpected token ILLEGAL Maybe there is a way to do this only in php? I post an array of invoices to this php file: <?php $invoiceList = $_POST["invoiceRequest"]; $invoices = explode("\n", $invoiceList); echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; foreach($invoices as $page) { echo ' '; } echo ' '; echo ' '; ?>
tagged with: javascript
has answer: http://stackoverflow.com/a/28221712
has comment: http://stackoverflow.com/comment/44806450
tagged with: post
tagged with: get
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28221341
has title: Trying to display multiple php files at once, in a row
tagged with: jquery
tagged with: php
accepted answer: http://stackoverflow.com/a/28223219
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28221341
has answer: http://stackoverflow.com/a/28223219

http://stackoverflow.com/comment/44893146
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28268249
type: Comment
has text: You are calling your div dsf but referencing div_name in the script. Per my answer you need to make sure you have a div with the same id as the one used in the script

mozilla
tags question: http://stackoverflow.com/q/28135113
type: Tag
tag name: mozilla
tags question: http://stackoverflow.com/q/28205879

http://stackoverflow.com/q/28202271
tagged with: geolocation
has body: I am trying to grab a users location via HTML5 and pass it to my rails controller. I have the JavaScript below which calls .value on the element and sets it equal to the respective position. I would then like to submit these values through a hidden form field and pass it to my location controller so I can populate locations based on the users position. I know this has been done before and I have seen a few posts on it, but I have not had success. navigator.geolocation.getCurrentPosition(GeoL); function GeoL(position) { document.getElementById('lat').value = position.coords.latitude; document.getElementById('lon').value = position.coords.longitude; } &lt;%= form_tag locations_path, :method=&gt;'post' do %&gt; &lt;%= hidden_field_tag 'lat', value = ''%&gt; &lt;%= hidden_field_tag 'lon', value = ''%&gt; &lt;%= image_submit_tag 'loc.png' %&gt; &lt;% end %&gt; def create "What goes here? Grab params? Is this the right action to send it to?" end I am currently getting the error you see in this screen shot below. I think my form may need some work, plus I need to add code in my controller to grab the values. As you can see a little lost, any advice would be great.
has answer: http://stackoverflow.com/a/28210945
has comment: http://stackoverflow.com/comment/44777070
type: Question
score: 5
has comment: http://stackoverflow.com/comment/44771221
upvote count: 5
has comment: http://stackoverflow.com/comment/44777108
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44777354
has comment: http://stackoverflow.com/comment/44777743
favorite count: 0
has title: HTML5 Geolocation In Rails
type: UnansweredQuestion
tagged with: ruby-on-rails

http://stackoverflow.com/comment/44649642
type: Comment
comment on: http://stackoverflow.com/a/28138909
has text: but to sue them, I would need to know someone stole it. This is why I'm looking for tracking possiblities.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44898920
comment on: http://stackoverflow.com/a/28235017
type: AnswerComment
score: 0
type: Comment
has text: This answer perfectly solved my problem. Thank you for your tips!

http://stackoverflow.com/comment/44711384
score: 0
type: Comment
has text: @dystroy the question has been edited after I've posted the answer to the original question.
comment on: http://stackoverflow.com/a/28170844
type: AnswerComment

http://stackoverflow.com/comment/44663664
comment on: http://stackoverflow.com/a/28145995
type: AnswerComment
type: Comment
has text: While I agree with your first paragraph wholeheartedly, your second paragraph is off the mark (and OP is already doing it anyway).
score: 0

universal-analytics
tag name: universal-analytics
tags question: http://stackoverflow.com/q/28122291
tags question: http://stackoverflow.com/q/28217900
type: Tag

http://stackoverflow.com/a/35973101
type: Answer
answers question: http://stackoverflow.com/q/28198851
has body: expirationDate: The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. While your expirationDate is '1422442443', it was Sat Jan 17 1970 19:07:22 GMT+0800, it means the cookie set correctly but expired. So, you cannot find your cookie and there is no error as well. Solution: set with new Date().getTime() / 1000 + [ExpirationDate]
score: 0

http://stackoverflow.com/comment/44846316
comment on: http://stackoverflow.com/q/28242741
has text: possible duplicate of [ActiveXObject in Firefox or Chrome (not IE!)](http://stackoverflow.com/questions/7022568/activexobject-in-firefox-or-chrome-not-ie)
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44805786
type: Comment
type: QuestionComment
has text: Try escaping the parentheses of your simulator names. Unless I've miscounted, line 24 (the line your script is complaining about) is `"iPhone 6 (8.1 Simulator)",`. Try `"iPhone 6 \(8.1 Simulator\)",`. I really don't think it'll work, but it's worth a shot.
comment on: http://stackoverflow.com/q/28221009
score: 0

http://stackoverflow.com/q/28208432
tagged with: javascript
tagged with: asp.net
has title: CasperJS: How to fill a asp form
has body: I'm trying to automate a few steps of a asp written website through casperjs. I want to acheive following. Navigate to the login page Fill the username and password fields click the login button capture a screenshot of the success page But so far I'm only able to do the first step in the process. The source view page looks little wired for me. Most of the nodes are starting with a &lt;ui:&gt; tag and I have no idea about it. &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="theme/xslt/all.xsl?build=2.0.012&amp;amp;theme=theme_immi" ?&gt; &lt;!DOCTYPE html [ &lt;!ENTITY nbsp "&amp;#160;"&gt; ]&gt; &lt;ui:root title="ImmiAccount - Login" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:ui="http://www.immi.gov.au/Namespace/UI/V1.0"&gt; I first tried fillSelectors() method to submit form. casper.start('https://online.immi.gov.au/lusc/login',function() { this.echo(this.getTitle()); this.fillSelectors('#app_L2',{ 'input[id="app_L2b0a0a0a3a1a"]': 'john', 'input[id="app_L2b0a0a0a3b1a"]': 'john123' }); this.wait('2000',function(){ this.capture('formfill.png'); }); }); casper.then(function() { // Click on 1st result link this.click('#app_L2b0a0a0a4a'); this.wait('5000',function(){ this.capture('success.png'); }) }); got following error CasperError: Errors encountered while filling form: no field matching css selector "input[id="app_L2b0a0a0a3a1a"]" in form; no field matching css selector "input[id="app_L2b0a0a0a3b1a"]" in form Then tried with fillXPath() casper.start('https://online.immi.gov.au/lusc/login',function() { this.echo(this.getTitle()); this.fillXPath('#app_L2',{ '//*[@id="app_L2b0a0a0a3a1a"]': 'john', '//*[@id="app_L2b0a0a0a3b1a"]': 'john123' }); this.wait('2000',function(){ this.capture('formfill.png'); }); }); casper.then(function() { // Click on 1st result link this.click(x('//*[@id="app_L2b0a0a0a4a"]'), this.wait('5000',function(){ this.capture('success.png'); })); }); Following erro occur…
favorite count: 0
tagged with: xpath
tagged with: casperjs
has answer: http://stackoverflow.com/a/28225113
upvote count: 3
type: AnsweredQuestion
tagged with: phantomjs
score: 3
type: Question
accepted answer: http://stackoverflow.com/a/28225113
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/44896154
score: 0
comment on: http://stackoverflow.com/q/28269579
type: QuestionComment
has text: TypeError: Converting circular structure to JSON
type: Comment

http://stackoverflow.com/q/28265730
tagged with: javascript
has body: I have a leaflet map set to change styles based on a category when a user clicks a button. Live map: http://maneesha.github.io/test_map.html Source code: https://github.com/maneesha/maneesha.github.io There is a legend for each style. My problem is I can't get the old legend to disappear when another button is clicked (or that button is clicked again). So you'll see on the map each time you click, a new legend appears. Putting map.removeControl(legend); in the click function does not work and results in this in the js console: Uncaught TypeError: Cannot read property 'removeFrom' of undefined Any ideas? EDIT: Repos above have been changed. Live site no longer exists; source code is at https://github.com/maneesha/leaflet_map_with_styles_and_legends
has title: Remove legend on leaflet map
favorite count: 0
upvote count: 5
tagged with: gis
type: AnsweredQuestion
tagged with: leaflet
downvote count: 0
has answer: http://stackoverflow.com/a/28265999
accepted answer: http://stackoverflow.com/a/28265999
type: Question
score: 5
answer count: 1

http://stackoverflow.com/a/28135552
answers question: http://stackoverflow.com/q/28134641
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44647769
downvote count: 0
has comment: http://stackoverflow.com/comment/44647478
has comment: http://stackoverflow.com/comment/44644974
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44646254
has body: I would create a ko.computed that converts your list of table items into an array of arrays: var TableItem = function TableItem(data) { this.id = ko.observable(data.id); this.name = ko.observable(data.name); }; var Vm = function Vm() { this.tableItems = ko.observableArray([]); this.columnCount = ko.observable(3); this.columns = ko.computed(function() { var columns = [], itemCount = this.tableItems().length, begin = 0; // we use begin + 1 to compare to length, because slice // uses zero-based index parameters while (begin + 1 < itemCount) { columns.push( this.tableItems.slice(begin, begin + this.columnCount()) ); begin += this.columnCount(); } return columns; // don't forget to set `this` inside the computed to our Vm }, this); }; vm = new Vm(); ko.applyBindings(vm); for (var i = 1; i < 15; i++) { vm.tableItems.push(new TableItem({ id: i, name: "name: " + i })); } This way, you can display your table by nesting two foreach bindings: A JSFiddle If you haven't worked with ko.computed before, they track whatever observables are accessed inside of them — in this case, this.tableItems and this.columnCount —, and whenever one of them changes, they run again and produce a new result. this.columns takes our array of table items [TableItem, TableItem, TableItem, TableItem, TableItem, TableItem] and groups them by this.columnCount into [[TableItem, TableItem, TableItem], [TableItem, TableItem, TableItem]]
accepted answer of: http://stackoverflow.com/q/28134641
has comment: http://stackoverflow.com/comment/44647710

http://stackoverflow.com/a/28209996
has comment: http://stackoverflow.com/comment/44787874
score: 0
type: Answer
has body: You can use and image to do so. I suggest you use the javascript events e.g. you edit the CSS and make it look like the image above when you press enter or tab. code for that would be &lt;form action="#"&gt; &lt;input type="text" name="txt" onkeypress="handle()" /&gt; &lt;/form&gt; &lt;script&gt; function handle(e){ if(e.keyCode === 13){ //13 corresponds to pressing enter //here you apply the CSS Change } return false; } &lt;/script&gt; You use an image for the "X" , and delete the given string when it is clicked.
answers question: http://stackoverflow.com/q/28209719

http://stackoverflow.com/comment/44823891
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28230586
has text: Your function will return object , so you can take it like var obj=getViewport(); and then var width=obj.width;, var height=obj.height; like this
score: 0

http://stackoverflow.com/comment/44706059
type: AnswerComment
has text: yes it is, but my validation and on submit code is in a JS file :/
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28168005

http://stackoverflow.com/comment/44721764
comment on: http://stackoverflow.com/q/28175032
score: 0
type: Comment
has text: Further testing looks like it is unable to do the comparison in the first IF statement if the the end ip between 3 - 9.
type: QuestionComment

http://stackoverflow.com/a/28127666
accepted answer of: http://stackoverflow.com/q/28127553
has comment: http://stackoverflow.com/comment/44630298
answers question: http://stackoverflow.com/q/28127553
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44628672
has comment: http://stackoverflow.com/comment/44628521
has body: It's probably not a very good idea if you want to use the information passed from those events (it's different for every event), but you can do it. Just make a non-anonymous handler and register it for every event: function universalHandler(a,b) { // Do stuff } chrome.bookmarks.onCreated.addListener(universalHandler); chrome.bookmarks.onRemoved.addListener(universalHandler); chrome.bookmarks.onChanged.addListener(universalHandler); chrome.bookmarks.onMoved.addListener(universalHandler);
type: Answer

http://stackoverflow.com/comment/44815268
type: Comment
type: QuestionComment
has text: @JCOC611 yes...so for how should I use the loop?
score: 0
comment on: http://stackoverflow.com/q/28225614

http://stackoverflow.com/comment/44798970
type: AnswerComment
has text: so touchend is when the user finished to click and touchstart when it starts? or what is the difference in plain words? Thanks
comment on: http://stackoverflow.com/a/28217779
type: Comment
score: 0

http://stackoverflow.com/q/28183897
type: AnsweredQuestion
score: 0
has body: I'm trying to find if a value exists or not in an array and then add it to a third array. I am using JavaScript. Here are my declarations: var testArray1 = ["a", "b", "c", "d", "e"]; var testArray2 = []; Here is my code snippet: var x = testArray1.length; var y = 0; do { if(typeof testArray1[y] == 'a') { console.value += "A doesn't exist."; } else { console.value += "A does exist." } y++; while (y &lt; x); For some reason (even if I enter in (anything greater than 0) instead of x it always says A does exist. Could anyone point me out where my code is wrong? Thanks!
has title: Why doesn't my code work for finding if a value exists in an array in JavaScript?
has answer: http://stackoverflow.com/a/28183967
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28183944
has comment: http://stackoverflow.com/comment/44737059
has answer: http://stackoverflow.com/a/28183958
answer count: 3
linked to: http://stackoverflow.com/q/237104
possible better answer: http://stackoverflow.com/a/28183944
has comment: http://stackoverflow.com/comment/44736903
accepted answer: http://stackoverflow.com/a/28183958
has comment: http://stackoverflow.com/comment/44736963
linked to: http://stackoverflow.com/q/143847

http://stackoverflow.com/q/28159890
has body: Imagine two rounding function function round1 (number) { return ~~number; } function round2 (number) { return number|0; } What is practical difference between them? I'm looking for in-depth explanation.
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28160283
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44691365
has answer: http://stackoverflow.com/a/28160429
has comment: http://stackoverflow.com/comment/44691218
has comment: http://stackoverflow.com/comment/44691290
type: Question
has title: What is difference between |0 and ~~?
tagged with: javascript

http://stackoverflow.com/comment/75055597
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28160302
score: 0
has text: Possible duplicate of [Module pattern and this](http://stackoverflow.com/questions/29547918/module-pattern-and-this)

http://stackoverflow.com/comment/44847140
score: 0
comment on: http://stackoverflow.com/q/28242741
type: Comment
type: QuestionComment
has text: In Chrome you can open a new window: `window.open('test.xls', 'excel');`. This won't open an actual window or Excel app, but downloads the file and shows you a button, which you can click and open an .xls file, _if Excel is installed_. You might also need to play with security settings [to access local files](http://stackoverflow.com/a/5664399/1169519).

http://stackoverflow.com/q/28180000
type: Question
accepted answer: http://stackoverflow.com/a/28180478
has body: In my app (yes i know that this is a little bit to bad) in controller have such code: $scope.changePasswordModal = function() { angular.element('#password-change').modal('show'); }; this code appear so: if(angular.isDefined($routeParams.chgkey)){ $scope.changePasswordModal(); } and i have such view: &lt;div class="modal custom" id="new-password-remember" tabindex="-1" role="dialog" aria-labelledby="newPasswordRemember" aria-hidden="true" modal-center modal-auto-focus modal-auto-focus-type="1" modal-auto-focus-action="rememberpwd" data-backdrop="static"&gt; .... i also have some other modal forms on this view: when i click to open modal - all is ok: focus is displayed. But when i open page and it is opened in controller via actions i see that it has focus, but why this focus is not displayed? directive: .directive('modalAutoFocus', ['$timeout', '$window', function ($timeout, $window){ return { restrict: 'EA', link: function(scope, element, attrs) { if (attrs.id == 'new-password-change'){ element.find('.on-focus')[0].focus(); } $(element).on('shown.bs.modal', function(){ element.find('.on-focus')[0].focus(); }); } } }]); i didn't understand what is bad... why focus is not displayed? what i do wrong? thank you
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44729794
has answer: http://stackoverflow.com/a/28180478
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
has title: angularJS focus in bootstrap modal when it is opened when page load
has comment: http://stackoverflow.com/comment/44730031
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/q/28240231
tagged with: mysql
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28240477
tagged with: javascript
tagged with: date
score: 0
answer count: 1
has body: Im trying to get the date from a date picker i have on my page and then have that date posted to a php function which will store the selected date in my database.
favorite count: 0
has comment: http://stackoverflow.com/comment/44841547
accepted answer: http://stackoverflow.com/a/28240477
has title: Store date picker date and save in database
has comment: http://stackoverflow.com/comment/44842767
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/a/28158054
type: Answer
accepted answer of: http://stackoverflow.com/q/28157437
upvote count: 1
has body: The first time you call setInterval(), it defines an interval that will decrement the counter by 1 every second. It doesn't stop once the counter reaches 0; it just keeps decreasing it every second. Then you call setInterval() again, which sets up another decrement of the same counter every second. So now the counter gets decremented twice per second: once because of the first interval you set up and another time because of the second interval. The effect just builds up as you add more intervals. You can see the effect in this fiddle. The solution is just to stop the interval once the counter reaches 0, before you set up another interval. Besides, there's no need to use the same counter variable for all the different intervals, so you can just declare a new variable each time in a narrower scope. Narrowing the scope of variables will minimize the risk of different pieces of code interfering with each other. function startCountDown(){ // This counter is local to this invocation of the "startCountDown" // function. var counter = 10; var interval = setInterval(function() { counter--; // Display 'counter' wherever you want to display it. document.getElementById("counter").innerHTML = "Timer:"+counter if (counter == 0) { // Submit form console.log("Form submitted!"); // Stop this interval so that it doesn't update the // interface anymore (next interval will take care of that). clearInterval(interval); startCountDown(); } }, 1000); } startCountDown(); This other fiddle shows the solution.
answers question: http://stackoverflow.com/q/28157437
downvote count: 0
type: AcceptedAnswer
score: 1

http://stackoverflow.com/comment/44656822
score: 0
comment on: http://stackoverflow.com/q/28142515
type: Comment
type: QuestionComment
has text: It is, but that question (the one I referenced) is _bad_ for not including any relevant code. I voted to actually close it now.

http://stackoverflow.com/q/28211576
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29061950
linked to: http://stackoverflow.com/q/23882199
tagged with: javascript
tagged with: jsplumb
type: Question
has body: I want to simply add new nodes by clicking a button (I have the code from jsPlumb source endpoint does not move when source container is dragged, I've tried the suggested answer but still not working for me). Unfortunately, when I drag the new node, the endpoint (that should stick with the overlay) has not updated its position. the endpoint will update its position after I mouseover the endpoint. here is the fiddle `$('#addNode').click(function (e) { var newAgent = $('').attr('id', 'flowchartWindow' + num).addClass("window singleFirst"); newAgent.text('New Node ' + num); $('#flowchart-demo').append(newAgent); _addEndpoints(newAgent, [], ["TopCenter"]); newAgent.draggable({ containment: 'parent', drag: function (e) { $(this).find('._jsPlumb_endpoint_anchor_').each(function (i, e) { jsPlumb.repaint($(e).parent()); }); } }); num++; });` http://jsfiddle.net/3ao1odjp/2 (pardon my messy code. I'm trying to combine sample demo (flowchart) from the official jsplumb page and the code I have from stackoverflow above)
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: drag-and-drop
has title: jsplumb endpoint not update drag
tagged with: css
downvote count: 0

http://stackoverflow.com/comment/44693867
comment on: http://stackoverflow.com/q/28160993
has text: You should do it THIS time or your question may get closed. Use the "edit" link to modify your question and insert the relevant code into the question.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44725725
score: 1
has text: I scoured the Parse documentation for a while thinking about this issue, and I am now convinced that Parse has not yet enabled query features to accomplish this in one query. I **did** come up with a Promise-based Cloud Code function to accomplish this that wasn't terribly over-complicated.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28159346

http://stackoverflow.com/q/28192756
has answer: http://stackoverflow.com/a/28192981
type: Question
tagged with: google-maps
possible better answer: http://stackoverflow.com/a/28192981
score: -2
accepted answer: http://stackoverflow.com/a/28192897
tagged with: javascript
tagged with: google-maps-api-3
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28192897
favorite count: 0
has title: how to replace place marker with last click?
type: AnsweredQuestion
upvote count: 0
has body: JS var map; function initialize() { var myCenter=new google.maps.LatLng(13.001294, 77.661736); var mapProp = { center:myCenter, zoom:15, mapTypeId:google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("googleMap"),mapProp); google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); }); } function placeMarker(location) { var marker = new google.maps.Marker({ position: location, map: map, }); document.getElementById("latt").innerHTML = location.lat(); document.getElementById("long").innerHTML = location.lng(); } google.maps.event.addDomListener(window, 'load', initialize); HTML &lt;div id="googleMap" style="width:500px;height:380px;"&gt;&lt;/div&gt; &lt;p id="latt"&gt;&lt;/p&gt; &lt;p id="long"&gt;&lt;/p&gt; Here when we click on map more than one, there are number of place marker will appear. I want only one placemarker that last clicked place. How to fix that problem..? Thanks in advance.

http://stackoverflow.com/q/28243124
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28243964
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I created a 'test Label' or alert to see values of variables (some way to know values of variables like in Matlab?) How can I change so i can retrieve the correct number of elements as required (and not value '0' or 'all elements' or 'errors')? Code is this: var lenform = document.getElementById("ActionInMoveID").length; var selform = document.getElementById("ActionInMoveID"); var count = 0; for (var k = 0; k &lt; lenform; k++) { if (selform.elements[k].tagName == "input") count++; } alert(count); Thanks a lot
tagged with: select
tagged with: forms
downvote count: 1
type: Question
has title: Quick methods Javascript/Jquery/etc to retrieve all aspnet:textbox (input) contained in a form, excluding other elements
upvote count: 0
tagged with: counter
tagged with: javascript

selenium
tags question: http://stackoverflow.com/q/28181858
tags question: http://stackoverflow.com/q/28211053
tags question: http://stackoverflow.com/q/28148253
tags question: http://stackoverflow.com/q/28171365
tags question: http://stackoverflow.com/q/28172243
tags question: http://stackoverflow.com/q/28205165
tag name: selenium
tags question: http://stackoverflow.com/q/28122218
tags question: http://stackoverflow.com/q/28222945
tags question: http://stackoverflow.com/q/28188957
tags question: http://stackoverflow.com/q/28169645
tags question: http://stackoverflow.com/q/28224411
tags question: http://stackoverflow.com/q/28269472
type: Tag
tags question: http://stackoverflow.com/q/28135095
tags question: http://stackoverflow.com/q/28232634
tags question: http://stackoverflow.com/q/28256632

http://stackoverflow.com/comment/44659491
has text: I marked yours as the right answer since it's a lesser complicated version 8-)
type: Comment
comment on: http://stackoverflow.com/a/28143605
type: AnswerComment
score: 0

http://stackoverflow.com/a/28153415
type: Answer
has body: I updated your fiddle (it also makes the textarea required): http://jsfiddle.net/gv7xh4cg/4/ You should include jQuery for: $('input.radio').click(function(){ var selectedOption = $(this).val(); var delivlHold = $('#deliv-hold'), comments = $('#shipping_arrival_comments'); if(selectedOption === 'freeshipping_freeshipping') { delivlHold.show(); comments.prop('required',true); } else { delivlHold.hide(); comments.prop('required',false); } }); and than add display: none: #deliv-hold{padding-top:20px; display: none} It does what you asked for.
has comment: http://stackoverflow.com/comment/44679205
score: 0
has comment: http://stackoverflow.com/comment/44688364
answers question: http://stackoverflow.com/q/28152830

http://stackoverflow.com/q/28244642
answer count: 3
accepted answer: http://stackoverflow.com/a/28246734
possible better answer: http://stackoverflow.com/a/28246049
has answer: http://stackoverflow.com/a/28246049
has answer: http://stackoverflow.com/a/28244798
tagged with: facebook
has comment: http://stackoverflow.com/comment/44850161
has comment: http://stackoverflow.com/comment/44850096
has comment: http://stackoverflow.com/comment/44850438
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44852697
has comment: http://stackoverflow.com/comment/44850108
has answer: http://stackoverflow.com/a/28246734
type: Question
has comment: http://stackoverflow.com/comment/44850514
has comment: http://stackoverflow.com/comment/44850638
has title: Count Taggable Friends Facebook API
tagged with: javascript
has body: I've done this little function to count how many taggable friends I have when someone log into my app. function testAPI() { FB.api('/me/taggable_friends', function(response) { var friendsICT = response.data; var HowManyFriends = 0; for (i=0;i&lt;5000;i++) { if (friendsICT[i] != undefined) { HowManyFriends++; } else { console.log(HowManyFriends); break; }; }; }); } I was just wondering if there's some way to do this in a shorted code. I've tried response.data.length but it gives me back an error. Maybe it's just because of the API 2.0!
score: 0
has comment: http://stackoverflow.com/comment/44853186

http://stackoverflow.com/comment/45018973
type: AnswerComment
type: Comment
has text: try using script. create an onClick function to the button id to toggle the drop down menu on mobile devices.
comment on: http://stackoverflow.com/a/28229894
score: 0

http://stackoverflow.com/comment/44850486
has text: What do you see in the dev tools & network tab?
type: Comment
comment on: http://stackoverflow.com/q/28244899
type: QuestionComment
score: 3

http://stackoverflow.com/comment/44695602
score: 7
comment on: http://stackoverflow.com/q/28162171
type: Comment
type: QuestionComment
has text: I can think of no valid reason why one would choose to split a string over building an array manually, other than it taking potentially fewer keystrokes.

http://stackoverflow.com/comment/44849152
type: Comment
comment on: http://stackoverflow.com/q/28243924
score: 0
type: QuestionComment
has text: where is css for tabs? the css you shared so far works fine... if I understood the question correctly. http://jsfiddle.net/j7jxs8qm/

http://stackoverflow.com/comment/44636762
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28131912
has text: @RyanGriggs You can also check how carefully event handlers are managed in libraries that are scalable. Careless unmanaged handlers can cause unwanted memory loss in a large SPA.

http://stackoverflow.com/q/28203768
downvote count: 0
tagged with: javascript
score: 4
tagged with: optimization
has body: So I need to display basic graphs for around 30,000 data points and I am currently using Google Charts with the following code in javascript with a little jinja thrown in there: &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; google.load('visualization', '1.1', {packages: ['line']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('number', 'Time'); data.addColumn('number', "value1"); data.addColumn('number', "value2"); var mnemonic_count = 1; {% for item in response %} data.addRow([mnemonic_count,,]); count = count+1; {% endfor %} console.log(count); var options = { chart: { title: 'value over time', subtitle: 'count . ' data points' }, width: 900, height: 500 }; var chart = new google.charts.Line(document.getElementById('linechart_material')); chart.draw(data, options); } &lt;/script&gt; &lt;html&gt; &lt;div id="linechart_material"&gt;&lt;/div&gt; &lt;/html&gt; This works just fine with small data sets and it never really fails but when I get up the number of data points I need, circa 30,000 it takes almost 30 seconds to load. Is there anything I can do on the backend to speed this up or does anyone know if a browser based chart that can render faster?
accepted answer: http://stackoverflow.com/a/28222933
favorite count: 0
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28218265
has answer: http://stackoverflow.com/a/28218265
has title: speeding up google charts rendering or alternatives
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/28222933
answer count: 2
tagged with: google-visualization

http://stackoverflow.com/q/28124969
has comment: http://stackoverflow.com/comment/44623329
type: AnsweredQuestion
tagged with: chart.js
type: Question
has comment: http://stackoverflow.com/comment/44643849
has answer: http://stackoverflow.com/a/28136077
accepted answer: http://stackoverflow.com/a/28136077
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: Not able to draw Doughnut Chart from json response
has body: I am trying to draw Doughnut Chart using chartjs I am getting proper json response from my localhost my code is : $(document).on('click', '#plotGraph', function(event) { event.preventDefault(); alert("hello"); $.getJSON("PlotExpenseGraph", function(data1) { alert("hiiiii"); console.log(data1); console.log(data1.expenseList[0].param); var pieData; $.each(data1.expenseList, function(position, expenseList) { console.log(expenseList.param); console.log(expenseList.totalCount); console.log(expenseList.totalValue); pieData = { value: expenseList.totalValue, color: "#F7464A", highlight: "#FF5A5E", label: expenseList.param } }); var ctx = $("#myChart").get(0).getContext("2d"); var myNewChart = new Chart(ctx); new Chart(ctx).Doughnut(pieData); }); }); Plot graph My console data is param: "Advertising" totalCount: 2 totalValue: 754 Advertising Advertising 2 754 My code is not plotting any figure and also it is not giving any error on console. What scanges should I make to work above code properly.

charts
tags question: http://stackoverflow.com/q/28279580
tags question: http://stackoverflow.com/q/28231809
tags question: http://stackoverflow.com/q/28252495
tags question: http://stackoverflow.com/q/28232742
tags question: http://stackoverflow.com/q/28142383
tags question: http://stackoverflow.com/q/28192177
tags question: http://stackoverflow.com/q/28234886
tags question: http://stackoverflow.com/q/28212504
tags question: http://stackoverflow.com/q/28144911
tags question: http://stackoverflow.com/q/28153266
tags question: http://stackoverflow.com/q/28186109
tags question: http://stackoverflow.com/q/28226739
tags question: http://stackoverflow.com/q/28198049
tags question: http://stackoverflow.com/q/28249941
type: Tag
tags question: http://stackoverflow.com/q/28232422
tags question: http://stackoverflow.com/q/28190215
tags question: http://stackoverflow.com/q/28249386
tag name: charts
tags question: http://stackoverflow.com/q/28154539
tags question: http://stackoverflow.com/q/28195352
tags question: http://stackoverflow.com/q/28183817
tags question: http://stackoverflow.com/q/28206376
tags question: http://stackoverflow.com/q/28237229
tags question: http://stackoverflow.com/q/28216832

http://stackoverflow.com/a/28167792
downvote count: 0
answers question: http://stackoverflow.com/q/28167484
accepted answer of: http://stackoverflow.com/q/28167484
upvote count: 3
type: AcceptedAnswer
has body: There are two concepts in the function below that I think could be the source of your confusion. addMethod keeps a reference to previously added function as a closure stack using var old = object[name];. addMethod knows how many arguments a function was defined with using Function.length(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) and compares that with the closure stack it creates. If it doesn't match, it goes up to the next one(); That's what John Resig is referring to as the overhead this method creates. The logging created by the code below should help you see what's happening. // addMethod - By John Resig (MIT Licensed) function addMethod(object, name, fn) { var old = object[name]; object[name] = function() { if (fn.length == arguments.length) { console.log('Arguments and parameters count are the same, found the function'); return fn.apply(this, arguments); } if (typeof old == 'function') { console.log('Arguments and parameters count are not the same, try the next function in the closure stack'); return old.apply(this, arguments); } }; } function Users() { // This will be at the bottom of the stack, every call will have to go through the functions below addMethod(this, "find", function() { console.log('Called with 0 arguments'); }); // This will be at the middle of the task addMethod(this, "find", function(name) { console.log('Called with one argument'); }); // This is the one with the least overhead addMethod(this, "find", function(first, last) { console.log('Called with two arguments'); }); } var users = new Users(); users.find(); users.find('John'); users.find('John', 'Resig'); Remember to step through functions when trying to understand them. Right click on the image below and choose "open image in new tab" Here's an addMethods will a little less overhead and IMHO, nicer syntax and less repetition. // addMethods - By Juan Methods, inspired by John Resig (MIT Licensed) function addMethods(object, name /* …
type: Answer
score: 3

http://stackoverflow.com/comment/44775093
has text: Cut from past the equal sign in line 1, and paste it in line 4 instead of $featuredslider (but leave the rest). I can't imagine this is what the tutorial example looked like...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28204583
score: 1

http://stackoverflow.com/comment/44788606
comment on: http://stackoverflow.com/q/28212322
has text: Did you check the type of the data? Was it a JSON or string ?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28203629
has body: When we pass back-end models into front-end models, sometimes there are constants that I do not want to redefine. class MyModel { const ADMIN = 1 } Usually in PHP I would access the constant this way MyModel::ADMIN. What is a recommended solution for bringing class constants to the front end?
type: Question
has title: How do I share PHP class constants with Javascript objects?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44773588
has answer: http://stackoverflow.com/a/28207875
type: UnansweredQuestion
score: 0
tagged with: php
tagged with: design-patterns
tagged with: constants
has comment: http://stackoverflow.com/comment/44773252

http://stackoverflow.com/comment/44788381
has text: do not set the width & height with js... HEY AND, as @veerasuthan V said, you can place it with position:absolute;top:0;left:0; (still in the style property). Then just play with jquery .hide() / .show()... that should work like this
type: AnswerComment
comment on: http://stackoverflow.com/a/28212039
score: 0
type: Comment

http://stackoverflow.com/q/28166625
upvote count: 4
tagged with: css
type: AnsweredQuestion
downvote count: 0
has body: I have created a google map with circles overlapping each other, while am hovering overlapping circle, z-index of that circle should changes and it should come on top of other circles. There is a way to do this for markers, like in this link " changing z index of marker on hover to make it visible " . But i want to do this for points created by data layer, Here is my fiddle sample http://jsfiddle.net/8cs97z8h/1/ var json = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-98.344139,28.629211] } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-98.341263,28.629228] } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-98.3412, 28.629] } }, ] }; var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 12, center: new google.maps.LatLng(28.666767, -98.367298), }); map.data.addGeoJson(json); map.data.setStyle(styleFeature); function styleFeature(feature) { return { icon: { path: google.maps.SymbolPath.CIRCLE, strokeWeight: 2, strokeColor: 'white', fillColor: 'blue', fillOpacity: 1.0, scale: 7 } }; }
accepted answer: http://stackoverflow.com/a/28167114
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28167114
score: 4
tagged with: google-maps
linked to: http://stackoverflow.com/q/9339431
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Changing z-index for google map data layer point

http://stackoverflow.com/comment/44720817
type: AnswerComment
has text: Thanks! Had a look at ES5 but didn't think of checking the ES6 spec. Glad I found the error though, it's a Cordova app and will be running in a WebView so could have seen some bad behaviour!
comment on: http://stackoverflow.com/a/28175674
type: Comment
score: 0

identifier
tag name: identifier
type: Tag
tags question: http://stackoverflow.com/q/28253455
tags question: http://stackoverflow.com/q/28185877

http://stackoverflow.com/a/28263370
score: 0
has body: u can use hierarchy select plugin etc: jquery-select-hierarchy
type: Answer
answers question: http://stackoverflow.com/q/28263051

http://stackoverflow.com/comment/106476856
comment on: http://stackoverflow.com/a/46872283
type: AnswerComment
type: Comment
score: 1
has text: Can miss keys with `undefined` value. See my comment on the similar answer above: https://stackoverflow.com/questions/28150967/typescript-cloning-object/38874807#comment106476826_42758108

http://stackoverflow.com/a/28157762
accepted answer of: http://stackoverflow.com/q/28131026
has comment: http://stackoverflow.com/comment/44697912
type: Answer
score: 2
downvote count: 0
has body: Raycaster's intersect object takes an Object3D with children, and has a flag for recursion. https://github.com/mrdoob/three.js/blob/master/src/core/Raycaster.js#L33 So it should look like this: var intersections = raycaster.intersectObjects( yourRootObject3D, true );
has comment: http://stackoverflow.com/comment/44690006
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28131026

http://stackoverflow.com/q/28156186
type: Question
answer count: 1
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28156301
has body: I have a created a simple popup with jquery, basically if a button is pressed, a div's 'display' changes from 'none' to 'block' in css and displays an overlay to make the background darker. See my code: function div_show() { $("#login").css({display:'block'}); $("#overlay").css({background:'#000'}); $("#overlay").css({zIndex:'2'}); } //Function to Hide Popup function div_hide(){ $("#login").css({display:'none'}); $("#overlay").css({background:'none'}); $("#overlay").css({zIndex:'-1'}); } And the popup itself (html) if handy: Click me stuff I want to have an animation, like fading, when this popup shows, but i haven't managed it. I tried adding $("#login").fadeIn(); to the 'div_open()' function, but that doesn't work obviously. I hope someone can help me. Many thanks, Paul
favorite count: 0
accepted answer: http://stackoverflow.com/a/28156301
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44685400
has comment: http://stackoverflow.com/comment/44683793
score: 1
upvote count: 1
type: AnsweredQuestion
tagged with: javascript
has title: How do I apply jquery animation to my popup?

http://stackoverflow.com/q/28216551
tagged with: prototypal-inheritance
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44796550
linked to: http://stackoverflow.com/q/310870
has title: Javascript defining method using this V/s prototype
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28216666
duplicate of: http://stackoverflow.com/q/310870
favorite count: 0
type: UnansweredQuestion
has body: In Object-oriented Javascript, we can define a method inside an object as this.myMethod = function() { } OR we can use the prototype way MyClass.prototype.myMethod = function() { } What are the differences between the 2 techniques ?

http://stackoverflow.com/comment/44823334
type: AnswerComment
has text: here is what is in the source code reply so you could reply = soup.findAll('a'), attrs = {"id": "replylink"}); and then reply[0].get('href') and, so the final link is http://losangeles.craigslist.org/ + the result
type: Comment
comment on: http://stackoverflow.com/a/28229839
score: 0

collision-detection
tags question: http://stackoverflow.com/q/28131026
type: Tag
tags question: http://stackoverflow.com/q/28124554
tag name: collision-detection

http://stackoverflow.com/q/28255571
score: 1
has comment: http://stackoverflow.com/comment/44869462
has comment: http://stackoverflow.com/comment/44869914
favorite count: 0
tagged with: php
has answer: http://stackoverflow.com/a/28255809
possible better answer: http://stackoverflow.com/a/28255676
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28255676
upvote count: 1
accepted answer: http://stackoverflow.com/a/28255809
has comment: http://stackoverflow.com/comment/44869977
has body: I am scripting a chat for a forum, and it seems that it uses php to get the user's avatars. (PS idk anything about weather or not javascript can use sql databases or how to work with it so i would like to stick to php) But the problem is that the javascript isnt liking it if i put php variables into it. getUserNodeString: function(userID, userName, userRole) { var encodedUserName, str; if(this.userNodeString && userID === this.userID) { return this.userNodeString; } else { encodedUserName = this.scriptLinkEncode(userName); str = ' ' + userName + '<?php echo \' \' ?>' + ' '+this.getUserNodeStringItems(encodedUserName, userID, false) : ' style="display:none;">') + ' ' +' '; if(userID === this.userID) { this.userNodeString = str; } return str; } }, '<?php echo \' \' ?>' is the line thet im trying to use, i havent put my variable yet, im trying it with a test immage first
type: Question
has title: How do I get a php element into a javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/44869505
has comment: http://stackoverflow.com/comment/44869862
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/46605963
has text: The `.then((value,...` part you added is redundant. (If you were going to write such a function, you can do so more compactly as `value => value`; when you write it that way, it becomes more obvious that it accomplishes nothing.)
comment on: http://stackoverflow.com/a/29195001
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44912314
has text: What have you tried so far? Please update your question to include any relevant code - the more detail you include, the greater your chances of getting a useful answer.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28278896

http://stackoverflow.com/q/28222228
has comment: http://stackoverflow.com/comment/44811264
has answer: http://stackoverflow.com/a/28229267
has answer: http://stackoverflow.com/a/57833469
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44807774
has answer: http://stackoverflow.com/a/62542815
has answer: http://stackoverflow.com/a/57682075
has comment: http://stackoverflow.com/comment/44810201
upvote count: 39
type: Question
has body: Is there an elegant way to tell Harmony's slim arrow functions apart from regular functions and built-in functions? The Harmony wiki states that: Arrow functions are like built-in functions in that both lack .prototype and any Construct internal method. So new (() => {}) throws a TypeError but otherwise arrows are like functions Which means, you can test for arrow functions like: !(()=&gt;{}).hasOwnProperty("prototype") // true !(function(){}).hasOwnProperty("prototype") // false But the test will also return true for any built-in function, e.g. setTimeout or Math.min. It sort of works in Firefox if you get the source code and check if it's "native code", but it doesn't seem much reliable nor portable (other browser implementations, NodeJS / iojs): setTimeout.toSource().indexOf("[native code]") &gt; -1 The small GitHub project node-is-arrow-function relies on RegExp-checks against the function source code, which isn't that neat. edit: I gave the JavaScript parser acorn a try and it seems to work quite okay - even though it's pretty overkill. acorn = require("./acorn"); function fn_sample(a,b){ c = (d,e) =&gt; d-e; f = c(--a, b) * (b, a); return f; } function test(fn){ fn = fn || fn_sample; try { acorn.parse("(" + fn.toString() + ")", { ecmaVersion: 6, onToken: function(token){ if(typeof token.type == "object" &amp;&amp; token.type.type == "=&gt;"){ console.log("ArrowFunction found", token); } } }); } catch(e) { console.log("Error, possibly caused by [native code]"); console.log(e.message); } } exports.test = test;
has comment: http://stackoverflow.com/comment/44807580
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/44807945
has comment: http://stackoverflow.com/comment/84679016
has comment: http://stackoverflow.com/comment/65034341
tagged with: function
accepted answer: http://stackoverflow.com/a/28234333
tagged with: javascript
has answer: http://stackoverflow.com/a/62073784
has comment: http://stackoverflow.com/comment/44811988
answer count: 11
tagged with: ecmascript-harmony
has answer: http://stackoverflow.com/a/65570273
tagged with: arrow-functions
has answer: http://stackoverflow.com/a/38830947
has answer: http://stackoverflow.com/a/28234333
downvote count: 1
has comment: http://stackoverflow.com/comment/44809498
possible better answer: http://stackoverflow.com/a/57682075
has answer: http://stackoverflow.com/a/46409174
favorite count: 0
has answer: http://stackoverflow.com/a/78648669
has comment: http://stackoverflow.com/comment/85143147
linked to: http://stackoverflow.com/q/35686850
score: 38
has answer: http://stackoverflow.com/a/74087770
has title: JavaScript ES6: Test for arrow function, built-in function, regular function?

http://stackoverflow.com/comment/44836534
score: 0
type: Comment
type: QuestionComment
has text: the item.IDphoto is int
comment on: http://stackoverflow.com/q/28237338

http://stackoverflow.com/a/28256940
answers question: http://stackoverflow.com/q/28256910
type: Answer
downvote count: 0
score: 1
has body: when you use querySelectorAll, you are getting a list of current elements with the button class and attatching an event to it. when you add new elements, they don't automatically get the event listener. You have to rerun the function whenever you append or just add the same event to appended items.
upvote count: 1

http://stackoverflow.com/comment/44801739
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28218863
has text: Another question, this is an XY Problem - what makes you *think* you actually need a sleep whereas (as you pointed out) its been proven time and time again that you just shouldn't do that in Javascript?

http://stackoverflow.com/comment/44852018
type: QuestionComment
type: Comment
has text: @user2864740 yes, but that doesn't happen if I implemeneted a function using the script I have above, it wouldn't stop background or Interval script like `alert()`, `prompt()` and `confirm()` do
comment on: http://stackoverflow.com/q/28245541
score: 0

http://stackoverflow.com/q/28236910
answer count: 3
upvote count: 1
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/28237104
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28237001
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44835057
favorite count: 0
has answer: http://stackoverflow.com/a/28236989
type: Question
has comment: http://stackoverflow.com/comment/44835365
has comment: http://stackoverflow.com/comment/44835070
has body: I am trying to query a MySQL database and put the result in jQuery using JSON, because I need to do graphics. My problem is when I manipulate the JSON. My code at the moment: index.php $(function ($) { $("#formulario").submit(function () { var nome = $("#nome").val(); $("#status").html("&lt;img src='loader.gif' alt='Enviando' /&gt;"); $.post('envia.php', { nome: nome }, function (resposta) { $("#status").slideDown(); if (resposta != false) { $("#status").html(resposta); } else { $("#nome").val(""); } }); }); }); envia.php (the query is only for test) require_once("conecta.php"); $nome = $_POST["nome"]; $culturas = array(); $resultado = mysqli_query($conexao, "select *from mandioca_iea where mandioca_iea_id=1"); while ($cultura = mysqli_fetch_assoc($resultado)) { array_push($culturas, $cultura); } echo json_encode($culturas); If I test the code in this way: In div="status" appears: [{"mandioca_iea_id":"1","man_ins_area_00":"0","man_ins_prod_00":"0","man_ins_area_05":"0","man_ins_prod_05":"0","man_ins_area_10":"0","man_ins_prod_10":"0","man_ins_area_13":"0","man_ins_prod_13":"0","id_cid":"1","id_cult":"1"}] OK,It works But when I try to access the "fields" using this code, it doesn't work: $.post('envia.php', {nome: nome}, function(resposta) { for(var i=0; i&lt;resposta.length; i++) { var registro = resposta[i]; console.log(registro.man_ins_area_10); } }); OBS: I tried resposta = $.parseJSON(resposta) too. In console of web browser, the result is: 228 undefined, in other words, happens "loop" 228 times and all "vars" are undefined. Does someone know why this happens?
has title: Problems with jQuery and JSON
score: 0

http://stackoverflow.com/q/28136023
has answer: http://stackoverflow.com/a/28136062
accepted answer: http://stackoverflow.com/a/28136062
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: So i'm trying to get the href code to be a clickable button. So far i'm just trying to make it as a link! Heres the code $("table").append(" "+title+" "); The JSON pulled back a Href link, All I want is to have a tabled button that says link and redirects the page using the link from the json. Sam
type: Question
tagged with: jsonp
has title: JSON Issue with API HREF

http://stackoverflow.com/a/28952409
score: 0
type: Answer
has body: Here is one option: CSS #legend {visibility:hidden;} Javascript require(["dojo/dom", "dojo/dom-style", "dojo/on"], function(dom, domStyle, on){ dom.byId("legend_button").on("click", function(data) { domStyle.set(dom.byId("legend"), "visibility", "visible"); }); }); This example will hide the legend onload and show it on button click.
answers question: http://stackoverflow.com/q/28213962

http://stackoverflow.com/comment/44638967
comment on: http://stackoverflow.com/q/28133167
has text: Well fully covering the page is a matter of choosing appropriately sized images (I just used placeholders) and/or scaling the image in your CSS. `no-repeat` should stop the tiling (but when you set the background in your JS it's presumably overriding the stylesheet).
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28188938
type: Question
has comment: http://stackoverflow.com/comment/44749433
has title: in cakephp how to create another file like core.php file and call global variable in js file
tagged with: php
has answer: http://stackoverflow.com/a/28236295
has comment: http://stackoverflow.com/comment/44749157
has comment: http://stackoverflow.com/comment/44749331
tagged with: cakephp-2.3
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44749387
has comment: http://stackoverflow.com/comment/44749260
has body: I have created a file inside config folder similar like config.php. how can I call the global variables mentioned in my newconfigfile.php in my js file. for example define("DATETIME_FORMAT", "MM/dd/yy HH:mm");
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44749234
has comment: http://stackoverflow.com/comment/44747329
tagged with: config

http://stackoverflow.com/comment/44728384
type: QuestionComment
score: 0
has text: @Typhomism, answer added.
comment on: http://stackoverflow.com/q/28159244
type: Comment

http://stackoverflow.com/comment/44746645
comment on: http://stackoverflow.com/a/28189099
score: 0
type: AnswerComment
has text: @deveshchauhan27 it would be `$('.myclass').is('[data-val=abc]')`
type: Comment

http://stackoverflow.com/comment/44788839
comment on: http://stackoverflow.com/a/28212225
has text: Thanks for guiding me to a correct direction. You mentioned I have to use `.onConsoleMessage()` but why the User Agent line can be shown in console without using the above function ?
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28124453
type: Question
has answer: http://stackoverflow.com/a/28124611
accepted answer: http://stackoverflow.com/a/28124642
tagged with: closures
tagged with: javascript
has comment: http://stackoverflow.com/comment/44622530
answer count: 3
has answer: http://stackoverflow.com/a/28124642
upvote count: 1
favorite count: 0
has title: how to make this simple javascript closure work
has body: I was explaining javascript closure to a friend like this: function outer() { var count = 0; return (function(){ count++; console.log(count); })(); } I was trying to show him that how does this 'count' variable is stored when the outer function is executed. So I tried doing this in the javascript console and wanted to show him that when you do this in the console outer(); // prints out 1 outer(); // calling again prints 2 outer(); // prints out 3 but actually this happened outer(); // printed 1 outer(); // printed 1 again outer(); // again 1 I don't understand whats going wrong here. Can someone guide me.
possible better answer: http://stackoverflow.com/a/28124526
has answer: http://stackoverflow.com/a/28124526
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44622365
score: 1
has comment: http://stackoverflow.com/comment/44622461

http://stackoverflow.com/a/42604626
answers question: http://stackoverflow.com/q/28232072
upvote count: 25
type: Answer
score: 25
has body: Yes, in CSS it is possible to use @media rules to target an exact width. CSS Example @media (width: 980px) { /* Your CSS */ } This is telling the browser, when the viewport width is exactly 980px wide, apply the following CSS. When your viewport width changes to 981px or 979px or anything that isn't 980px wide, the CSS will be removed. Unlike the other answers, this is not using max-width or min-width because the @media rules allow you to just define width, which will target the exact measurement you give it. The width is defined using the viewport width. Note: You can learn more about the CSS3 @media rule from W3 Schools. Specifically if you look under Media Features, you'll see the available variables, including width all the way at the bottom.
downvote count: 0

http://stackoverflow.com/a/28285484
type: AcceptedAnswer
has body: I think you should just do scene.add( result ) instead.
has comment: http://stackoverflow.com/comment/44968893
has comment: http://stackoverflow.com/comment/45073692
answers question: http://stackoverflow.com/q/28262484
type: Answer
accepted answer of: http://stackoverflow.com/q/28262484
has comment: http://stackoverflow.com/comment/44925577
has comment: http://stackoverflow.com/comment/44968970
has comment: http://stackoverflow.com/comment/44927399
score: 0

http://stackoverflow.com/a/28269670
has body: You just need to force a scope digest cycle: $(document).on('click', function (e) { $('#Icon').each(function () { //the 'is' for buttons that trigger popups //the 'has' for icons within a button that triggers a popup if (!$(this).is(e.target) &amp;&amp; $(this).has(e.target).length === 0 &amp;&amp; $('.popover').has(e.target).length === 0) { $(this).popover('hide'); $scope.activeSearch = !$scope.activeSearch; $scope.$apply(); // &lt;--- this is the key } }); }); I just don't understand why would you use both jQuery and Angular to set up click listeners on the same element. Next thing: $('#Icon').each This makes no sense since IDs need to be unique, you can't/shouldn't have duplicates.
answers question: http://stackoverflow.com/q/28268916
has comment: http://stackoverflow.com/comment/44896978
score: 0
type: Answer

http://stackoverflow.com/comment/44762901
has text: Protip: I recommend not storing application state in HTML elements. Store these values in JavaScript and update them from HTML when needed. Someday you're going to want to access these values or change them and the HTML wont be around, and then you'll have to load the elements just to get at the state because you have 10K lines of code assuming state in DOM.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28198200
score: 2

http://stackoverflow.com/comment/44653641
type: QuestionComment
type: Comment
score: 0
has text: If you use the methods on the prototype directly, `this` won't work.
comment on: http://stackoverflow.com/q/28140975

http://stackoverflow.com/a/28183091
answers question: http://stackoverflow.com/q/28183005
type: Answer
has body: All are exactly the same apart from 3. From jQuery - What are differences between $(document).ready and $(window).load? $(document).ready(function() { // executes when HTML-Document is loaded and DOM is ready alert("document is ready"); }); $(window).load(function() { // executes when complete page is fully loaded, including all frames, objects and images alert("window is loaded"); });
score: 0

http://stackoverflow.com/q/28217706
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/2868582
accepted answer: http://stackoverflow.com/a/28217779
score: 2
tagged with: twitter-bootstrap-3
possible better answer: http://stackoverflow.com/a/41703356
upvote count: 2
linked to: http://stackoverflow.com/q/23764863
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44802933
has answer: http://stackoverflow.com/a/41703356
has title: How to close bootstrap 3 dropdown when we click outside on a tablet?
type: Question
type: AnsweredQuestion
has body: I am doing this and it works fine on the desk: $(document).on("click", function(){ $(".dropdown-toggle").removeClass("open"); }); But on the iPad that it isn't working and my dropdown remains open
has answer: http://stackoverflow.com/a/50695214
has answer: http://stackoverflow.com/a/28217779
answer count: 3

http://stackoverflow.com/comment/44890972
comment on: http://stackoverflow.com/q/28267360
has text: Where did you configure it? if you configured it in your config block in 'myDependentApp' module, then yes, it will be active in myApp.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28272954
has comment: http://stackoverflow.com/comment/44901506
has title: passing value through ajax
type: Question
has answer: http://stackoverflow.com/a/38320664
tagged with: javascript
tagged with: ajax
score: 0
answer count: 2
has body: I am new to ajax and i don't have much idea about ajax. I am trying to pass the value from url using ajax but i am not being able to do so. I have done few search on google and found some ajax function code and i tried to implement on my code but one code is not working and another code is giving error. I have left both code below:- error:-1 ajax code html+php code <?php if(isset($_GET['check'])){echo $_GET['check'];} ?> <?php if(isset($_GET['name'])){echo $_GET['name'];} ?> Let AJAX change this text error:- 2 ajax code: html+php code: <?php if(isset($_GET['id'])){echo $_GET['id'];} ?> ` Let AJAX change this text ` I just want to pass the value from url to the same page using ajax but i am not being able to do so. Hope i will get help over here. Thank You in advance.
has comment: http://stackoverflow.com/comment/45221319
has comment: http://stackoverflow.com/comment/44901531
has comment: http://stackoverflow.com/comment/44901544
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28273017
has comment: http://stackoverflow.com/comment/44901861
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44900905
tagged with: php
has comment: http://stackoverflow.com/comment/44900897

http://stackoverflow.com/comment/44700810
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28146235
has text: @Jay, that would be a new question. But if you expect to be able to deal with the data in the DOM, I don't see why it would not work as a string (which tends to consume less storage).
score: 0

http://stackoverflow.com/q/28222672
score: 2
upvote count: 2
has body: I have an HTML table that has an onclick event in the first column in each row that will load content when pressed. I want to navigate through the table with the up and down arrow keys and when I press enter, fire off the oncliick event. I do not need to navigate cells, just the rows to highlight the row so you know which row's content is being displayed. Heres my table: Location SelectionType @foreach (var item in Model.List) { Display @Html.DisplayFor(modelItem => item.AdvertisementLocation) @Html.DisplayFor(modelItem => item.AdvertisementSelectionType) } My CSS is set up to make the table a set height with a scroll bar: tbody { border-collapse: collapse; overflow: auto; max-height: 486px; } thead, tbody { border-collapse: collapse; border: 1px solid black; display: block; } th { border: 1px solid black; font-size: 1.3em; text-align: center; padding-left: 0; } I would like to do this all with JS. Andy Help?
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28223690
has answer: http://stackoverflow.com/a/28223557
has answer: http://stackoverflow.com/a/28223154
has answer: http://stackoverflow.com/a/28223690
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Navigate HTML table rows with javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28223557

http://stackoverflow.com/a/28130092
has comment: http://stackoverflow.com/comment/44633071
has comment: http://stackoverflow.com/comment/44633195
upvote count: 1
answers question: http://stackoverflow.com/q/28130058
type: Answer
downvote count: 0
score: 1
has body: Sure that your code is correct? Before assigning getScore1, you are returning out of the function, so the assignment to getScore1 and getScore2 never occurs. Hence the undefined error...
has comment: http://stackoverflow.com/comment/44633058

http://stackoverflow.com/a/28254201
score: 3
has body: I see that you want to give some structure and organize your javascript code. This is best handled in Javascript with what is popularly known as the Module Pattern In a nutshell, it works like this: var MODULE = (function () { var my = {}, privateVariable = 1; function privateMethod() { // ... } my.moduleProperty = 1; my.moduleMethod = function () { // ... }; return my; }()); This snippet and further reading is documented in Ben Cherry's article and Eric Miraglia's article. There are some neat variations of the module pattern, one such is the revealing module pattern by Christian Heilmann
downvote count: 0
answers question: http://stackoverflow.com/q/28253248
upvote count: 3
type: Answer

http://stackoverflow.com/q/28268574
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44893419
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28268636
possible better answer: http://stackoverflow.com/a/65571865
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65571865
tagged with: iframe
accepted answer: http://stackoverflow.com/a/28268636
has body: I want to load an iframe into a Django template. The template is getting loaded correctly, but in place of the iframe, the template itself is getting embedded inside the parent template. The code relevant is given below: &lt;body&gt; &lt;p&gt; &lt;strong&gt;Player: {{player.username}}&lt;/strong&gt;&amp;nbsp; &lt;div id=&quot;playerid&quot;&gt;{{player.id}}&lt;/div&gt;&lt;br&gt; &lt;iframe id=&quot;encoder_iframe&quot; height=75% width=&quot;50%&quot; src=&quot;testgame.html&quot;&gt;&lt;/iframe&gt; &lt;br&gt; &lt;strong&gt;Last score:&lt;/strong&gt;&amp;nbsp; &lt;span id=&quot;scores&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt; &lt;strong&gt;Game state:&lt;/strong&gt; &lt;div id=&quot;gamestate&quot;&gt;&lt;/span&gt; &lt;/p&gt; &lt;br&gt; &lt;/body&gt; testgame.html is a file located in the same directory as this HTML template, but it doesn't load. In its place, the parent template itself appears. I looked around Stack Overflow, and from some of the posts I gather that I need to set the src attribute of the iframe to a Django view, which will load the iframe separately. Is this correct? If so, how do I configure the URL (i.e. set the path to the view)?
tagged with: django
upvote count: 7
type: Question
score: 7
tagged with: javascript
answer count: 2
has title: Set URL to load iframe in a Django template

http://stackoverflow.com/q/28227886
has answer: http://stackoverflow.com/a/47412117
has answer: http://stackoverflow.com/a/28510910
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28228096
favorite count: 0
has answer: http://stackoverflow.com/a/28227914
tagged with: ajax
has title: parameters in jquery ajax success
possible better answer: http://stackoverflow.com/a/28228096
answer count: 4
score: 2
upvote count: 2
has body: I am trying to find out what parameters I can pass to a jQuery ajax call. What I am used to is writing something like: $.ajax({ .... success: function(response) { // put callback here } .... }); So here is my question: Obviously the "response" variable I put in the success function just takes back whatever the server sends back from the ajax call. Is there any possible way to send multiple variables back? Something like: ... success: function(response,httpStatus,whateverElse) { } ... Or, is there some other way to get the http response codes? Thanks to whoever can answer this!
accepted answer: http://stackoverflow.com/a/28227914
type: AnsweredQuestion
tagged with: javascript
type: Question

http://stackoverflow.com/q/28244992
accepted answer: http://stackoverflow.com/a/28252831
tagged with: ajax
answer count: 3
has answer: http://stackoverflow.com/a/28251625
favorite count: 0
has body: I've created a Polymer element using core-ajax to send data via POST to a PHP script. send I've examined the HTTP request, and verified the data is being sent. However, my PHP script - on the other hand - is not showing traces of the data in the $_POST or $_REQUEST variables. This is the contents of my PHP script: header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1 header("Pragma: no-cache"); //HTTP 1.0 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past error_reporting(E_ALL); ini_set("display_errors", 1); define("BASE_PATH", $_SERVER['DOCUMENT_ROOT']); define('WP_USE_THEMES', false); global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header; require(BASE_PATH . '/wp-load.php'); var_dump($_POST); var_dump($_REQUEST); $creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) { header("HTTP/1.0 401 Unauthorized"); echo $user->get_error_message(); exit(); } header("HTTP/1.0 200 OK"); exit(); Not elegant code, I know. But the response I get from the script is: array(0) { } array(0) { } ERROR: Invalid username. Lost your password? So the $_POST and $_REQUEST arrays are empty, when I'm expecting them to be filled with the data I've provided.
tagged with: wordpress
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/28252831
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28246917
score: 1
has answer: http://stackoverflow.com/a/28246917
type: Question
has title: PHP not receiving POST body set in Polymer core-ajax element
tagged with: polymer
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/44804517
has text: Your question is not very clear (to me). What do you mean when you say "... beyond the scene space origin at (0,0,0)". The camera definition takes a near and a far plane. Objects beyond the far plane are not visible. You can find a very good explanation (with a lot of math) at http://www.songho.ca/opengl/gl_transform.html and http://www.songho.ca/opengl/gl_projectionmatrix.html
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28220565

http://stackoverflow.com/q/28180414
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44730222
accepted answer: http://stackoverflow.com/a/28180473
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44729940
favorite count: 0
downvote count: 0
has answer: http://stackoverflow.com/a/28180473
has body: Is there a way to trigger a function when an iframe on the same page is loaded completely.
has comment: http://stackoverflow.com/comment/44729971
type: Question
type: AnsweredQuestion
score: 1
has title: Trigger a function when iframe completely loaded
upvote count: 1

http://stackoverflow.com/q/28278752
accepted answer: http://stackoverflow.com/a/28285928
upvote count: 4
answer count: 2
downvote count: 0
has title: jquery FullCalendar - items being duplicated
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44911620
has comment: http://stackoverflow.com/comment/44911782
has body: I asked this question about a month ago and got my answer: jquery FullCalendar using MVC and JSON However, now I am seeing duplicates when I switch between months: My javaScript code is: var source = '../calendar/PostCalendarData'; $(document).ready(function () { var events = []; $('#calendar').fullCalendar('removeEvents'); $('#calendar').fullCalendar({ events: function(start, end, timezone, callback) { $.ajax({ url: source, type: 'POST', data: { custom_param1: '', custom_param2: '' }, success: function (doc) { $.each(doc, function (index, element) { events.push(element); }); callback(events); } }); } }); }); I'm populating the calendar using a stored procedure (located here: ../calendar/PostCalendar). Is there something I need to do to clear out the calendar for each month? I'm including the PostCalendar method here: [HttpPost] public ActionResult PostCalendarData() { SqlParameter param1 = new SqlParameter("@filterValue", ""); var calAssignments = db.Database.SqlQuery&lt;calendarAssignment&gt;( "exec getCalendarInfo_v2 @filterValue ", param1).ToList&lt;calendarAssignment&gt;(); List&lt;calendarEvent&gt; calEvents = new List&lt;calendarEvent&gt;(); foreach (calendarAssignment item in calAssignments) { string[] splitDates = item.futureDates.Split(','); foreach(string s in splitDates) { calendarEvent calEvent = new calendarEvent(); calEvent.title = item.name + " : " + item.chore; calEvent.description = item.chore; DateTime _futureDate; _futureDate = DateTime.Parse(s); calEvent.start = _futureDate.ToString("yyyy-MM-dd"); calEvents.Add(calEvent); } } SqlParameter paramDaily = new SqlParameter("@filterValue", "daily"); var calAssignmentsDaily = db.Database.SqlQuery&lt;calendarAssignment&gt;( "exec getCalendarInfo @filterValue ", paramDaily).ToList&lt;calendarAssignment&gt;(); foreach (calendarAssignment item in calAssignmentsDaily) { string[] splitDates = item.futureDates.Split(','); foreach (string s in splitDates) { calendarEvent calEvent = new calendarEvent(); calEven…
linked to: http://stackoverflow.com/q/27766405
has answer: http://stackoverflow.com/a/40845230
has comment: http://stackoverflow.com/comment/44911853
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/40845230
has answer: http://stackoverflow.com/a/28285928
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44912247
tagged with: javascript
tagged with: fullcalendar
score: 4

http://stackoverflow.com/comment/44668812
type: AnswerComment
has text: @T.J.Crowder: So it can't be done the way i want `'abc'.rev()` as opposed to `var a = 'abc'.rev()` as although strings are NOT immutable there is yet no possible way of achieving this goal?!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28148255

http://stackoverflow.com/a/28216262
has comment: http://stackoverflow.com/comment/44799879
score: 0
has comment: http://stackoverflow.com/comment/44798930
has body: You can try to store the phonenumber into the ID of the then use this script ... EDIT: Try this ... Remember to add the id and the class attributes
has comment: http://stackoverflow.com/comment/44799479
has comment: http://stackoverflow.com/comment/44797691
type: Answer
answers question: http://stackoverflow.com/q/28215821
has comment: http://stackoverflow.com/comment/44797782
has comment: http://stackoverflow.com/comment/44799321

http://stackoverflow.com/q/28225458
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/28225695
has answer: http://stackoverflow.com/a/28225603
tagged with: javascript
score: 4
tagged with: express
answer count: 3
downvote count: 0
has body: I'm trying to get the response of two URLs in nodejs but there's a problem with http.request. Here's what I have so far: var url = "https://www.google.com/pretend/this/exists.xml"; var opt = { host: url.split(".com/")[0] + ".com", path: "/" + url.split(".com/")[1] }; callback = function(response){ var str = ""; response.on('data', function(chunk){ str += chunk; }); response.on('end', function(){ console.log(str); }); } http.request(opt, callback).end(); and I'm getting this error events.js:72 throw er; // Unhandled 'error' event ^ Error: getaddrinfo ENOTFOUND at errnoException (dns.js:37:11) at Object.onanswer [as oncomplete] (dns.js:124:16) so I googled and got this stackoverflow issue nodejs httprequest with data - getting error getaddrinfo ENOENT in which the accepted answer says that you need to leave out the protocol.. but here's the issue, I need to check if https://www.google.com/pretend/this/exists.xml gives a 200 and if it doesn't (404) then I need to check if http://www.google.com/pretend/this/exists.xml gives a valid response So that's the issue, I need to check a response by specific protocol. Any ideas? edit: Just now looking at the http doc (lazy I know) and I'm seeing http.get example.. I'll try that now edit 2 : so I tried this http.get(url, function(res){ console.log("response: " + res.statusCode); }).on('error', function(e){ console.log("error: " + e.message); }); and apparently https is not supported. Error: Protocol:https: not supported.
linked to: http://stackoverflow.com/q/9580226
favorite count: 0
has title: Get response of url in nodejs (express/http)
possible better answer: http://stackoverflow.com/a/28225603
upvote count: 4
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28225977
accepted answer: http://stackoverflow.com/a/28225695

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/28159401
tags question: http://stackoverflow.com/q/28256004
tags question: http://stackoverflow.com/q/28143198
tags question: http://stackoverflow.com/q/28183505
tags question: http://stackoverflow.com/q/28125034
tags question: http://stackoverflow.com/q/28198933
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/28268449
tags question: http://stackoverflow.com/q/28147028
tags question: http://stackoverflow.com/q/28271551
tags question: http://stackoverflow.com/q/28261307
tags question: http://stackoverflow.com/q/28197894
tags question: http://stackoverflow.com/q/28218867

http://stackoverflow.com/comment/44673994
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28151315
type: QuestionComment
has text: javascript is function scoped (not speaking about `let` statement). `isJSON` is defined under the ready handler scope

http://stackoverflow.com/comment/44799047
score: 0
comment on: http://stackoverflow.com/q/28217130
type: Comment
type: QuestionComment
has text: Hi @DavidP, nah of course I never wanted it into a textbox, I was demonstrating how it is usually done with a genetic variable so readers understood what I wanted. that would be insane. preferably, I would like to parse the data from a var variable like you would do in an AJAX call.. can this be done?

http://stackoverflow.com/comment/44824433
type: Comment
has text: You're very welcome indeed; I'm glad to have provided some small help.
comment on: http://stackoverflow.com/a/28230943
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44684976
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28156193
has text: @Teemu Well... 1) The two elements are clearly different in the format returned. One returns "[object HtmlInput]" and one returns "input#path" isn't it logic that the format would be the same. and 2) Both have values. Isn't it logic that I should be able to retrieve both values?

http://stackoverflow.com/comment/44853316
score: 0
type: Comment
type: QuestionComment
has text: I'm really hoping there's a way somehow for the iframe to emit information about what it's doing, but not the content.
comment on: http://stackoverflow.com/q/28244999

http://stackoverflow.com/a/28174293
has comment: http://stackoverflow.com/comment/44728475
has comment: http://stackoverflow.com/comment/44728211
score: 1
has comment: http://stackoverflow.com/comment/44728141
has comment: http://stackoverflow.com/comment/44728111
has comment: http://stackoverflow.com/comment/44726459
has comment: http://stackoverflow.com/comment/44725005
has comment: http://stackoverflow.com/comment/44723706
has comment: http://stackoverflow.com/comment/44725401
has comment: http://stackoverflow.com/comment/44725241
has body: Print your PHP array in the page using JSON: &lt;!-- language: lang-php --&gt; &lt;?php $info = array( "cat", "dog", "bear" ); ?&gt; &lt;!-- language: lang-js --&gt; &lt;script type="text/javascript"&gt; // (it's better to retrieve it in ajax) var arr = &lt;?php echo json_encode($info); ?&gt;; // 2. Roll some dice in Javascript // Math.random returns a random value between 0 and 1 var text = ""; // wrapped in a function so you can pick new random values function pickRandom() { // Math.random returns a decimal number, and you need to access arrays using their indexes (0, 1, 2) not decimal numbers. Number.parseInt does the rounding. text = arr[ Number.parseInt( Math.random()*arr.length ) ]; alert("new random value is: " + text); } pickRandom(); &lt;/script&gt; Then the rest of your code should work. Hope this helps. Doc: JSON encoding: http://php.net/manual/fr/function.json-encode.php JS randomness: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
upvote count: 1
answers question: http://stackoverflow.com/q/28160846
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44725192
accepted answer of: http://stackoverflow.com/q/28160846
has comment: http://stackoverflow.com/comment/44727669
type: Answer
has comment: http://stackoverflow.com/comment/44725135
has comment: http://stackoverflow.com/comment/44727341
has comment: http://stackoverflow.com/comment/44726710
has comment: http://stackoverflow.com/comment/44727931
downvote count: 0

http://stackoverflow.com/q/28181825
tagged with: razor
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I am calling a EditDetails javascript function on click only if user has Admin permissions else disabling the button. I see the error "Cannot implicitly convert type bool to string " at the javascript function name. What may be the issue? &lt;img src='../../Images/Edit.png' alt='Click to Edit' onclick="@(Model.AdminPermissions ? "javascript:EditDetails('#@rowId');" ? "")" disabled="@(Model.AdminPermissions ? "" : "disabled")"
type: Question
has title: java script function inside razor block
tagged with: javascript
upvote count: 1
accepted answer: http://stackoverflow.com/a/28181924
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28181924

http://stackoverflow.com/a/28269677
score: 1
has comment: http://stackoverflow.com/comment/44944435
type: Answer
has comment: http://stackoverflow.com/comment/44901052
has body: If I understand correctly, this is simpler than the code would imply. First, repeteated code for parsing out dates can be eliminated by writing a parseDates() function, which : returns an object with .start and .end properties. can be used as a .map() callback, once for checked and once for unchecked checkboxes. Then, what remains to be done is to check all unchecked dates against all checked dates in nested loops, and manage the unchecked items' disabled status. A major factor in doing this is to re-enable items only when all the disabled items are known - ie after the two nested loops have completed. The code should be something like this : // Change checkbox apply filters $("#gform_11 input[type=checkbox]").click(function(){ var year = new Date().getFullYear(); //A utility function for parsing out start and end dates function parseDates() { var dates = $(this).html().split("-"), start = dates[0].split(" "), end = dates[1].split(" "); //If no month in end date, assume same month as first (Ex. Jul 06-22 == Jul 06 - Jul 22) if (end.length == 1) { end.unshift(start[0]); } //return an object with .start and .end properties return { start: Date.parse(start.join(" ") + ", " + year), //rejoin end: Date.parse(end.join(" ") + ", " + year) //rejoin }; } //A utility function for comparing a checked date with an unchecked date function compareDateRanges(checked, unchecked) { return ( unchecked.start &gt;= checked.start &amp;&amp; unchecked.start &lt; checked.end ) || ( unchecked.end &gt; checked.start &amp;&amp; unchecked.end &lt;= checked.end ) } var $checked = $(".gfield_checkbox input:checked"); var $unchecked = $(".gfield_checkbox input:not(:checked)").removeClass('disabled'); var checkedDates = $checked.siblings("label").find("small").map(parseDates).get();//make array of start-end objects for checked inputs var uncheckedDates = $unchecked.siblings("label").find("small").map(parseDates).get();//make array of start-end objects for unchecked inputs for(var i=0; i&lt;checke…
has comment: http://stackoverflow.com/comment/44903863
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28268635
has comment: http://stackoverflow.com/comment/44944129
answers question: http://stackoverflow.com/q/28268635
has comment: http://stackoverflow.com/comment/44937533
has comment: http://stackoverflow.com/comment/44901280
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28275478
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/28273952
tagged with: yii
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28275655
tagged with: jquery
favorite count: 0
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/28275723
has answer: http://stackoverflow.com/a/28275723
upvote count: 1
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/28275655
type: AnsweredQuestion
has body: I've previously created a question where I wanted to understand principles of work with ajax in Yii. So, I'm trying to implement an answer. I'v created controller and placed in into controllers directory: &lt;?php class AjaxController extends CController { public function actionDoThing() { // Get request object $request = Yii::app()-&gt;request; // Check if request is acceptable if ($request-&gt;isPost &amp;&amp; $request-&gt;isAjaxRequest) { echo CJSON::encode(array('hello'=&gt;'world')); } // else // { // throw new CHttpException(403); // } } } ?&gt; Also I have this fragment with script in my view. &lt;script&gt; $(document).on('click','div.lessonDiv', function() { $.ajax({ type: "POST", url: &lt;?php /*Also I tried just DoThing instead of actionDoThing, this doesn't work*/echo $this-&gt;createUrl('AjaxController/actionDoThing'); ?&gt;, success: function(data, textStatus, jqXHR) { console.log(data); } }); }); &lt;/script&gt; Dunno what's wrong, but console says: Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'actionDoThing' Where am I wrong now?
has title: Yii ajax issues

http://stackoverflow.com/a/28195792
type: Answer
has comment: http://stackoverflow.com/comment/44758727
has comment: http://stackoverflow.com/comment/44758650
accepted answer of: http://stackoverflow.com/q/28195663
has body: HTML5 has a download attribute which you can use to force the download, however, older browsers will still just open the image in the browser window. 'Download ' + this.title Here's a list of browser compatibility
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28195663

http://stackoverflow.com/comment/44646526
has text: So what will happen if user is editing the p5's range and then new object comes with no p5? Any way my recommendation still the same: do not remove nodes if it possible. If it's not - you can try to set focus manually on that element which triggered the change. But I doubt that it is possible to do seamlessly for user.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28137327
type: Comment

http://stackoverflow.com/q/28134031
has comment: http://stackoverflow.com/comment/44641618
tagged with: css
possible better answer: http://stackoverflow.com/a/28147142
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28146235
has comment: http://stackoverflow.com/comment/44641432
has title: CSS rules not applied if filename is taken from user
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28146235
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44648703
downvote count: 0
tagged with: javascript
score: 1
has body: I am trying to HTML/javascript program that takes in a filename, parses the file and displays its contents in a table. The issue I am facing is that the if I take the filename as a user input via HTML forms, my CSS rules are not applied to the table I create via javascript to display the parsed contents. But if I hard code the filename and then call the javascript function then the CSS rules do get applied. Not sure where I am going wrong. Note : I have gone through other similar question but none of then answer this specific situation. At the end I have given a sample XML data too. One can assume that XML tag names and structure will not vary for different files. Below is the html, javascript and css code HTML file Submit Query javascript code function is_all_ws( nod ){ // Use ECMA-262 Edition 3 String and RegExp features return !(/[^\t\n\r ]/.test(nod.textContent)); } function is_ignorable( nod ){ return ( nod.nodeType == 8) || // A comment node ( (nod.nodeType == 3) && is_all_ws(nod) ); // a text node, all ws } function loadXMLDoc(filename){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else{ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET",filename,false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write(" "); var x=xmlDoc.getElementsByTagName("Row"); for (i=0;i<x.length;i++){ if(i==0) document.write(" "); else document.write(" "); var totalRows = x[i].childNodes.length; for(j=0;j<totalRows;j++){ if(is_ignorable(x[i].childNodes[j])){ /*do nothing*/ } else{ document.write(" "); if(j==(totalRows-2)&&(i!=0)) document.write(" "); else document.write(x[i].childNodes[j].childNodes[0].nodeValue); document.write(" "); } } document.write(" "); } document.write(" "); } CSS file table, th, td {border: 1px solid black;} th, td {padding: 5px;} .topRow{text-align: center; font-weight: bold;} #logo{width: 100px; height: 100px;} Sample XML <Workbook> <Data>Symbol <D…
has answer: http://stackoverflow.com/a/28147142
has comment: http://stackoverflow.com/comment/44640502
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44640871

http://stackoverflow.com/comment/44756122
has text: my web services /async/paas/caaas/downloadCertificate/ return true o false, what want FileDownload?
score: 0
comment on: http://stackoverflow.com/q/28193510
type: Comment
type: QuestionComment

http://stackoverflow.com/a/37011545
downvote count: 0
has comment: http://stackoverflow.com/comment/61575403
type: Answer
upvote count: 1
has body: It is also possible via ReactDOMServer.renderToStaticMarkup: Similar to renderToString, except this doesn't create extra DOM attributes such as data-react-id, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes.
answers question: http://stackoverflow.com/q/28252768
score: 1
has comment: http://stackoverflow.com/comment/61606714

http://stackoverflow.com/comment/44644237
has text: Thanks, touchmove event is triggered, but scrollTop is still 0.
comment on: http://stackoverflow.com/q/28135785
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28218329
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28223349
tagged with: bluebird
linked to: http://stackoverflow.com/q/23650204
answer count: 2
has comment: http://stackoverflow.com/comment/44805605
has body: I'm trying to familiarise myself with Promises and how they work. While it's a new concept to me I'm relatively sure I can understand most of it. In particular I've been looking at the BlueBird library and working my way through the examples. However there's one code snippet on the page that I can't quite wrap my head around. Promise.promisifyAll(needle); var options = {}; var current = Promise.resolve(); Promise.map(URLs, function(URL) { current = current.then(function () { return needle.getAsync(URL, options); }); return current; }).map(function(responseAndBody){ return JSON.parse(responseAndBody[1]); }).then(function (results) { return processAndSaveAllInDB(results); }).then(function(){ console.log('All Needle requests saved'); }).catch(function (e) { console.log(e); }); In this code I understand that the needle library is being promisified. I think I'd be right in saying that current is being set to an empty promise. My question is around the current = current.then(function () { return needle.getAsync(URL, options); }); return current; code. If needle has been promisified, what's the purpose of nesting it within another promise?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28223787
accepted answer: http://stackoverflow.com/a/28223349
has answer: http://stackoverflow.com/a/28223787
has comment: http://stackoverflow.com/comment/44809626
has comment: http://stackoverflow.com/comment/44807481
tagged with: promise
score: 0
has title: What is the purpose of the nested promise in this code?
has comment: http://stackoverflow.com/comment/44805624

http://stackoverflow.com/comment/44896093
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28270146
has text: You have to provide some of your code in order for us to help.

http://stackoverflow.com/q/28183376
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: d3.js
has answer: http://stackoverflow.com/a/31228603
has body: I am trying to get values back from localStorage; multiple click counters in div elements. They were stored on click under key = this.id in localStorage; the values are the innerText of the divs. Now: 1. I filter the selection looking for a match for element-ids in arraylocal 2. if match, set the html. d3.selectAll(".numberCircle").filter((d) -&gt; this.id in arraylocal).html(localStorage.getItem(((d) -&gt; this.id)) I would like to get values ( innerText from elements ) back out of localStorage using 'this.id'. How can I set localStorage.getItem(x????x) to read the proper key/value pair ( where key = this.id ) ? Thus: for each array filter match, I also need the localStorage value that is related to that match.
tagged with: local-storage
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/31228603
score: 0
type: Question
tagged with: javascript
has title: d3 localStorage.getItem() compare arrays .filter()

http://stackoverflow.com/comment/80357150
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225628
has text: Big issue I'm encountering: if a word is longer than the limit size then it's cropped and some parts of that word are lost.
type: AnswerComment

http://stackoverflow.com/comment/44730238
type: AnswerComment
comment on: http://stackoverflow.com/a/28180512
type: Comment
has text: @slime I've never seen the HTML, just pointing out what's wrong with the code in general / addressing the issues that OP has shown.
score: 1

http://stackoverflow.com/comment/44884515
type: AnswerComment
comment on: http://stackoverflow.com/a/28260919
has text: That is a bug in ace, i've updated my answer with a workaround for it
type: Comment
score: 1

http://stackoverflow.com/comment/44729015
comment on: http://stackoverflow.com/q/28179694
type: Comment
has text: If the validation against the setbackArray fails, I want it to move on to the next number. If is succeeds, I want it to do some more work and then move on to the next number. Hence the two separate calls to continue on to the next number.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28242741
downvote count: 3
accepted answer: http://stackoverflow.com/a/28242779
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44847140
has comment: http://stackoverflow.com/comment/44846234
score: -2
has comment: http://stackoverflow.com/comment/44846476
tagged with: javascript
has body: I have tried this code but it does not work in the chrome var myApp = new ActiveXObject("Excel.Application"); myApp.workbooks.open("test.xls");
has title: How to open excel file using Javascript in chrome?
linked to: http://stackoverflow.com/q/7022568
has comment: http://stackoverflow.com/comment/44846316
favorite count: 0
has answer: http://stackoverflow.com/a/28242779
upvote count: 1
possible better answer: http://stackoverflow.com/a/44929439
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5660116
has answer: http://stackoverflow.com/a/44929439

http://stackoverflow.com/q/28136410
downvote count: 0
tagged with: d3.js
possible better answer: http://stackoverflow.com/a/28142340
has answer: http://stackoverflow.com/a/28137229
accepted answer: http://stackoverflow.com/a/28137229
has comment: http://stackoverflow.com/comment/44645226
has answer: http://stackoverflow.com/a/28142340
has title: Reading columns in their order of the csv file
has body: When data is loaded from a csv file, is it possible to get the order of the columns ? E.g. the typical way to load a csv file is by calling the d3.csv function: d3.csv("data.csv", function(error, data) { var ageNames = d3.keys(data[0]).filter(function(key) { return key !== "State"; }); Typically, columns are stored as properties of an object, so the order cannot be retrieved anymore. Also, d3.keys() returns an array with a undefined order. I am asking this because I want to sort the columns by the order in the csv file. Any help would be greatly appreciated.
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/44645205
type: Question
upvote count: 2
answer count: 2
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
score: 2

http://stackoverflow.com/a/28236520
accepted answer of: http://stackoverflow.com/q/28234901
answers question: http://stackoverflow.com/q/28234901
has body: Check this fiddle, is this what you're looking for? I decided to go for a different approach to the one you followed, hope you don't mind. I've commented the code so that it's clearer: var result = { name: "categories", children: [{ "name": "phone", "children": [] }, { "name": "computer", "children": [] }] }; $.each(data, function (index, item) {// Go through data and populate the result object. if (+item.computer &gt; 0) { // Computer has items. filterAndAdd(item, result.children[1], "computer"); } if (+item.phone &gt; 0) { // Phone has items. filterAndAdd(item, result.children[0], "phone"); } }); function filterAndAdd(item, result_place, type) {// Search and populate. var i = -1; $.each(result_place.children, function (index,a) { if( a.name === item.country ) { i = index; return false; } }); if (i &gt; -1) {// Country already exists, add to children array. result_place.children[i].children.push({ "brand": item.brand, "size": item[type] }); } else {// Country doesn't exist, create it. result_place.children.push({ "name": item.country, "children": [{ "brand": item.brand, "size": item[type] }] }); } } Hope it helps.
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/44664636
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28146276
score: 1
has text: Well, because a Promise is an object that represents some data that will be available in the future, like the result of an asynchronous function call. It's not suited for something that may or may not ever arrive, or something that would arrive more than once.

http://stackoverflow.com/q/28275260
has answer: http://stackoverflow.com/a/28275377
has body: I want to rotate an object with .css First click: 180° Second click: back to normal position (+180°) Now i need a function, to detect, if the current click is even or odd ... Tried it with this: $(function() { $(".board-element").find(".category div").click(function() { $(this).parent().parent().find(".board-boards").slideToggle(1000); var clicks = $(this).data('clicks'); if (clicks) { $(this).css("transform", "none"); } else { //first click $(this).css("transform", "rotate(180deg)"); } }); }); It works fine, i klick on the element, the object rotates ... But when i click again, nothing happens ... I hope you can understand my problem, Thanks :)
has title: Jquery custom css on odd / even clicks
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44905383
has answer: http://stackoverflow.com/a/28275321
tagged with: javascript
tagged with: jquery
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28275322
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0

http://stackoverflow.com/q/28253281
score: 1
type: Question
tagged with: ios
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29307211
favorite count: 0
has body: I'm having a strange issue on iOS Safari (yet not in chrome/ff/safari desktop). The $.each jquery method gets skipped (debugger doesn't step into the function), resulting in wrong computations. This is happening intermittedly, only 50% of the time: getActorStatesInternal = function(actor){ var lampIds = hue.getLampIds(actors); var state = window.hue.getState(); var actorStates= []; var actorStatesjQuery= []; if (state.lights !== null) { for(var i in state.lights) { var lamp = state.lights[i]; lamp.key = i; actorStates.push(lamp); } // each fails sometimes on ios safari $.each(state.lights, function(key, lamp) { if (lampIds.indexOf(key) !== -1) { lamp.key = key; actorStatesjQuery.push(lamp); } }); log('ios safari actor count - js ' + actorStates.length + ' jq:' + actorStatesjQuery.length); // console.log: "ios safari actor count - js 3 jq: 0" } return actorStates; },
has title: jQuery $.each issue vs for loop on iOS Safari
has answer: http://stackoverflow.com/a/29307211
tagged with: safari
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/28205489
downvote count: 0
has body: Set your ng-model to the checked property so that it will update if that option is checked or not. Remove ng-checked since ng-model will take care of it. And inorder to access checked item just pass item in the updateRider function expression on ng-change and access it there. i.e: {{ item.text }} and $scope.updateRider = function(item) { //console.log(item.id, item.checked); } Plnkr
type: Answer
accepted answer of: http://stackoverflow.com/q/28205324
answers question: http://stackoverflow.com/q/28205324
upvote count: 2
score: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44818129
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28227036
score: 1
has text: I would treat the whole thing as an item and add a class to the top level specifying state. Something like this: http://jsfiddle.net/zk1j23m5/33/

http://stackoverflow.com/q/28232499
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/r
tagged with: shiny
has answer: http://stackoverflow.com/a/56632937
downvote count: 0
score: 7
favorite count: 0
type: Question
has body: I've read myself through the great tutorial here. However, my knowledge of jQuery equals to zero. I use several tabPanels in my ShinyApp to display my data. The tutorial explains how to track link-clicking events (which works fine, I included a .js as explained in the tutorial). Is there a way to track if users click on a specific tabPanel (for example Panel1 and Panel2)? I've tried to do the same with a link referring to external sources, but that does not work. tabsetPanel( tabPanel("Panel1", showOutput("PlotPanel1", 'dimple')), tabPanel("Panel2", showOutput("PlotPanel2", 'dimple'))) Edit: I guess I have to include some code in my analytics.js file. Therefore I tried several things, but frankly without knowledge of jQuery, this is just wrong. Can anyone help here? $( ".selector" ).tabs({ on('option', 'click', function(l) { ga('send', 'event', 'tabPanel', 'tabPanel', $(l.currentTarget).val()); } }); Thanks.
answer count: 2
upvote count: 7
has answer: http://stackoverflow.com/a/65729329
has title: Shiny tabPanel and Google Analytics
tagged with: google-analytics

http://stackoverflow.com/comment/44771158
type: Comment
type: QuestionComment
has text: The relevant HTML-src is the following ` selectedEntryId` gets the id of a selected Combobox value: ` {{entry.name}} ` The case is that I want to use the selectedEntryId when the create-method successed which is possible with a callback as you can find in the angular documentation.
comment on: http://stackoverflow.com/q/28183375
score: 0

http://stackoverflow.com/a/28125182
score: 1
has comment: http://stackoverflow.com/comment/44624315
has comment: http://stackoverflow.com/comment/44624024
upvote count: 1
type: AcceptedAnswer
has body: if you want to upload files add enctype="multipart/form-data" to the form &lt;form .... enctype="multipart/form-data"&gt; but because you use ajax, you have to set the content header in your request: hr.open("POST",url,true); hr.setRequestHeader("content-type","multipart/form-data; charset=utf-8; boundary=" + Math.random().toString().substr(2)); so just after that proceed to send the request hr.send() and change the submit button line in html to : &lt;input name="uploadfile" type="button" id="uploadfile" value="Upload" onclick="javascript:ajax_upload(); return false;" /&gt;
has comment: http://stackoverflow.com/comment/44623701
has comment: http://stackoverflow.com/comment/44624341
type: Answer
has comment: http://stackoverflow.com/comment/44623743
has comment: http://stackoverflow.com/comment/44624156
downvote count: 0
answers question: http://stackoverflow.com/q/28125120
accepted answer of: http://stackoverflow.com/q/28125120
has comment: http://stackoverflow.com/comment/44623986
has comment: http://stackoverflow.com/comment/44624047

http://stackoverflow.com/a/28158232
has comment: http://stackoverflow.com/comment/44713397
has comment: http://stackoverflow.com/comment/44690237
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/44719907
type: Answer
has comment: http://stackoverflow.com/comment/44724211
accepted answer of: http://stackoverflow.com/q/28157977
has comment: http://stackoverflow.com/comment/44712846
answers question: http://stackoverflow.com/q/28157977
has body: You can add the lines in this way: $(document).on('click', '#addLabel_Item', function () { var $li = $(this).closest('.listed'); $("#list_reference_2").show(); $li.after($("#list_reference_2").clone().removeAttr('id')); $("#list_reference_2").hide(); }); JSFiddle: http://jsfiddle.net/tx7hbkjL/15/ PS: Take a look at your duplicate IDs, like #addLabel_Item. IDs must be unique in the page, use class instead. Give it a try and let me know if it helps!
has comment: http://stackoverflow.com/comment/44717776
has comment: http://stackoverflow.com/comment/44689485

http://stackoverflow.com/q/28224543
linked to: http://stackoverflow.com/q/17384992
tagged with: javascript
has comment: http://stackoverflow.com/comment/44815864
has answer: http://stackoverflow.com/a/28224853
has comment: http://stackoverflow.com/comment/44812905
tagged with: http://stackoverflow.com/tag/html
has body: I would like to add to this chat system a function which should avoid foul language. I already tried to implement the following code: How to block bad words upon form submit But it didn't work for me, and maybe I didn't put it to the right position. The bad words should get changed to a star word before the message before the message is put into the database. Could someone please help me with the code and tell me what I could do? <?php session_start(); if(!isset($_SESSION['username'])){ ?> <?php exit; } ?> Chat Box Globalchat Logged in as: <?php echo $_SESSION['username']; ?> LOADING CHATLOGS PLEASE WAIT... Send EDIT: OK, this is the insert.php script: @Jonathan Kuhn <?php session_start(); $uname = $_SESSION['username']; $msg = $_REQUEST['msg']; $con = mysql_connect("localhost", "--", "--"); mysql_select_db('chat',$con); mysql_query("INSERT INTO logs (`username` , `msg`) VALUES ('$uname','$msg')"); $result1 = mysql_query("SELECT * FROM logs ORDER by id ASC"); while($extract = mysql_fetch_array($result1)){ echo "" . $extract['username'] . ": " . $extract['msg'] . " "; } ?>
downvote count: 1
has comment: http://stackoverflow.com/comment/44835866
favorite count: 0
has comment: http://stackoverflow.com/comment/44812540
upvote count: 0
has comment: http://stackoverflow.com/comment/44835926
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/44812655
has title: How do I add a filter to avoid the using of bad words?
possible better answer: http://stackoverflow.com/a/28224853
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28242406
accepted answer: http://stackoverflow.com/a/28242406
tagged with: mysql
score: -1
has comment: http://stackoverflow.com/comment/44812615
type: Question
has comment: http://stackoverflow.com/comment/44812585
answer count: 2

http://stackoverflow.com/comment/44845200
comment on: http://stackoverflow.com/q/28242100
has text: $("body").append(" ").append(" ");
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28146402
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44668847
tagged with: ajax
has title: PHP echo functions not working in php page loaded dynamically with jQuery .load
has body: Here is the index.php and desktop.php of my wordpress installation. I'm loading desktop.php into #tLoad if browser window width is larger than 800px. So far so good. But I want to load it with a php echo. And in the desktop.php I want to use etc, but it's not working either. I get an error that says "Fatal error: Call to undefined function.." and so on. I understand that I probably have to use AJAX calls of some kind, but I can't figure it out.. How can I make the php functions work inside the script and desktop.php? &lt;?php /* Template Name: Start */ ?&gt; &lt;?php get_header(); ?&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { function o() { if (ww &gt; 800) { if ($.browser.device == false) { e.load(n); } else { e.load(r); } } else if (ww &lt; 800) { e.load(r); } } isHome = true; var e = $("#tLoad"), // This is the first php echo that's not working (I have to put in the direct url to make it work): n = "&lt;?php echo get_template_directory_uri(); ?&gt;/desktop.php", r = "&lt;?php echo get_template_directory_uri(); ?&gt;/mobile_v.php"; $(window).resize(function() { ww = win.width(); o() }); o() }); &lt;/script&gt; &lt;div id="tLoad"&gt;&lt;/div&gt; &lt;?php get_footer(); ?&gt; desktop.php: &lt;?php the_content(); ?&gt;
has comment: http://stackoverflow.com/comment/44664667
tagged with: php
has comment: http://stackoverflow.com/comment/44666429
type: UnansweredQuestion
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/44664475
has answer: http://stackoverflow.com/a/28146529

http://stackoverflow.com/comment/44895229
type: QuestionComment
score: 0
has text: figured out a way, here's what I did: <asp:CheckBox ID="cb" runat="server" onclick=<%# "myCheckChanged('" + DataBinder.Eval(Container, "myid") + "') "%> />
type: Comment
comment on: http://stackoverflow.com/q/28269587

http://stackoverflow.com/q/28196808
accepted answer: http://stackoverflow.com/a/28197058
has title: Display sql database on webpage
tagged with: java
has comment: http://stackoverflow.com/comment/44760398
type: Question
downvote count: 4
upvote count: 0
tagged with: javascript
has body: <%-- Document : CheckRetrieve1 Created on : Jan 26, 2015, 12:50:28 PM Author : Dell --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page language="java"%> <%@page import="java.sql.Connection"%> <%@page import="java.sql.DriverManager" %> <%@page import="java.sql.ResultSet" %> <%@page import="java.sql.Statement" %> <%@page import="java.io.IOException" %> STAFF Website Teaching Staff <% try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Connection con = DriverManager.getConnection( "jdbc:odbc:Kam", "", ""); Statement statement = con.createStatement() ; ResultSet resultset = statement.executeQuery("select * from extcteach") ; } catch(Exception e) { e.printStackTrace(); } %> I m trying to make a website using Java. sql database in which there is a particular table which i want to display on my website. Bt then wen i run it.. it displays "TODO WRITE CONTENT".I found things related to connectivity bt it is not working. Please HELP :)
has comment: http://stackoverflow.com/comment/44760188
tagged with: sql
has answer: http://stackoverflow.com/a/28197058
answer count: 1
favorite count: 0
score: -4
type: AnsweredQuestion

http://stackoverflow.com/comment/44756056
has text: Thanks a lot for the amazing job! Last issue is that I get "TypeError: checkboxes[gmarkers[i].nom] is undefined" upon ticking/unticking the checkboxes. (I applied your code to my web page at http://ethometrics.proethica.ch/carte)
type: Comment
comment on: http://stackoverflow.com/a/28185577
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44840144
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28237036
score: 0
has text: My original answer wasn't great. I've rewritten it.

http://stackoverflow.com/comment/44780915
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28207913
has text: Which value you want to get, the selected value?

http://stackoverflow.com/q/28218048
has answer: http://stackoverflow.com/a/28241298
tagged with: internet-explorer-8
has comment: http://stackoverflow.com/comment/44800879
has body: I am making call to a REST service from my AngularJS app using $http. The issue is whenever I make a GET request from IE8, it gets converted to POST request. Calls with other http methods (POST,PUT) work fine. This happens only with IE8. Here is my code ``` var request = {method: method, url: url, data: payload}; var promise = $http(request) .then(function (response) { return response; }); ``` Can someone please help. I have tried sending different types off data payload : null,undefined,empty object, some object. But nothing worked.
type: AnsweredQuestion
has title: IE8 changing GET request to POST: Angular $http
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28241298
has comment: http://stackoverflow.com/comment/44817308
type: Question
tagged with: xmlhttprequest
tagged with: angularjs
score: 0
answer count: 1
tagged with: http

http://stackoverflow.com/a/28259955
has comment: http://stackoverflow.com/comment/44900210
has comment: http://stackoverflow.com/comment/44885247
has comment: http://stackoverflow.com/comment/44919021
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44877872
has comment: http://stackoverflow.com/comment/44877827
type: Answer
has body: I did it in Python, hope this helps you out: Index = [2,1,0] Files = [[1,2,3],[[1,2],3], [[1,2,3,4,5],[[[1,2],[1,2,3,4,5]],[1,2,3]]]] new_array = [] for i in range(len(Index)): new_array = Files[Index[i]] Files = new_array print Files [[1, 2], [1, 2, 3, 4, 5]] What this essentially does is for each stage of the index array, reduces the dimension of the Files array until you've found the final element of Files. Not sure that makes sense, let me know if I need to clarify.
accepted answer of: http://stackoverflow.com/q/28259917
upvote count: 1
answers question: http://stackoverflow.com/q/28259917

http://stackoverflow.com/comment/44907190
type: Comment
comment on: http://stackoverflow.com/a/28275635
score: 0
type: AnswerComment
has text: This works on 1.2.x version, on 1.3 & 1.4 it doesn't

http://stackoverflow.com/comment/44685433
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28156249
has text: @user3345367 first of all you need to define the window width in the scroll function since it will change when you resize, right now it is defined on doc ready and never updates

http://stackoverflow.com/q/28141753
downvote count: 0
accepted answer: http://stackoverflow.com/a/28141789
tagged with: jquery
favorite count: 0
tagged with: css
has body: I'm using Twitter Bootstrap 3 and have a DIV containing a picture or video. the div is col-sm-3, but using a jQuery I switch that class with a col-sm-12 on hover. Is there any way to make a smoother transition and add some effects when the resize happens? Thanks.
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
upvote count: 3
tagged with: css-transitions
type: Question
has answer: http://stackoverflow.com/a/28141789
score: 3
has answer: http://stackoverflow.com/a/28141778
has title: Transition when switching classes in Twitter Bootstrap 3
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28141778
answer count: 2

http://stackoverflow.com/comment/44638394
comment on: http://stackoverflow.com/a/28132744
type: Comment
has text: https://github.com/nick-jonas/nick-jonas.github.com/tree/master/windows tags seem to be assumed but I don't see why it wouldn't work with a
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44924439
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28253536
has text: still don't see it. Either way, it's just a good habit to get into before asking a question so as much of your specific problem is reproducible to people who aren't at your desk.
score: 0

http://stackoverflow.com/q/28268389
tagged with: web-worker
downvote count: 0
favorite count: 0
has title: SharedWorker loading race condition
type: UnansweredQuestion
has body: I think I may have a misunderstanding in how shared web workers behave, but I cannot find anything in the spec or MDN (etc) which clarifies. A test case: HTML: Simple Worker Test worker.js: onconnect = function( e ) { var port = e.ports[0]; port.onmessage = function( e ) { port.postMessage( 'echo: ' + e.data ); }; }; When I run that (in Chrome 40) and refresh the page a few times, usually I see "echo: ping" in the console (and later "echo: pong"), but about a third of the time I see neither. It feels like a race condition to me, but I was under the impression that postMessage (and port.start) would queue requests until the worker is ready (i.e. loaded and run). I don't see this issue when using non-shared workers. Update: if I wrap the whole thing in a setTimeout(...,100) instead of (or as well as) a load listener, it works every time. If I use 50ms instead of 100, it works almost every time. So that's a possible, but very unreliable workaround. Did I miss something? Should I be waiting for an event of some type before setting up the port?
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44904057
tagged with: javascript

http://stackoverflow.com/a/28234453
answers question: http://stackoverflow.com/q/28234427
score: 0
type: Answer
has body: It's better to read some online tutorials, or books Anyway Use something like below will solve your problem if(Qty&gt; 1) { var TotPrice = Qty * UnitPrice; } else { Totprice = ""; }

http://stackoverflow.com/q/28238155
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28239828
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28239828
has body: I have a nested viewmodel setup that need to be expressed as functions due to having to have instances (unless I am missing something). Everything works in the UI, I can nest viewmodels that have nested viewmodels and so on. However in its current form I get an error JavaScript runtime error: Pass a function that returns the value of the ko.computed when trying to call ko.toJSON(x);. This worked when I had the vms defined without the need for instances however my nesting did not hence the change. Here is an example of how it is currently. var CityViewModel = function() { var self = this; self.Name = ko.observable(""); self.ATMs = ko.observableArray(); self.AddATM = function () { self.ATMs.push(new ATMViewModel); } self.GetJson = function() { alert(ko.toJSON(self)); //Area of interest } } var ATMViewModel = function() { var self = this; self.PostCode = ko.observable(""); self.Features = ko.observableArray(); self.AddFeature = function () { self.Features.push(new FeaturesViewModel()); } } var FeaturesViewModel = function () { var self = this; self.Name = ko.observable(""); self.Reference = ko.observable(""); } ko.applyBindings(CityViewModel);
has title: Function based view models not converting to JSON
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js

http://stackoverflow.com/a/28254724
type: AcceptedAnswer
type: Answer
has body: I worked out what I was missing. I needed the schema setting to have the parse attribute point to the second element of the result, which is the list. Below is the complete code for the autocomplete: $('#search').kendoAutoComplete({ minLength: 3, filter: "startswith", placeholder: "Search ...", suggest: true, select: function (e) { $('#btnSearch').trigger('click'); }, dataSource: new kendo.data.DataSource({ serverFiltering: true, transport: { read: { url: "https://suggestqueries.google.com/complete/search?client=firefox", data: onAdditionalData, type: "get", dataType: "jsonp", } }, schema: { parse: function(data) { return data[1]; } } }) }); You can see it working correctly at https://www.headlineintime.com:
answers question: http://stackoverflow.com/q/28220702
score: 0
accepted answer of: http://stackoverflow.com/q/28220702

http://stackoverflow.com/comment/44651095
type: Comment
has text: what does it need to do? why do you say "blurRad: 10"?
comment on: http://stackoverflow.com/q/28139690
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44691952
comment on: http://stackoverflow.com/q/28160147
type: Comment
type: QuestionComment
has text: `those which I create with "var" and which die at the end of the function, because they become garbage` That isn't true; GC is about object, not variables. If they don't hold objects, they don't touch the GC; if they do, you need to be concerned about object lifetime. (holding it longer won't help you)
score: 0

http://stackoverflow.com/q/28156886
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has title: Understanding control flow in Node.js applications
has body: I am trying to understand control flow in Node.js applications. Specifically does control returns to the original function once callback method completes (like a callback stack in recursive calls). I wrote a simple program that make a GET call and return the data. Here is the program: Code: var async = require('async'); var http = require('http'); function getGoogleData(url, callback) { http.get(url, function(response) { if (response.statusCode == 200) { var googleInfo = ''; response.on('data', function(chunk) { console.log("receiving data... "); googleInfo += chunk; return; }); response.on('end', function() { console.log("End of data receive... "); response.setEncoding('utf8'); return callback(null, googleInfo); }); } console.log("I am here but why!"); //callback(new Error("GET called failed status_code=" + response.statusCode)); }); console.log("Return from get google data"); } async.waterfall([ function(callback) { console.log("In func 1"); getGoogleData("http://www.google.com", callback); }, function(data, callback) { console.log("In func 2"); callback(data); }], function (err, res) { console.log("In err fn"); }); Here is output of the program: Output: In func 1 Return from get google data I am here but why! receiving data... receiving data... End of data receive... In func 2 In err fn Can someone help me understand why 'I am here but why!' line gets printed as the second output line in console log even after returning from 'data' event emitter? What is the overall control flow here?
tagged with: javascript
has answer: http://stackoverflow.com/a/28156978
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28156978
favorite count: 0
has comment: http://stackoverflow.com/comment/44685228
tagged with: node.js

http://stackoverflow.com/comment/44618266
type: Comment
type: QuestionComment
has text: The usual reason for this type of code not to work is when you're trying to run the code BEFORE the DOM has loaded and thus when it runs it doesn't find any DOM elements to operate on. Where is the script run? Is it in the ` ` section? Also, please explain EXACTLY what happens. "Doesn't work properly" is not an exact description of what happens, what errors show in the console, etc...
score: 2
comment on: http://stackoverflow.com/q/28122118

http://stackoverflow.com/comment/44833698
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28217153
type: QuestionComment
has text: Yup, but `Uglify` should be able to take care of that...

http://stackoverflow.com/comment/44720595
type: Comment
type: QuestionComment
has text: In the options...Big white textbox that reads: `predefine global variables here`
comment on: http://stackoverflow.com/q/28174698
score: 0

http://stackoverflow.com/a/60261810
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28140705
has body: In your script file: $("select").each(function(i,v){ var that = $(this); var placeholder = $(that).attr("data-placeholder"); $(that).select2({ placeholder:placeholder }); }); in your html (add data-placeholder="Your text"): Value A Value B
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44643828
type: AnswerComment
has text: @Roy—that just assigns a function to *a.x*. Until you call it (i.e. `a.x()`), the value of *A.prototype.u* won't change.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28123613

http://stackoverflow.com/a/28161886
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28160901
accepted answer of: http://stackoverflow.com/q/28160901
type: AcceptedAnswer
downvote count: 0
has body: You could try something like this. var selectOne = document.getElementById('selectElement1'), selectTwo = document.getElementById('selectElement2'), //set up options (key is equal to the value of the option in selectElement1) optsList = { 1: ['option_2_1', 'option_2_2', 'option_2_3', 'option_2_4'], 2: ['option_2_5', 'option_2_6', 'option_2_7', 'option_2_8'], 3: ['option_2_9', 'option_2_10', 'option_2_11', 'option_2_12'] }; //add an event listener for the onchange event selectOne.onchange = function (e) { var selectedOpt = this[e.target.selectedIndex], optListSet = optsList[selectedOpt.value] || 0; //disable all options. for(var i=0; i &lt; selectTwo.length; i++){ selectTwo[i].disabled = "disabled"; } //reset selected option selectTwo.children[0].selected = "selected"; //loop through the options set corresponding to the value of the selected option if(optListSet){ for (var i = 0; i &lt; optListSet.length; i++) { opt = document.getElementById(optListSet[i]); opt.disabled = false; } } //enable options list 2 selectTwo.disabled = false; }; Here's the jsfiddle

http://stackoverflow.com/comment/44739709
comment on: http://stackoverflow.com/q/28185165
type: QuestionComment
has text: Similar but a little bit different question as this one:http://stackoverflow.com/questions/28082430/d3-js-translating-multiple-labels-without-rotation maybe you should do special translate for the text
type: Comment
score: 0

http://stackoverflow.com/comment/44687050
comment on: http://stackoverflow.com/q/28157437
type: QuestionComment
has text: I think that since you are not stopping your setInterval, then all you need to do is reset counter variable to 30 secs and the rest will take care of itself. I should however mention two things: You realy shouldn't place variables on the global scope, and you should really stop your setInterval when you are finished with it, and start it again when you need to.
score: 1
type: Comment

http://stackoverflow.com/a/28259465
upvote count: 1
answers question: http://stackoverflow.com/q/28259422
type: AcceptedAnswer
downvote count: 0
has body: Try simply this way to sent your data variable(cat) using GET Method var cat=2; $(function(){ $.ajax({ url:"DbManipulate.php", type:"GET", data:{actionfunction:showData,cat:cat}, cache: false, success: function(response){ console.log(response); $('#demoajax').html(response); createInput(); } }); // in DbManipulate.php, try to catch cat using $_GET like this $cat=$_GET['cat']; //do further processing EDIT cat=2; url="DbManipulate.php"; function yourFunc(cat,url){ $.ajax({ type: "GET", url: url+'?q='+cat, dataType: "json", cache: false, success: function (response) { $('#demoajax').html(response); createInput(); } }); } //in DbManipulate.php $cat=$_GET['q']; More Info:http://api.jquery.com/jquery.ajax/
type: Answer
accepted answer of: http://stackoverflow.com/q/28259422
score: 1

http://stackoverflow.com/a/28220426
downvote count: 1
has body: You may make your life easier by using Moment JS. It is hard to do math with dates, times and years in code. Some months have more days than others as well as some years. (Hello Leap Year) I created a solution that worked on time and there are several issues that I noticed. You can’t subtract the full date the way you have because when you move from one moth to the other you will be subtracting a smaller number from a larger one. And so you end up with a negative number. The same thing happens with the end of the year. You may want to console log some of you variables to be sure you are getting what you are expecting. That’s just based off what I see.
score: -1
answers question: http://stackoverflow.com/q/28218999
upvote count: 0
type: Answer

http://stackoverflow.com/a/28166378
has comment: http://stackoverflow.com/comment/44703859
has comment: http://stackoverflow.com/comment/44704048
score: -1
has comment: http://stackoverflow.com/comment/44704497
has body: You can use attribute of the element: function Myfunc() { var newdiv = document.getElementById('newDiv'); var i = newdiv.getAttribute('ind'); if(i === null) { i = 0; } else { i = parseInt(i, 10); } var el = document.createElement('div'); var dynamicClass = "x" + i; i++; newdiv.setAttribute('ind', i); el.setAttribute('class', dynamicClass); newdiv.appendChild(el); } a... b... c...
downvote count: 1
answers question: http://stackoverflow.com/q/28166096
has comment: http://stackoverflow.com/comment/44704353
type: Answer
has comment: http://stackoverflow.com/comment/44703563
upvote count: 0

http://stackoverflow.com/q/28171365
has answer: http://stackoverflow.com/a/28171625
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44712499
tagged with: selenium
tagged with: google-chrome
type: Question
tagged with: c#
has body: I am running my test in Visual Studio 10, with C# and Selenium. There is a moment that Im landing on a page and I need to check some elements of the page, but its like "loading" continuously so its impossible to find this elements, cause are changing. The only way to find them is in Chrome Settings, Disable JavaScript and perfect it works. But how I disable Javascript with selenium in the same page, without call a new one? Just refreshing or smthg. Thx!!! ElBandido
tagged with: javascript
tagged with: visual-studio-2010
score: 0
has title: Disable JavaScript in Chrome with rendered page with C# & Selenium WebDriver
answer count: 1
linked to: http://stackoverflow.com/q/27099250

http://stackoverflow.com/comment/44623957
has text: You can use ng-repeat-start to output a different elements in the same repeat, but I don't think that will fit your requirements for this. You could use a wrapper with the ng-repeat on it, inside each column - but that would be two repeats and introduce the extra markup. To get exactly what you want, I think you need to write a directive.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28125161
type: QuestionComment

http://stackoverflow.com/q/28128803
tagged with: django
has title: Modify a "has-many through" table with Django REST framework + Backbone.js
type: Question
tagged with: javascript
upvote count: 2
tagged with: django-rest-framework
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
tagged with: python
has body: This is kind of long and multi-part. In Django: I have a comic book Issue model and an Ownership model that has foreign key relations to both Issue and User. I want to allow a user ("owner") to be able to add an issue to their collection with one of three statuses: "Have," "Want," or "Sell." I've been advised that for the sake of a clean API, I should stick with the endpoint associated with the Issue and not create a new Ownership endpoint. That means that in Backbone, I'd have an edit action on the Issue that actually just adds or edits an Ownership item in Django. BTW, I don't want to allow editing the actual Issue model via the API at all yet. Here's my OwnershipSerializer: class OwnershipSerializer(serializers.ModelSerializer): class Meta: model = Ownership fields = ('owner', 'status') Here's the relevant parts of my IssueSerializer: class IssueSerializer(serializers.ModelSerializer): ... owners = OwnershipSerializer(source='ownership_set', many=True) class Meta: model = Issue fields = (..., 'owners') I assume I'll have to go by the documentation for writable nested representations, but I'm not certain how to proceed. Here's some pseudocode I've written. This will be part of the IssueSerializer: def update(self, instance, validated_data): ''' What should happen: - If an existing ownership exists for the current user, update its `status` with this request. - If there's not an existing ownership for this user, create a new one. The only data we're looking for is `status`: - Issue is already set. - User/Owner is the currently logged in user. ''' # owner = self.request.user # try: ownership = instance.ownership # (check for existing ownership for this user) # instance.status = validated_data.get('status', instance.status) # instance.save() # return instance # except: # (no existing ownership for this user) # Ownership.objects.create(owner=owner, validated_data) # return issue pass In Backbone.js: What I'd like to end up with is updating status directly on an issue. …
score: 2
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/44821692
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28218380
has text: but still i did not get any output.
type: AnswerComment

http://stackoverflow.com/comment/44800171
has text: @paka I don't like it because the code that should be executed (`$scope.showCharts()`) isn't linked to what really is going on in the website. If someone changes the `CSS` transition durations, the controller timeout won't work anymore. This seems rather unclean to me. In other words, some link exists between CSS styling and the JS code that is really easy to miss. Maybe I try with the `transitionend` event. Thanks for the input so far.
comment on: http://stackoverflow.com/q/28217448
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44741238
type: QuestionComment
type: Comment
score: 0
has text: Try just rebinding the jquery when you added more html. So when you page appends new html you call a rebind function that would rebind the jquery to the current html.
comment on: http://stackoverflow.com/q/28186308

http://stackoverflow.com/q/28209677
possible better answer: http://stackoverflow.com/a/28210476
downvote count: 0
type: Question
has title: Sails js Error in file Upload
tagged with: sails.js
has answer: http://stackoverflow.com/a/28604900
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28604900
tagged with: jquery
upvote count: 2
answer count: 2
has body: I have a form which have a input type file with name "uploadfile". No error occurs while a file is selected and form is submitted. But having this error while I don't select a file and submit the form. ` if(req.file('uploadfile')._files.length&gt;0){ var ques_file = req.file('uploadfile'); console.log('here'); ques_file.upload({ saveAs: function(file, cb) { cb(null, file.filename); }, dirname: dirPath },function (err, files) { if (err){ return res.serverError(err); }else{ name =files[0].filename; filename=name; console.log("file : "+filename); } }); ` And in commad having this error events.js:72 throw er; // Unhandled 'error' event ^ Error: ETIMEOUT: An Upstream (`NOOP_ques_uploadfile`) timed out waiting for file(s). No files were sent after waiting 10000ms. at null.&lt;anonymous&gt; (C:\xampp\htdocs\kucbt_admin\node_modules\sails\node_modules\skipper\standalone\Upstream\Upstream.js:62:15) at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
favorite count: 0
has answer: http://stackoverflow.com/a/28210476
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/44682290
type: Comment
has text: I just tried your code on a chrome console and it did what you are asking for
score: 0
comment on: http://stackoverflow.com/q/28155421
type: QuestionComment

http://stackoverflow.com/comment/44625859
comment on: http://stackoverflow.com/a/28126147
has text: could you print or show an screenshot of the generated JS? also what console errors do you have?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28219978
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28219474
answers question: http://stackoverflow.com/q/28219474
has comment: http://stackoverflow.com/comment/44806493
type: Answer
has body: I think your logic is not quite right. This line $(this).val($(this).val().replace(/[^A-Za-z $]/g, '')) Will replace all non-latin characters with '' (i.e. no character). But you do this before you test for that condition and try to alert the user. Then this line var regex = new RegExp("[^a-zA-Z]+$"); is supposed to match non-latin characters in the whole word I think, but will only match if there is a non-latin character directly before the end of word (denoted by the $ symbol). It will never match, though, because you've already removed all the non-latin characters. I think you would be better to try the following, I'm assuming your intention is to alert on the string and then remove the invalid characters: $(document).ready(function() { $('#Demo').bind('keyup blur', function() { if($(this).val().match(/[^A-Za-z ]/g)){ // Pop alert alert('Invalid Character usage. Please Use English characters only.'); //Replace all the invalid characters with empty string $(this).val($(this).val().replace(/[^A-Za-z ]/g, '')) return false; } }); }); Example on JS Fiddle: http://jsfiddle.net/ozeu91yg/6/ You might want to play around with other characters, too - for instance I've kept your original form of the RegEx which allows spaces. Do you want to also allow hyphens? All whitespace? and so on. Play around - anything within the [] brackets will be allowed. EDIT Just discovered this is a duplicate question, too - see JavaScript Regex (string should include only alpha, space, hyphen) for instance...
score: 0

http://stackoverflow.com/comment/44663842
score: 1
comment on: http://stackoverflow.com/q/28144615
type: Comment
type: QuestionComment
has text: it all depends where they include your script. you can specify that someone puts your tag above all the other jquery stuff so that any conflicts get overwritten, or the other way around if you want yours to take precedence

http://stackoverflow.com/q/28212129
has answer: http://stackoverflow.com/a/29229315
has body: I'm using the Google Maps Store Locator library, but I want to be able to implement MarkerClusterer alongside it. However, I haven't been able to figure out how to make them work together. Code: (function($, window, document){ var map = null, cluster = null; function storeSource() { $.extend(this, new storeLocator.StaticDataFeed); var that = this; $.getJSON('linktoAJAXThatReturnsJSON', function(data) { that.setStores(that.parse_(data)); map.fitBounds(centerMap(data)); }); } storeSource.prototype.parse_ = function(data) { var stores = []; data.forEach(function(row){ var position = new google.maps.LatLng(row.lat, row.long), locality = row.postcode + ', ' + row.city, store = new storeLocator.Store(row.id, position, null, { title : row.name, address : [row.address, locality, row.country].join('&lt;br&gt;'), phone : row.phone }); stores.push(store); }); return stores; }; // Clusters Markers together function makeCluster(data) { var markers = []; data.forEach(function(row){ markers.push(row.getMarker()); }); cluster = new MarkerClusterer(map, markers, {}); } // Finds viewpoint that accomodates all locations function centerMap(data) { var bounds = new google.maps.LatLngBounds(); data.forEach(function(row){ bounds.extend(new google.maps.LatLng(row.lat, row.long)); }); return bounds; } google.maps.event.addDomListener(window, 'load', function() { map = new google.maps.Map(document.getElementById('mappanel'), { mapTypeId : google.maps.MapTypeId.ROADMAP }); var data = new storeSource(); var view = new storeLocator.View(map, data, { geolocation: false }); new storeLocator.Panel(document.getElementById('searchpanel'), { view: view }); // I think this is the place to try and add the Markers // from storeSource. However, debugging shows Markers haven't // been created yet. This leads me to believe that it's done // internally in the storeLocator library. Not sure what to do makeCluster(view.data_.stores_); }); $(document).on('click', '.action', function(e){ e.preventDefault(); });…
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29229315
tagged with: google-maps-api-3
type: AnsweredQuestion
type: Question
has title: Google Maps Store Locator Library with MarkerClusterer
answer count: 2
has answer: http://stackoverflow.com/a/29364434
score: 0
tagged with: markerclusterer
accepted answer: http://stackoverflow.com/a/29364434

http://stackoverflow.com/a/28176432
has comment: http://stackoverflow.com/comment/44722773
accepted answer of: http://stackoverflow.com/q/28176378
answers question: http://stackoverflow.com/q/28176378
has comment: http://stackoverflow.com/comment/44722234
has comment: http://stackoverflow.com/comment/44722203
has comment: http://stackoverflow.com/comment/44722942
has comment: http://stackoverflow.com/comment/44723567
has comment: http://stackoverflow.com/comment/44722605
has comment: http://stackoverflow.com/comment/44722130
has comment: http://stackoverflow.com/comment/44722459
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44723017
has body: If you want to fire on every image then you'll need to use the image class in fancybox. i.e. $(document).ready(function() { $(".fancybox").fancybox({ openEffect : 'none', closeEffect : 'none' }); }); There is no class of .photos in the code you have provided. should this have been on the individual image? Rather then inject every image one at a time, do them all in one go: $(document).ready(function (){ var cont = 1, images = ''; while(cont &lt; 879){ images += "&lt;a class='fancybox' rel='gallery1' href='fotos/big/festa_"+ cont +".jpg' title='Festa Vegas'&gt;&lt;img src='fotos/festa_"+ cont +".jpg' alt='' /&gt;&lt;/a&gt;" cont++ } $("#fotos").append(images); }); This will improve the loading times
has comment: http://stackoverflow.com/comment/44722289
has comment: http://stackoverflow.com/comment/44723137
score: 0
has comment: http://stackoverflow.com/comment/44723350
type: Answer

http://stackoverflow.com/comment/44847570
type: QuestionComment
has text: __don't play background music especially not on autoplay__
comment on: http://stackoverflow.com/q/28243385
score: 0
type: Comment

http://stackoverflow.com/q/28235554
has title: Javascript generated HTML code calling knockout
tagged with: knockout.js
accepted answer: http://stackoverflow.com/a/28235703
has comment: http://stackoverflow.com/comment/44833213
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44832744
has comment: http://stackoverflow.com/comment/44892430
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28235703
has body: Not sure if this is possible but here it goes. I have an app with two main files - a javascript file and an HTML file and i'm using knockout.js, bootstrap and jquery. Within a function in the js file, I generate an html form. I can't have the form in the html file as invisible - it has to be generated within the js file. The problem is, I render buttons on the form which call knockout functions which are in the js file but they just don't work. I can reference these buttons using javascipt but this doesn't work as I need to pass the knockout model to the form. Code is as follows: Within the js file: self.helloFunction = function () { alert("Hello World"); } Within the html file (which works as expected): &lt;div&gt; &lt;input type="image" src="/Images/Buttons/edit.png" data-bind="click: $root.helloFunction" class="input-sm"&gt; &lt;/div&gt; Within the JS file (which won't make the call back to helloFunction): var helloWorld = '&lt;div&gt;' + '&lt;input type="image" src="/Images/Buttons/edit.png" data-bind="click: '$root.helloFunction" title="Hi" class="input-sm"&gt;' + '&lt;/div&gt;'; //display the html on the page: displayForm(helloWorld); It displays well, the title and image show, the bootstrap formatting is applied....it's just the knockout call (to helloWorld) that doesn't respond. Is it possible going back and calling my knockout function?
tagged with: twitter-bootstrap
score: 0
type: Question

http://stackoverflow.com/comment/44785127
has text: LG device, android version 4.4.2
comment on: http://stackoverflow.com/q/28204004
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28132966
has comment: http://stackoverflow.com/comment/44638684
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28133654
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44638596
has title: Why are chrome textareas sizing themselves two columns more to fit a possible scrollbar when overflow:hidden and resize:none?
has body: I want chrome to size my textarea exactly as many columns as I specify. Not an extra two. Firefox and IE are kind enough to make my textarea as many 'cols' as I specify when the scrollbars are turned off with styles "overflow:hidden" and "resize:none". Why can't chrome do the same? Is there a css styling that chrome obeys to fix this? If it can't be fixed, how can I test in javascript whether textareas are rendering N + 2 columns wide when its 'cols' attribute is set to 'N' in the markup? try this: 1234567890 http://jsfiddle.net/o7p31sob/
has answer: http://stackoverflow.com/a/28133457
upvote count: 1
tagged with: google-chrome
type: Question

http://stackoverflow.com/comment/44867924
type: Comment
has text: http://jsfiddle.net/bLcszctz/3/
type: QuestionComment
comment on: http://stackoverflow.com/q/28254593
score: 0

http://stackoverflow.com/comment/44730481
type: Comment
has text: @AlexanderO'Mara It is built on the bootstrap framework, or are you looking for the HTML structure of the specified sections exactly of which I am moving around with the function?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28179950

http://stackoverflow.com/a/28260746
has comment: http://stackoverflow.com/comment/44879042
has comment: http://stackoverflow.com/comment/44879147
has comment: http://stackoverflow.com/comment/44878809
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/44879675
upvote count: 6
has comment: http://stackoverflow.com/comment/44879239
has comment: http://stackoverflow.com/comment/134335030
downvote count: 1
has comment: http://stackoverflow.com/comment/44879198
accepted answer of: http://stackoverflow.com/q/28260659
answers question: http://stackoverflow.com/q/28260659
has comment: http://stackoverflow.com/comment/44878838
has body: If you enable multi-line mode, m, for your regular expressions, you can match empty lines, ^$, and count how many matches have been found. Note that [ \t]* will match zero or more spaces or tabs. function count_lines(text){ return text ? (text.match(/^[ \t]*$/gm) || []).length : 0; } This should be really fast since no post-processing after the regular expression is necessary. See Regex101 for a demo with annotations.
has comment: http://stackoverflow.com/comment/44878998
has comment: http://stackoverflow.com/comment/44878961
has comment: http://stackoverflow.com/comment/44879064
type: AcceptedAnswer

http://stackoverflow.com/q/28233410
tagged with: local-storage
type: Question
score: 1
accepted answer: http://stackoverflow.com/a/28233544
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44829797
tagged with: http://stackoverflow.com/tag/html
has body: i want to perform an automatic login function. i've got the script that does save email and password on the localstorage for the first time a user logs in and also displays the email and password the subseqents times the user opens the app in their respective textfields (email and password) $(function() { var $email = $('#email'), $password = $('#password'); // SAVE VARIABLES TO LOCAL STORAGE $('form').on('submit', function() { localStorage.setItem("eaddress", $email.val()); localStorage.setItem("pwd", $password.val()); }); // IF EMAIL AND PASSWORD ARE SAVED, PREPOPULATE THE FORM FIELDS if (localStorage.getItem("eaddress") != null) { $email.val(localStorage.getItem("eaddress")); } if (localStorage.getItem("pwd") != null) { $password.val(localStorage.getItem("pwd")); } }); MY HTML &lt;form action="login_script.asp" method="post" name="form5" target="_parent" id="form5" onclick="save()" &gt; &lt;table width="270" border="0" cellpadding="4" cellspacing="4"&gt; &lt;tr&gt; &lt;td&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;input name="email" type="email" id="email" size="40"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;input name="password" type="password" id="password" size="40"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp; &lt;input type="submit" id="submit" name="submit" value="Submit"&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="width: 480px; margin: 0 auto; margin-top: 30px;"&gt;&lt;img src="imgs/loader.gif" alt="" name="gif" id="gif" style="display: block; margin: 0 auto; width: 30px; visibility: hidden;" /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; $('#form5').submit(function() { $('#gif').css('visibility', 'visible'); return true; }); &lt;/script&gt; Now what i want to achieve is there should be an automatic submission once t…
has comment: http://stackoverflow.com/comment/44830115
has title: Automatic form submission if textfield or localstorage contains data
has answer: http://stackoverflow.com/a/28233544
type: AnsweredQuestion
upvote count: 1

http://stackoverflow.com/comment/94941080
has text: Tutorials on the two techniques are here: https://rednoise.org/rita/tutorial/grammars.php and here: https://rednoise.org/rita/tutorial/ngrams.php
type: Comment
comment on: http://stackoverflow.com/a/28179011
score: 0
type: AnswerComment

http://stackoverflow.com/a/28262646
has body: Use document.getElementById('msg-display').innerHTML instead of .innerText and textContent.
answers question: http://stackoverflow.com/q/28262563
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44882234

http://stackoverflow.com/comment/44737756
has text: Separate issue, your script tag should be this: ` ` without the `javascript"` in it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28184342

http://stackoverflow.com/comment/44645041
type: Comment
type: QuestionComment
has text: Did you add jQuery and Bootstrap's JavaScript library?
score: 0
comment on: http://stackoverflow.com/q/28136347

http://stackoverflow.com/comment/44777340
score: 1
has text: You should include in your question a sample of how you would like the graph to look and perhaps a sample of your code so that users can try to find a solution for you question.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28203689

http://stackoverflow.com/comment/44761863
type: QuestionComment
has text: I'm sure there is, it would just require editing a lot more JS code. Lemme see what I can do.
score: 0
comment on: http://stackoverflow.com/q/28197356
type: Comment

http://stackoverflow.com/comment/56634636
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/32489053
has text: Search for `The Shard, London Bridge Street, London, United Kingdom` :(

http://stackoverflow.com/comment/44867685
score: 0
type: AnswerComment
has text: Thank you so much, that has been bugging me for ages!
comment on: http://stackoverflow.com/a/28254091
type: Comment

http://stackoverflow.com/q/28198793
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28199095
has comment: http://stackoverflow.com/comment/44764142
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/28198857
downvote count: 0
has answer: http://stackoverflow.com/a/28198863
tagged with: javascript
tagged with: jquery
score: 4
has body: Given a current CMS we are working in, I need to call functions within a custom data-attribute. Is it possible to call the contents of a data attribute as a function to run like below? Simple example: Set Run Function Run $('button').attr('function'); I believe the above is just getting the contents and not actually executing anything when written. Is this possible?
has answer: http://stackoverflow.com/a/28198862
has title: Call a function inside a custom data-attr?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28198857
has comment: http://stackoverflow.com/comment/44764072
has comment: http://stackoverflow.com/comment/44764244
possible better answer: http://stackoverflow.com/a/28199095

http://stackoverflow.com/comment/44628227
has text: I tried this approach but using Object.create() and calling snoopy.getName() resulted in an undefined function error.
type: Comment
comment on: http://stackoverflow.com/a/28126570
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44903492
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28274296
has text: can you show the code you have so far? "This action fires an iframe" so what part are you having issues with?
type: Comment

http://stackoverflow.com/q/28213295
has answer: http://stackoverflow.com/a/42937840
type: UnansweredQuestion
has title: most efficient way to find average using lodash
score: 34
has answer: http://stackoverflow.com/a/38169389
has answer: http://stackoverflow.com/a/29584518
has answer: http://stackoverflow.com/a/28214208
has answer: http://stackoverflow.com/a/28213416
tagged with: underscore.js
has answer: http://stackoverflow.com/a/29110402
type: Question
answer count: 8
downvote count: 0
tagged with: javascript
has body: I have an array of objects, the number of objects is variable - var people = [{ name: john, job: manager, salary: 2000 }, { name: sam, job: manager, salary: 6000 }, { name: frodo, job: janitor }]; Whats the most elegant way to find the average of the salaries of all managers using lodash? ( I assume we have to check if an object is manager, as well as if the object has a salary property) I was thinking in the below lines - _(people).filter(function(name) { return name.occupation === "manager" &amp;&amp; _(name).has("salary");}).pluck("salary").reduce(function(sum,num) { return sum+num }); But I am not sure if this is the right approach.
tagged with: lodash
favorite count: 0
upvote count: 34
has comment: http://stackoverflow.com/comment/44790337
has answer: http://stackoverflow.com/a/38670073
has answer: http://stackoverflow.com/a/47750929

http://stackoverflow.com/comment/44681321
comment on: http://stackoverflow.com/q/28153768
score: 0
type: Comment
type: QuestionComment
has text: seems to be a bug in plunker itself, have been seeing that a lot lately. clear console/ clcik stop/run and code works fine

http://stackoverflow.com/q/28249587
has comment: http://stackoverflow.com/comment/44858868
has answer: http://stackoverflow.com/a/28249604
type: Question
has comment: http://stackoverflow.com/comment/44859070
possible better answer: http://stackoverflow.com/a/28249604
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28249644
accepted answer: http://stackoverflow.com/a/28249640
score: 0
has answer: http://stackoverflow.com/a/28249613
has title: how to access value hidden elements using loop
has answer: http://stackoverflow.com/a/28249640
has body: what i need i need to fetch hidden element data according to particular element id. a.html &lt;input type="hidden" id="evt_date" value="feb 10"&gt; &lt;input type="hidden" id="evt_date" value="Mar 21"&gt; &lt;input type="hidden" id="evt_date" value="april 05"&gt; js &lt;script&gt; $.each($('input'), function(i, val) { if ($(this).attr("type") == "hidden") { var event_date = document.getElementById('evt_date'); console.log(event_date); } }); &lt;/script&gt; problem on doing console.log im getting &lt;input type="hidden" id="evt_date" value="feb 10"&gt; i want to fetch all hidden element in loop using js. updated js code $.each($('input.event_date'),function(i,val) { if($(this).attr("type")=="hidden") { console.log(val); var evt_date=$('.event_date').val(); console.log(evt_date); $('.date_event').html(evt_date); } });
answer count: 5
has answer: http://stackoverflow.com/a/28249773
type: AnsweredQuestion

http://stackoverflow.com/comment/44702710
type: QuestionComment
comment on: http://stackoverflow.com/q/28135485
has text: also http://stackoverflow.com/questions/27565056/es6-template-literals-vs-concatenated-strings
score: 0
type: Comment

http://stackoverflow.com/q/28268895
favorite count: 0
tagged with: ruby
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: encryption
tagged with: ruby-on-rails
linked to: http://stackoverflow.com/q/27220297
has comment: http://stackoverflow.com/comment/87480198
type: Question
has body: I want encrypt message on the site with user's key and decrypt it on the server side, but decryption doesn't work. crypto-js(coffe js): $(document).on 'click', '.subclick', -&gt; text = $('#myform_text').val() pass = $('#myform_passphrase').val() days = $('#store_days').val() encrypted = CryptoJS.AES.encrypt(text, pass) $.post '/otprecs', text: encrypted.toString(CryptoJS.enc.utf8); store_days: days return ruby decrypt function: def decrypt_text(passphrase, text) encrypted = Base64.decode64(text) cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc') cipher.decrypt cipher.key = Digest::SHA256.digest(passphrase.chomp) text = cipher.update(encrypted) text &lt;&lt; cipher.final puts text end Do you have any ideas?
downvote count: 0
has comment: http://stackoverflow.com/comment/44893899
tagged with: javascript
has title: AES: encrypt with crypto-js, decrypt with ruby openssl library
score: 2
tagged with: cryptography

http://stackoverflow.com/q/28196289
accepted answer: http://stackoverflow.com/a/28196358
type: Question
score: 1
has comment: http://stackoverflow.com/comment/44759162
has title: Inside the callback in Array.prototype.map, reference the new array
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44759286
favorite count: 0
has answer: http://stackoverflow.com/a/28196358
has body: Array.prototype.map() returns a new array. I want to reference this new array inside the callback function passed as the argument to Array.prototype.map(). Can I do that? Example someArray.map(function(item, idx, arr) { return { theCreatedArray: xyz }; }); What should xyz be? EDIT [Context] Why do I want this? The object I create in the callback is of a type that relies on having a reference to the array that is referencing the object. I can't refactor this requirement so easily. I would rather satisfy it.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44759177
upvote count: 1

http://stackoverflow.com/comment/44785624
type: QuestionComment
score: 1
has text: You have to provide relevant code you are using in question. Just linking to a third party plugin and asking for help isn't the purpose of this website
comment on: http://stackoverflow.com/q/28210460
type: Comment

http://stackoverflow.com/comment/44794812
comment on: http://stackoverflow.com/a/28213405
score: 1
type: AnswerComment
has text: You beauty! Thanks Craicerjack, that's pointed me in the right direction.
type: Comment

http://stackoverflow.com/comment/44684673
type: Comment
has text: Just delete the elements or path you created.
score: 1
comment on: http://stackoverflow.com/q/28155279
type: QuestionComment

http://stackoverflow.com/q/28215910
has body: I am currently using OwlCarousel2 for my carousel needs. I chose OwlCarousel2 over OwlCarousel1 since it has an URL hash navigation: http://www.owlcarousel.owlgraphic.com/demos/urlhashnav.html &lt;div id="contestant-carousel"&gt; &lt;div id="poll-images" class="owl-carousel"&gt; &lt;?php for($counter = 1; $counter &lt;= 14; $counter++) { echo "&lt;div class='item' data-hash='$counter'&gt;&lt;a href='" . HTTP_SERVER . "vote.php?contestant_id=$counter'&gt;&lt;img src='/images/contestants_mobile/$counter.png' alt='$counter'&gt;&lt;/a&gt;&lt;/div&gt;"; } ?&gt; &lt;/div&gt; &lt;/div&gt; Above is the PHP code I use to generate my carousel. I have fourteen images, so my code loops through all fourteen images and adds a data-hash object to each image (for the anchor navigating needs). The following is my Javascript code: $(document).ready(function() { $("#poll-images").owlCarousel({ items: 1, loop:false, center:true, margin:10, lazyLoad:false, URLhashListener:true, onDragged:callback, autoplayHoverPause:true, startPosition: 'URLHash' }); function callback(event) { window.location.hash = event.item.index; console.log(event.item.index); } }); Now, the above carousel works perfectly if the user manually adds in the hash in their URL, i.e. someurl.com/voting.php#4, this would navigate to the fourth image. However, want I want to do is, if the url navigates to someurl.com/voting.php, as they scroll through each image, my URL would update its anchor accordingly. Why? Since if my user clicks on the image (which contains a href), and they go to the previous page, they could navigate back to the image they were looking at, instead of the default behavior of going to the first image. According to the OwlCarousel2 API (which is actually quite different from OwlCarousel1), to get the current item, you can do this: function callback(event) { // Provided by the core var element = event.target; // DOM element, in this example .owl-carousel var name = event.type; // Name of the event, in t…
accepted answer: http://stackoverflow.com/a/28218620
tagged with: owl-carousel
downvote count: 0
tagged with: javascript
has title: OwlCarousel2 Updating URL Hash Navigation on Drag
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5928435
score: 1
favorite count: 0
linked to: http://stackoverflow.com/q/28022311
has answer: http://stackoverflow.com/a/28218620
type: Question
upvote count: 1
tagged with: php
answer count: 1
tagged with: owl-carousel-2

http://stackoverflow.com/a/28277631
accepted answer of: http://stackoverflow.com/q/28269136
has comment: http://stackoverflow.com/comment/44911694
score: 1
has body: $timeout works because the stellar plugin is supposed to be applied, not to each parallax element, but to the scrolling container. In the example in the docs it is applied to the window: $(window).stellar(); And so, with $timeout, the code "waits" the end of the digest queue and when it is executed, all the directives are loaded. Unfortunately, it is executed for each directive unnecessarily. The solution is to apply the directive to the container. Then it becomes as simple as: .directive("parallaxContainer", function(){ return { link: function(scope, element){ element.stellar({ horizontalScrolling: false, verticalScrolling: true, verticalOffset: 0 }); } } }) This solution relies on there being a stellar-compatible element (with data-stellar-background-ratio, for example) in that container: &lt;body parallax-container&gt; &lt;div data-stellar-background-ratio="0.2"&gt; ... &lt;/div&gt; &lt;div data-stellar-background-ratio="0.2"&gt; ... &lt;/div&gt; &lt;/body&gt; plunker EDIT: The above code would not work if the parallax elements are loaded dynamically. This complicates things a bit, but not much. In this arrangement, we'd need the container directive responsible for triggering the plugin, and the actual parallax elements directives that would register themselves with the container and notify the container when they have loaded. The element directive could use ng-include to get a notification when content has loaded. This directives uses require: "^parallaxContainer". app.directive('parallaxModule', function() { return { template: '&lt;div ng-include="\'parallax-module.html\'" onload="notifyLoaded()"&gt;&lt;/div&gt;', restrict: 'E', scope: { data: '=' }, require: "^parallaxContainer", link: { pre: function(scope, element, attrs, parallaxContainer){ parallaxContainer.registerElement(); scope.notifyLoaded = parallaxContainer.notifyElementLoaded; } } }; }) The parallaxContainer directives adds a controller that exposes the methods to register and notify. And it trigge…
upvote count: 1
has comment: http://stackoverflow.com/comment/44943519
has comment: http://stackoverflow.com/comment/45300406
has comment: http://stackoverflow.com/comment/44911596
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44912726
answers question: http://stackoverflow.com/q/28269136
type: Answer

http://stackoverflow.com/comment/45008644
comment on: http://stackoverflow.com/q/28202565
score: 0
type: Comment
has text: Im having the exact same problem. Were you able to fix it ?
type: QuestionComment

http://stackoverflow.com/comment/44892786
has text: elclanrs, can you please explain? I don't understand what the difference is.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28268338
score: 0

http://stackoverflow.com/comment/44696927
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28162921
has text: yes, it is recommended not to pollute the global scope; you can try to use some type checkers like jshint or jslint - they'll give you some warnings about such code

http://stackoverflow.com/comment/44879283
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28261064
has text: `console.log` depends on the browser. IE has a problem with it as i recall

http://stackoverflow.com/q/28168151
has answer: http://stackoverflow.com/a/28168329
tagged with: validation
has answer: http://stackoverflow.com/a/28168191
favorite count: 0
has body: i was creating a form validator,but the alert does not fire. here is the block of code... edit: i have placed the . before submit and yes i have included the script in the beginning... Email Telephone Password Confirm Password
answer count: 5
has comment: http://stackoverflow.com/comment/44706187
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28168191
accepted answer: http://stackoverflow.com/a/28168203
has title: Alert won't fire, jquery form validation
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28168225
has comment: http://stackoverflow.com/comment/44706136
downvote count: 3
tagged with: forms
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44706083
score: -2
has comment: http://stackoverflow.com/comment/44706495
has comment: http://stackoverflow.com/comment/44706244
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44706260
has answer: http://stackoverflow.com/a/28168203
has answer: http://stackoverflow.com/a/28168244
has comment: http://stackoverflow.com/comment/44706285

http://stackoverflow.com/a/28146498
has comment: http://stackoverflow.com/comment/44665238
has comment: http://stackoverflow.com/comment/44665101
upvote count: 1
has comment: http://stackoverflow.com/comment/44664869
score: 1
has body: I had the same problem and solved it using regressive iteration. As for my understanding, the DOM nodes index always have to be fixed: 0,1,2,3...: Progressive iteration (i=0; i&lt;3; i++){ i = 0 : checkbox[0] is removed; checkbox[1] become new checkbox[0] as DOM nodes index always starts with 0; i = 1 : checkbox[1] is removed, checkbox[0] stays in DOM (1 node skipped); checkbox[2] become new checkbox[1]; i = 2 : checkbox[2] is removed, checkbox[0] &amp; [1] stays in DOM (2 nodes skipped); node[3] become new node[2]; Finish loop }; 2 skipped checkboxes. Need to repeat the loop until there's less than 2 boxes left, because the every other box will be skipped each time. var inputElems = document.getElementsByTagName("input"); for(var i = 0; i&lt;inputElems.length; i++){ if(inputElems[i].type === "checkbox" &amp;&amp; inputElems[i].checked === true) { inputElems[i].parentNode.remove(); } } JSFiddle Regressive iteration (i=2; i&gt;=0; i--){ i = 2 : checkbox[2] is removed (the last checkbox in index); node[3](not checkbox) become new node[2]; i = 1 : checkbox[1] is removed, (the last checkbox in updated index); node[2](not checkbox) become new node[1]; i = 0 : checkbox[0] is removed, (the last checkbox in updated index); node[1](not checkbox) become new node[0](no more checkboxes!); Finish loop }; Skipped checkboxes: 0. var inputElems = document.getElementsByTagName("input"); for(var i = inputElems.length-1; i&gt;= 0; i--){ if(inputElems[i].type === "checkbox" &amp;&amp; inputElems[i].checked === true) { inputElems[i].parentNode.remove(); } } JSFiddle
accepted answer of: http://stackoverflow.com/q/28146363
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28146363
type: Answer
has comment: http://stackoverflow.com/comment/44664977

http://stackoverflow.com/q/28229306
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28229839
tagged with: beautifulsoup
has body: I've been parsing Craigslist using Requests and BeautifulSoup. I can access posts and everything, but when trying to access a post's 'reply' email address, I can't seem to return anything -- assumedly because you must first 'click' the reply button. What I'd like to do is some how get this email address. Using reply = soup.findAll('div',{'class':'anonemail'}) or reply = soup('button',{'class':'reply_button js-only'}) or any variation of this on elements containing the email address return nothing. I can manually access reply urls such as: http://losangeles.craigslist.org/reply/lax/sof/4869445564 but I can't seem to find out how this url is generated dynamically. That is, I could manually supply /reply/lax/solf/(dataid) at the end of the url, but I want to know how to extract this url from the page itself, unless, again, there's an easier way to access the reply email address.
tagged with: python
has title: Parsing HTML within Javascript button elements with BeautifulSoup
accepted answer: http://stackoverflow.com/a/28229839
tagged with: python-requests
type: AnsweredQuestion
tagged with: javascript
type: Question

http://stackoverflow.com/comment/44628521
score: 0
type: AnswerComment
type: Comment
has text: Can't I do something like http://stackoverflow.com/questions/2534089/jquery-multiple-events-to-trigger-the-same-function
comment on: http://stackoverflow.com/a/28127666

http://stackoverflow.com/comment/44793061
comment on: http://stackoverflow.com/q/28210667
score: 0
type: Comment
has text: I guess you are right. So, let's say, this was an educational case.
type: QuestionComment

http://stackoverflow.com/comment/45150244
type: QuestionComment
has text: Just add a `+` in front of the value.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28276226

http://stackoverflow.com/comment/44661433
type: AnswerComment
type: Comment
has text: Thank you, this worked very well. I had to reassign my ids to the textboxes instead.
comment on: http://stackoverflow.com/a/28144592
score: 0

http://stackoverflow.com/comment/44731849
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28180350
has text: @gstackoverflow see my recent edit. maybe you can work from there, or file a bug report.
score: 0

http://stackoverflow.com/q/28238709
tagged with: extjs4.2
has answer: http://stackoverflow.com/a/28240691
has comment: http://stackoverflow.com/comment/44882429
type: UnansweredQuestion
has body: I want to transform this json to Extjs Model: { "TableHour": { "0": { "Rx": 0, "Tx": 0 }, "1": { "Rx": 2, "Tx": 0 }, "2": { "Rx": 0, "Tx": 0 }, "3": { "Rx": 6, "Tx": 0 } } } I've tried : Ext.define("TableHour", { extend: 'Ext.data.Model', hasMany: { model:'TableMode' } }); Ext.define("TableMode", { extend: 'Ext.data.Model', fields: [ 'Rx','Tx' ], belongsTo: 'TableHour', }); var store1 = Ext.create('Ext.data.JsonStore',{ autoLoad: true, model:'TableHour', proxy:{ type:'ajax', url:'HoursReports.json', reader:{ type: 'json', } } }); console.log(store1.getAt(0)); But the last line, print "undefined". It's sure that model definition is wrong. The numbers "0" "1" "2" "3" aren't declared in my model beacause they're dynamically generated... how can i do?
has comment: http://stackoverflow.com/comment/44846104
has title: nested dynamic JSON data to Extjs Model
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28263660
type: Question
has answer: http://stackoverflow.com/a/28299505
tagged with: javascript
tagged with: extjs
score: 0
tagged with: extjs4
answer count: 3

http://stackoverflow.com/a/28252786
type: Answer
answers question: http://stackoverflow.com/q/28252766
upvote count: 1
has body: Change onclick='controleer()' to onclick='controleer(); return false;' Alternatively, don't use a &lt;form&gt; if you don't intend for it to submit data.
downvote count: 0
score: 1

http://stackoverflow.com/q/28135754
has answer: http://stackoverflow.com/a/28138219
tagged with: node.js
type: AnsweredQuestion
has title: Making node.js code work in browser
has body: I am pretty new to Node.js and was creating a normal chat application to learn more about it. I am using ws library And in my experiment, I found that node.js code doesn't directly work in browsers(I am more specific to require()). So to make it work in browser, I had to use browserify which converted the code to browser compatible. However the converted code throws error of undefined function My node.js code var WebSocket = require('ws') , ws = new WebSocket('ws://localhost:8080'); ws.on('open', function() { var firstMessage = '{"type":"name","message":"god"}'; ws.send(firstMessage.toString()); }); ws.on('message', function(message) { console.log('received: %s', message); }); My converted code using browserify (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ /** * Module dependencies. */ var global = (function() { return this; })(); /** * WebSocket constructor. */ var WebSocket = global.WebSocket || global.MozWebSocket; /** * Module exports. */ module.exports = WebSocket ? ws : null; /** * WebSocket constructor. * * The third `opts` options object gets ignored in web browsers, since it's * non-standard, and throws a TypeError if passed to the constructor. * See: https://github.com/einaros/ws/issues/227 * * @param {String} uri * @param {Array} protocols (optional) * @param {Object) opts (optional) * @api public */ function ws(uri, protocols, opts) { var instance; if (protocols) { instance = new WebSocket(uri, protocols); } else { instance = new WebSocket(uri); } return instance; } if (WebSocket) ws.prototype = WebSo…
type: Question
accepted answer: http://stackoverflow.com/a/28138219
tagged with: javascript
has comment: http://stackoverflow.com/comment/44647079
score: 0
answer count: 1
tagged with: websocket

http://stackoverflow.com/comment/44697767
comment on: http://stackoverflow.com/q/28163328
type: QuestionComment
has text: if i put console.log(req.param('lang')); inside my route and try localhost:3000/en, will print 'en' in the terminal.
score: 0
type: Comment

http://stackoverflow.com/comment/44773924
has text: Do you have a function names initialize? is the first error in the initialize function?
comment on: http://stackoverflow.com/q/28201857
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28208677
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28209725
answer count: 3
has answer: http://stackoverflow.com/a/28214172
tagged with: javascript
tagged with: jquery
tagged with: sql-server-2008-r2
possible better answer: http://stackoverflow.com/a/28208941
has answer: http://stackoverflow.com/a/28208941
score: 0
has title: Jquery, Set an option from dropdown list by a textbox value
accepted answer: http://stackoverflow.com/a/28214172
has body: // JQuery script Now the PHP and HTML code <?PHP connection...blah blah while($record=sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){ $recordx = $record['x']; $recordy = $record['y']; $recordz = $record['z']; } ?> <input type="text" class="con_name_class" id="<? php somefunction_which_echos_out_a_text ?>" value="<? php SAMEfunction_which_echos_out_a_text ?>" /> <input class = "select-change" type="button" id="<? php echo $recordx; ?>" value = "<? php echo $recordx; ?>" /> <? PHP } function xyz(){ // I am calling it some where!! connection...blah blah echo " "; echo " Select one "; while($rec=sqlsrv_fetch_array($stmtxyz, SQLSRV_FETCH_ASSOC)){ echo " ".$rec['con_name']." "; } } ?> How can I map the textbox's text into the dropdown1 and select it?
tagged with: php

http://stackoverflow.com/q/28236145
tagged with: javascript
tagged with: meteor-blaze
has answer: http://stackoverflow.com/a/28238954
score: 0
tagged with: meteor
accepted answer: http://stackoverflow.com/a/28238954
tagged with: spacebars
possible better answer: http://stackoverflow.com/a/28236888
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28236888
has body: I have a select input in one of my Meteor templates which has three pieces of data associated with each select option. I am trying to send all three pieces of data (as an object) to a new template that is rendered via the Blaze API on the 'change' event triggered after the user's selection. I am under the impression I can use the Blaze.getData method to do this, but it doesn't seem to be working for me. I was wondering if anyone has any experience using this method and might be able to help me troubleshoot. I have a MeteorPad set up with an example of what I am trying to do here: http://meteorpad.com/pad/69XGm5nWPutg8an7T/Select%20Item Also, here is the relevant 'change' event code: Template.selectItem.events({ 'change .select_item': function(event) { event.preventDefault(); var view = Blaze.getView(event.target); console.log(view); // me debugging var item = Blaze.getData(view); console.log(item); // me debugging Blaze.renderWithData(Template.selectedResults, item, document.getElementById('results')); } });
has title: How to pull the data context from a view in Meteor using Blaze.getData()
answer count: 2

http://stackoverflow.com/a/28192704
answers question: http://stackoverflow.com/q/28188751
type: Answer
has body: After further documentation I have found the answer. It was a problem with the path. It seems like NODE JS does not read the path as I thought. The ./ returns the current directory, except in the require() function. When using require(), it reads ./ to the directory of the file in which it was called (obviously, the mistake was here). __dirname is always the directory of the file in which is used. The code to be used for my path is the following: __dirname + '/screenshots/' + specName + '.png'
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28188751

http://stackoverflow.com/comment/44875212
type: QuestionComment
comment on: http://stackoverflow.com/q/28258655
has text: `angular.module('app', [])` creates a module, `angular.module('app')` gets already created module. When you create a module again, yes obviously it is created again and anything registered before is gone for good.
score: 1
type: Comment

http://stackoverflow.com/q/28238013
upvote count: 2
downvote count: 3
has title: If statement does not work when condition is met
type: Question
has comment: http://stackoverflow.com/comment/44837206
tagged with: if-statement
has answer: http://stackoverflow.com/a/28238043
score: -1
tagged with: function
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28238043
has body: Here is my code: var count = 2; var decrementAmount = 1; function reduceVariable() { count -= decrementAmount; } $("#button").click(function() { reduceVariable(); }); if (count == 0) { $("#avrageReactionTime").html("Hello"); }; When i click my button twice the div that has the id avrageReactionTime does not change to have the text hello. Why do i have this problem...
type: AnsweredQuestion

http://stackoverflow.com/q/28176068
has title: Why is my delete where statement not working?
answer count: 2
has comment: http://stackoverflow.com/comment/44721333
tagged with: javascript
tagged with: sql
tagged with: sqlite
has comment: http://stackoverflow.com/comment/44721869
has comment: http://stackoverflow.com/comment/44721595
has answer: http://stackoverflow.com/a/28176142
has body: I am trying to delete a user from table USERS. Unfortunately, I keep getting sent to onSqlError. I can't figure out why. When I alert the request it gives me the correct name for the getTheId variable. Not too familiar with sql so maybe I have written something incorrectly. Any pointers appreciated. // DELETE RECORD function deleteRecord(getTheId){ deleteUser.onclick = (function () {//deleteUser is an element generated for each user when a button is clicked var sqlStr2 = 'DELETE FROM USERS WHERE username = '+getTheId+''; alert("SQL: " + sqlStr2); //This gives me the statement above with the correct name of the user clicked. if (db){ console.log("db is there");//this logs db.transaction(function(tx) { tx.executeSql(sqlStr2); }, onSqlError, onSqlSuccess); //THEN I GET SENT TO ERROR } }); }
has comment: http://stackoverflow.com/comment/44721852
possible better answer: http://stackoverflow.com/a/28176117
has answer: http://stackoverflow.com/a/28176117
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/28176142
type: Question

http://stackoverflow.com/q/28182128
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44733713
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28187772
has comment: http://stackoverflow.com/comment/44733577
tagged with: wordpress
score: -1
has body: my problem is I am trying to call up some javascript code and create a plugin with it. I added both files into the plugin directory in a folder and wordpress recognizes the plugin. But I must have done something wrong because the .js file is said to be inactive and does not work. I'm inexperienced with this, can anyone point out my error? Or point me in the right direction? function wpb_adding_scripts() { wp_register_script('downloadimagescript', plugins_url() . '/js/downloadimagescript.js', array('jquery')); admin_enqueue_scripts('downloadimagescript'); } add_action( 'admin_enqueue_scripts', 'wpb_adding_scripts' );
has comment: http://stackoverflow.com/comment/44733666
has title: hooking javascript file in wordpress

http://stackoverflow.com/a/28222478
answers question: http://stackoverflow.com/q/28220195
has body: you could hide the src of the images in the listitem's "data-src" property, and change the "main" image's src each time one is clicked. Sample code: Click me! jquery (modify for regular javascript if you want): $(document).ready(function(e){ $(".ImageChanger").on("click", function(){ $("#imgToChange").prop("src", $(this).data("src")); }); });
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28261804
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44880861
tagged with: laravel-4
downvote count: 0
favorite count: 0
has body: This is my view to upload the image.... &lt;div id="addmore1"&gt; &lt;table border="0" border-spacing="5em" &gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; {{Form::label('Image')}}&lt;/td&gt; &lt;td colspan="5"&gt; &lt;Input type="file" name="image1" required&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="width: 80px; height: 20px"&gt; &lt;td colspan="6"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; {{ Form::hidden('idevent', $event-&gt;idevent) }} &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="button" onclick="addmore1()" value="Add" style="background-color: #298537" /&gt; (limit=4) &lt;/td&gt; &lt;/tr&gt; &lt;tr style="height:20px;"&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan='7'&gt; &lt;input class="btn btn-info pull-right" name="submit" type="submit" id="submit" value="Submit" style="color: #080808;" /&gt; &amp;nbsp; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; And this is my addmore script.... &lt;script type="text/javascript"&gt; var i = 1; function addmore1() { if(i&lt;=3) { i++; var div = document.createElement('div'); div.innerHTML ='&lt;td&gt;Image:&lt;/td&gt; &lt;td colspan="5"&gt;' + '&lt;Input type="file" name="image' + i + '"' + ' required&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;' + ' &lt;tr&gt;&lt;td colspan="7"&gt; &lt;hr&gt;&lt;/td&gt;&lt;/tr&gt;' + '&lt;input type="button" onclick="' + 'removemore1(this)" value="Remove"' + 'style="background-color: #c4291e"/&gt;'; document.getElementById('addmore1').appendChild(div); } } &lt;/script&gt; I just don't get it what i am doing wrong. It gives me the error The file "image.jpg" was not uploaded due to an unknown error. But it works fine if it is a single query. I mean if i don't use the addmore script. Any help will be appreciated........
has title: Multiple images is not uploaded correctly saying The file "image.jpg" was not uploaded due to an unknown error
upvote count: 2
type: UnansweredQuestion
tagged with: laravel-5
score: 2
answer count: 0

http://stackoverflow.com/comment/133249481
comment on: http://stackoverflow.com/a/28197711
has text: You can control your scope with arrow functions. `User.findById( this.user, (err, user) => { console.log(this.user); } )` will still log `this.user` to your console. Arrow functions do not create their own scopes.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/35899306
has body: In your html cawky parky ahoj more ideme na pivo? in your jquery $(".select2").select2({ placeholder: "Selecione", allowClear: true });
score: 0
answers question: http://stackoverflow.com/q/28140705
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28122630
has comment: http://stackoverflow.com/comment/44619413
type: Answer
has body: try like this if you are using jquery: add it to head. &lt;script&gt; var js = document.createElement("script"); js.type = "text/javascript"; js.src = "https://cdnjs.cloudflare.com/ajax/libs/html-inspector/0.8.1/html-inspector.js"; $("head").append(js) window.onload = function() { HTMLInspector.inspect(); } &lt;/script&gt;
score: 0
has comment: http://stackoverflow.com/comment/44619316
answers question: http://stackoverflow.com/q/28122513

http://stackoverflow.com/a/28248903
has comment: http://stackoverflow.com/comment/44932487
has comment: http://stackoverflow.com/comment/44913085
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44914279
type: Answer
answers question: http://stackoverflow.com/q/28241986
has body: dojo/on uses : as the delimiter between selector and event name for event delegation, so :not is probably confusing it. However, you can use on.selector to construct a custom event type yourself (which is normally what on does for you automatically when the second argument is a selector:type string): on(node, on.selector(':not(.disabled)', 'click'), ...); Working example: http://jsfiddle.net/yLqhok8t/
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28241986
has comment: http://stackoverflow.com/comment/44913570
score: 1
has comment: http://stackoverflow.com/comment/44953572

http://stackoverflow.com/q/28274005
has title: Getting a list of routes in Ember.js
has comment: http://stackoverflow.com/comment/44904306
has answer: http://stackoverflow.com/a/75051113
has comment: http://stackoverflow.com/comment/44904347
tagged with: ember.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28291422
has answer: http://stackoverflow.com/a/28279043
type: Question
possible better answer: http://stackoverflow.com/a/28279043
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28291422
has body: On my main page (index.hbs), I need to display a list of links to each route which matches a given criteria, (e.g. has a certain attribute). So what I need is something like this: // Define a route with some attribute App.FirstRoute = Ember.Route.extend({ showOnIndex: true }); // Get a list of visible routes in the IndexController visibleRoutes: function() { var routes = /* How to do this */ return routes.filter(function(route) { route.get('showOnIndex')); }); }.property() The problem is how to get routes. I have found that I can get a list of route names by: var router = this.get('target'); var names = router.router.recognizer.names; But I can't find out how to translate them into Route objects. Presumably the Router has the information to do so, but AFAICS it is not publically exposed. Any suggestions?
score: 0
answer count: 3

http://stackoverflow.com/a/28136847
type: Answer
has body: You can use css to complete the task: Use this code in css &lt;style type="text/css"&gt; body{overflow-x:hidden;} *{ overflow-x:hidden;} html, div, span, p, label, textarea{ overflow-x:hidden; } &lt;/style&gt; You don't need to use JavaScript to hide bottom scrollbar in the html page
answers question: http://stackoverflow.com/q/28136574
score: 0

http://stackoverflow.com/a/28226322
accepted answer of: http://stackoverflow.com/q/28224896
has comment: http://stackoverflow.com/comment/44854581
upvote count: 2
has comment: http://stackoverflow.com/comment/44901079
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44868728
has comment: http://stackoverflow.com/comment/44919062
has comment: http://stackoverflow.com/comment/44815953
has body: If you want to run several tasks that don't depend on each other and then run a task which needs those values, you can do something like this: Q.all([getUserData(), getVideoData()]).spread(function(user, video) { // user and video are available makeVideoObject(user, video) }); all takes a list of promises which can be fetched in parallel; spread splits those return values into individual params which can then be used inside the callback. Is that what you're trying to do?
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28224896
downvote count: 0

http://stackoverflow.com/comment/44715075
type: Comment
comment on: http://stackoverflow.com/q/28172446
has text: Yes, I'm asking if there is a way to limit the package code being included in certain builds to reduce the code that is downloaded.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28235008
accepted answer: http://stackoverflow.com/a/28235148
answer count: 1
favorite count: 0
downvote count: 2
has body: I am an amateur in JavaScript, I have an accordion with two Divs and I want to display a specific Div (Active) if called from a specific position from another page, simple ID calling doesn't work. the code id given below $(document).ready(function(){ var address=window.location.href; if(address.value$=="#div2"){ $('div &gt; #div1').removeClass('active'); $('div &gt; #div2').addClass('active'); } }); in the above code I want to show the 2nd Div as active in the accordion so I passed "test.html#div2" as the address for the page, the address variable catches the address, I am not sure about the .value thing though. Please Help.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28235148
type: Question
upvote count: 0
score: -2
has title: How to assign/remove a class to an accordion if called from a different page
tagged with: javascript
tagged with: jquery
tagged with: accordion

http://stackoverflow.com/comment/44744189
score: 0
comment on: http://stackoverflow.com/q/28187963
type: Comment
type: QuestionComment
has text: If you want to do what I think, you better learn how to use @media-query (css)

http://stackoverflow.com/a/28258167
has comment: http://stackoverflow.com/comment/119284588
has body: Because they override the browser default, the select styling needs Javascript to run. You need to include the Materialize Javascript file, and then call $(document).ready(function() { $('select').formSelect(); // Old way // $('select').material_select(); }); after you've loaded that file.
has comment: http://stackoverflow.com/comment/106078646
accepted answer of: http://stackoverflow.com/q/28258106
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28258106
has comment: http://stackoverflow.com/comment/93469078
has comment: http://stackoverflow.com/comment/53567348
downvote count: 2
type: Answer
upvote count: 255
has comment: http://stackoverflow.com/comment/95223572
score: 253

http://stackoverflow.com/a/28157475
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: I have found two solutions: Add .noSwipe class to the content that you want to be selectable. ( in my case it was impossible) Detect the mobile and tablet devices first then activate this plugin so I did this: // Check if you are in mobile or not // Code credit: https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device-in-jquery function isMobile() { try{ document.createEvent("TouchEvent"); return true; } catch(e){ return false; } } if ( isMobile() == true ) { // Swipe plugin for handling touch events $(window).swipe( { //Generic swipe handler for all directions swipeRight:function(event, direction, distance, duration, fingerCount) { dnlShow(); }, swipeLeft:function(event, direction, distance, duration, fingerCount) { dnlHide(); }, //Default is 75px, set to 0 for demo so any distance triggers swipe threshold: 75 }); } for detecting mobile and tablet devices there are several solutions, you can check at What is the best way to detect a mobile device in jQuery? I hope this help others too.
answers question: http://stackoverflow.com/q/28157474

http://stackoverflow.com/comment/44695004
type: Comment
comment on: http://stackoverflow.com/a/28160602
score: 0
has text: It doesn't matter how many times you assign it, Chrome will display the last expression unless it is put into a `var`. test your exemple with only the line `x = 4` and you will see 4.
type: AnswerComment

http://stackoverflow.com/comment/44659457
has text: This is correct. var name = ... is creating a private variable inside the local function, while this.name attaches the variable as an attribute to the parent Dog object.
type: Comment
comment on: http://stackoverflow.com/a/28143843
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44716956
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28173800
has text: Yes, animate is reserved in most browsers.
score: 0

http://stackoverflow.com/a/30325781
score: 0
has body: Virtualization is pretty much impossible without pre-defined row heights. You'll find the same limitation with any virtualized list tool. Check Ionic's collection-repeat for instance. The problem is that UI-Grid is only displaying a subset of all the rows at any given time, but in order for it make it appear like all the rows are there it has to create empty space around the rendered rows. If it doesn't know how tall all the rows are, it doesn't know how much empty space there should be. If you wanted automatic row height it would have to render each row individually, measure it, then sum up all the heights. This would completely thrash the browser.
type: Answer
answers question: http://stackoverflow.com/q/28183161

http://stackoverflow.com/comment/44883514
type: QuestionComment
has text: Thanks for your answers and comments. If this is the case that the Array function is just different, just because it is, then it leads to asking why the examples of its use (MDN for example) use the `new` keyword at all. To me, by explicitly controlling the context (`this`) using `new`, there's the implication that it's (the context) important somehow. Perhaps it is but not for assignment reasons? (You can simply call `Array` as a non-constructor function after all).
comment on: http://stackoverflow.com/q/28262971
score: 0
type: Comment

http://stackoverflow.com/comment/44644978
type: AnswerComment
score: 0
type: Comment
has text: Seems so simple now that you have shown me how, ha! Thank you Paul.
comment on: http://stackoverflow.com/a/28131432

http://stackoverflow.com/a/28186883
has body: Here you go: jsfiddle Please tell if this is what you need. I changed the way of creating the svg1 var. Removing items right after the change is mostly working way better. I also had issues with exit().remove() and found that out after a very long time. It's not the way d3 should be used tho, but it works well. css: .data{display:none} html: Select 1 2 [{"name":"A","tid":"54","image":"img","measure":32,"group":"53"},{"name":"B","tid":"55","image":"img","measure":45,"group":"53"},{"name":"R","tid":"59","image":"img","measure":40,"group":"23"},{"name":"T","tid":"29","image":"img","measure":20,"group":"23"}] [{"name":"G","tid":"14","image":"img","measure":78,"group":"53"},{"name":"S","tid":"85","image":"img","measure":25,"group":"55"}, {"name":"U","tid":"44","image":"img","measure":78,"group":"53"}, {"name":"K","tid":"29","image":"img","measure":32.6,"group":"55"}, {"name":"Y","tid":"53","image":"img","measure":30,"group":"24"},{"name":"O","tid":"26","image":"img","measure":25,"group":"24"}] js: var width = 350, height = 310, barHeight = 80, left_width = 80, fo_height = 70; var x = d3.scale.linear().range([0, width / 1.5]); y = d3.scale.ordinal().rangeBands([0, height]); function chart(array){ array = JSON.parse(array); console.log(array); var colors = ['#222','red','blue']; var nested_data = d3.nest().key(function(d) { return d.group; }).entries(array); ymax = d3.max(nested_data,function(d){ return d.values.map(function(t){ return t.measure; }) }); nested_data.forEach(function(nd){ nd.values.forEach(function(d){ d.measure = +d.measure; }) }) var diff = 2; var tickno = 5 var ymax = d3.max(nested_data, function(nd,k) { return d3.max(nd.values,function(p,l){ return p.measure ; }); }); var ymin = d3.min(nested_data, function(nd,k) { return d3.min(nd.values,function(p,l){ return p.measure - 2; }); }); x.domain([ymin ,ymax]); console.log(nested_data); svg1 = d3.select('.chart').selectAll("svg").data(nested_data) var svg = svg1.enter().append("svg:svg") svg.attr("class", "r_…
score: 1
accepted answer of: http://stackoverflow.com/q/28186109
answers question: http://stackoverflow.com/q/28186109
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/28233190
has comment: http://stackoverflow.com/comment/44828834
has comment: http://stackoverflow.com/comment/44828693
favorite count: 0
has comment: http://stackoverflow.com/comment/44828742
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44829186
has comment: http://stackoverflow.com/comment/44828623
has comment: http://stackoverflow.com/comment/44828614
has answer: http://stackoverflow.com/a/28233359
has comment: http://stackoverflow.com/comment/44828758
has comment: http://stackoverflow.com/comment/44829047
has comment: http://stackoverflow.com/comment/44828483
type: Question
has comment: http://stackoverflow.com/comment/44829116
has title: Script not working to add a value to list
downvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/44828675
tagged with: jquery
score: -3
has answer: http://stackoverflow.com/a/28233655
has comment: http://stackoverflow.com/comment/44828735
has body: I am trying to add a value to list by using text box, but it is not working. Volvo Saab And the script is: $(document).ready(function (e) { var $txtVal = $('#ip1'); $(".bt1").click(function () { var opt = $("#ip1").val(); if ($txtVal.val()) { $(' ', { text: $txtVal.val(), value: $txtVal.val() }).appendTo('select'); } }); }); Where is my mistake?
answer count: 2
has comment: http://stackoverflow.com/comment/44828510
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28262048
has body: I don't have SQLite installed, but in general you want to return the result of the nested then functions. Callers then use then to get the result. Something like: function useResults() { getInfo().then(function (rName) { console.log(rName); }); } function getInfo() { var rName; return SQLite3JS.openAsync(dbPath).then(function (db) { return db.runAsync('CREATE TABLE IF NOT EXISTS Item (resourceName TEXT, resourceType TEXT, id INT PRIMARY KEY)').then(function () { return db.eachAsync('SELECT * FROM Resource', function (row) { console.log('Get a ' + row.resourceName + ' for' + row.resourceType); rName = row.resourceName; }).then(function() { return rName; }); }); }); } Although this will only effectively return the last name.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28242257

timer
tag name: timer
tags question: http://stackoverflow.com/q/28232179
tags question: http://stackoverflow.com/q/28134588
tags question: http://stackoverflow.com/q/28203659
type: Tag
tags question: http://stackoverflow.com/q/28168610
tags question: http://stackoverflow.com/q/28178648
tags question: http://stackoverflow.com/q/28227389
tags question: http://stackoverflow.com/q/28159906

http://stackoverflow.com/q/28202069
accepted answer: http://stackoverflow.com/a/28202225
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28203485
score: 4
type: AnsweredQuestion
has body: In Angular Phone cat application (step-10), I am not able to use element(by.binding('bindingName')) Protractor locators Tutorial link: Angular phone cat app (step-10, test) Details: // Working expect(element(by.css('img.phone')).getAttribute('src')) .toMatch(/img\/phones\/nexus-s.0.jpg/); // Not Working expect(element(by.binding('mainImageUrl')).getAttribute('src')) .toMatch(/img\/phones\/nexus-s.0.jpg/); &lt;img ng-src="{{mainImageUrl}}" class="phone"&gt;
type: Question
tagged with: protractor
tagged with: javascript
has answer: http://stackoverflow.com/a/28202225
has title: Get element by binding for 'ng-src' not working, Protractor
upvote count: 4
has answer: http://stackoverflow.com/a/33731553
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28203485
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/44757396
comment on: http://stackoverflow.com/a/28189050
has text: My personal view on this is..if u want to expose an api which mostly (not limited to)deals with talking to http CRUD services then its easier to use a service. When u seem to be in need of creating a thing (resembling a java bean) you would create it through a factory.this is entirely my opinion though.logically they both give u similar results
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44713251
comment on: http://stackoverflow.com/q/28171986
type: Comment
type: QuestionComment
score: 3
has text: Check the DOC regarding Date object methods https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#Date.prototype_Methods I guess no one can explain it better...

http://stackoverflow.com/comment/44678310
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28153439
type: Comment
has text: UTC just isn't affected by DST.

http://stackoverflow.com/comment/44849900
has text: ok, but then i would like to isolate them, so as i can retrieve informations from any of them
type: Comment
comment on: http://stackoverflow.com/a/28243964
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44781228
score: 1
comment on: http://stackoverflow.com/q/28208165
has text: use double curly brace and check
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28239843
linked to: http://stackoverflow.com/q/28211290
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: symfony
tagged with: php
has comment: http://stackoverflow.com/comment/44841552
has answer: http://stackoverflow.com/a/28240067
score: 2
has body: Currently I've been Ajaxing a route that renders a Twig template via a Controller and injecting it into the page - all is well. return $this-&gt;render('MyBundle:Requests:results.html.twig', array('system' =&gt; $lc_system)); However, in my JavaScript, I would like to get some extra information returned... Specifically I want a count of the results, so I can check it against a JS variable. I could put it into the twig file and then get it in JS that way, but it feels horrible. Is there any way to get any variables sent down with the Ajax response, or a best practice way to approach this.
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28239974
has title: Symfony get PHP variable in Ajax response
has comment: http://stackoverflow.com/comment/44942648
type: Question
has comment: http://stackoverflow.com/comment/44842829
linked to: http://stackoverflow.com/q/3561381
tagged with: javascript
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/44732498
has text: Yes, question updated. I was created a new property, `innerHtml`, by accident. The method should've been, `innerHTML`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28180865

http://stackoverflow.com/comment/44722605
has text: I believe yes, when i click the "active" image get into some fancybox divs and get position, overflow, etc...
type: AnswerComment
comment on: http://stackoverflow.com/a/28176432
score: 0
type: Comment

http://stackoverflow.com/q/28195481
has answer: http://stackoverflow.com/a/28195645
has title: Instantly display a modal when the form is submitted (before validation)
tagged with: javascript
has comment: http://stackoverflow.com/comment/44758742
has comment: http://stackoverflow.com/comment/44757754
linked to: http://stackoverflow.com/q/10143444
has comment: http://stackoverflow.com/comment/44759667
upvote count: 1
tagged with: validation
answer count: 1
has body: I'm using a bootstrap validator from (https://github.com/1000hz/bootstrap-validator/blob/master/js/validator.js) and I'm trying to instantly display a modal 'loading' box when the submit button is pressed on a form. I've achieved this by doing the following: $('form').on('submit', function (event) { showLoadingModal(); if (!event.isDefaultPrevented()) { event.preventDefault(); submitForm(this); } else { hideLoadingModal(); } }); However I'm getting a problem where there is a small gap of time (under a second) between clicking the button and the modal being displayed. I'm assuming this delay is caused by the time taken validating all the fields on the form of which there are quite a lot. This therefore leads me to believe that the validator 'form submit' is being executed before my code and I should be doing something different to call the showLoadingModal() Edit: I've added some logging into the js to work out what happens and when. I've also moved the showLoadingModal() into a 'button clicked' event to ensure it happens before form submit. Here's the order my messages get displayed: button clicked before show modal after show modal form submitted about to validate &lt;--Modal appears now-->
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44758444
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44758116
downvote count: 0
tagged with: twitter-bootstrap
score: 1
has comment: http://stackoverflow.com/comment/44758166
type: Question

http://stackoverflow.com/comment/44784845
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28208569
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69796/discussion-between-don-and-nitin-suri).

http://stackoverflow.com/a/28134120
has body: Why wouldn't you just validate the data before you set the state? The errors are also state, so it would be logical to set them in the same fashion as the rest of the state. changeState: function () { var data = { email: this.refs.email.getDOMNode().value, password: this.refs.password.getDOMNode().value, password_confirmation: this.refs.password_confirmation.getDOMNode().value }, errors = validate(data, constraints) || {}; this.setState({ data: data, errors: errors }); },
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28122656
type: Answer
has comment: http://stackoverflow.com/comment/44642584
upvote count: 1

http://stackoverflow.com/q/28198457
has title: How would I translate this require to ES6 import style
linked to: http://stackoverflow.com/q/29923879
has comment: http://stackoverflow.com/comment/44767199
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/32075162
favorite count: 0
duplicate of: http://stackoverflow.com/q/29923879
has comment: http://stackoverflow.com/comment/44764746
has comment: http://stackoverflow.com/comment/47208440
type: UnansweredQuestion
tagged with: import
type: Question
tagged with: ecmascript-6
tagged with: commonjs
score: 5
upvote count: 5
tagged with: javascript
has body: I would like to do this var debug = require('debug')('myapp'); ... in ES6 without creating an extra variable. Can it be done?

http://stackoverflow.com/comment/44772410
type: QuestionComment
comment on: http://stackoverflow.com/q/28203140
score: 0
type: Comment
has text: You have to include jQuery for starters: [fiddle](http://jsfiddle.net/ymu177dj/2/)

http://stackoverflow.com/comment/44775984
score: 0
comment on: http://stackoverflow.com/a/28205079
type: AnswerComment
has text: Do you happen to know if two strings that are equal are stored twice in memory or only one copy of it is kept in memory? I mean like `var x = 'a'; var y = 'a'; `, is the 'a' stored twice in memory or it is in some kind of pool an `x` and `y` are holding references to it?
type: Comment

http://stackoverflow.com/q/28198415
tagged with: google-maps-api-3
linked to: http://stackoverflow.com/q/14052580
score: 0
tagged with: google-maps-markers
accepted answer: http://stackoverflow.com/a/28199051
answer count: 1
duplicate of: http://stackoverflow.com/q/14052580
favorite count: 0
linked to: http://stackoverflow.com/q/8792151
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28199051
type: Question
has body: I am attempting to fade circles out with a setInterval on fillOpacity. However a console log shows the opacity changing but the appearance of the circle does not seem to change. Is there a different set function required to do this? http://jsfiddle.net/faaxeskg/5/ setInterval(function() { marker.fillOpacity -= .01; console.log(marker.fillOpacity); }, 200); code snippet: var map = null; function initialize() { var mapOptions = { zoom: 4, center: new google.maps.LatLng(-25.363882, 131.044922) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); // Add 500 markers to the map at random locations var southWest = new google.maps.LatLng(-31.203405, 125.244141); var northEast = new google.maps.LatLng(-25.363882, 131.044922); var bounds = new google.maps.LatLngBounds(southWest, northEast); map.fitBounds(bounds); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); setInterval(function() { var position = new google.maps.LatLng( southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); var populationOptions = { strokeOpacity: 0, fillColor: '#FF0000', fillOpacity: 0.65, map: map, center: position, radius: 40000 }; var marker = new google.maps.Circle(populationOptions); setInterval(function() { marker.fillOpacity -= .01; console.log(marker.fillOpacity); }, 200); setTimeout(function() { marker.setMap(null); delete marker; }, 30000); }, 2000); } google.maps.event.addDomListener(window, 'load', initialize); html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } &lt;script src="https://maps.googleapis.com/maps/api/js?v=3&amp;libraries=geometry"&gt;&lt;/script&gt; &lt;div id="map-canvas" style="float:left;width:100%;height:100%;"&gt;&lt;/div&gt;
has title: Circle fade out over time on Google Map
tagged with: google-maps
tagged with: javascript

http://stackoverflow.com/comment/44702596
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28166090
has text: Is your question about why the loop doesn't stop ? If so, Bergi answered.
score: 0

http://stackoverflow.com/comment/44808710
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28222842
score: 1
has text: That's not how media queries, or CSS, for that matter, work. Items that have `display: none` still exist in the DOM, they're simply hidden.

http://stackoverflow.com/comment/44848248
has text: @Roger, you were the inspiration for us revisiting SVG, so if you want to turn your comment into a question I'd be happy to mark it as correct.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28236843
type: Comment

http://stackoverflow.com/a/28143738
downvote count: 0
has comment: http://stackoverflow.com/comment/44659370
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28143697
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28143697
type: Answer
has body: Your variable is not global in node.js, it is global to that module only. If you want to make it global to all modules, put it in the global namespace. global.my = 'this one is truly global'; You should definitively avoid globals, like in any other programming language.
has comment: http://stackoverflow.com/comment/44659279
score: 2

http://stackoverflow.com/q/28209959
score: 1
favorite count: 0
has title: Setting multiple cookie in javascript
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/28210117
possible better answer: http://stackoverflow.com/a/28210041
has answer: http://stackoverflow.com/a/28210041
has comment: http://stackoverflow.com/comment/44784636
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44784600
has body: I'm trying to set multiple cookies in document.cookie, but unfortunately my code shows the cookie value as null and undefined. My code is as belows: &lt;script&gt; function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_y ) { var expires = new Date ( exp_y, exp_m, exp_d ); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; } &lt;/script&gt; &lt;script&gt; alert(setCookie( "username", "Miron" )); alert(setCookie( "username", "Mirion", 2003, 01, 15 )); alert(setCookie("username", "John Smith", 2003, 01, 15, "","elated.com", "secure")) &lt;/script&gt; I technically see no fault in the code. Please tell me where I had gone wrong
type: Question
has answer: http://stackoverflow.com/a/28210117
type: AnsweredQuestion

http://stackoverflow.com/comment/44875576
comment on: http://stackoverflow.com/q/28244018
has text: No. Replace or tint http://data-arts.appspot.com/globe/world.jpg. The demo is using an outdated version of three.js circa 2013, by the way.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28245459
downvote count: 0
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28243359
score: 3
answers question: http://stackoverflow.com/q/28243359
has body: You have gridOptions.minRowsToShow . you can set this to the length of your data. you can set the row height with gridOptions.rowHeight You can set the height of the container with css. .grid { width: 500px; height: 250px; } so you can calculate the height in pixel $scope.gridheight=(data.length+1) *rowHeight ** in your controller and set with the style attribute the css height. style="height: {{gridheight}} px;" //for the container with element with ui-grid or ng-style="{'height':gridheight+'px'}" **data.length+1 because of the label row.
has comment: http://stackoverflow.com/comment/53499719
type: AcceptedAnswer

http://stackoverflow.com/q/28177657
has title: Keep track of which UDP socket receives packets
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44725117
accepted answer: http://stackoverflow.com/a/28177729
has body: I'm currently using NodeJS and I want to create an array of multiple udp4 sockets. It is important to me which socket is receiving a message, so I'm trying to store everything as following: var sockets = []; function startSocket(socketObject) { socketObject.HandleIncomingPacket = function(buffer, header) { if(header.address === this.ip) { console.log("ID: "+this.id+" | right IP"); }else{ console.log("ID: "+this.id+" | wrong IP. IP expected: "+this.ip+", given: "+header.address); } } socketObject.socket = dgram.createSocket("udp4"); socketObject.socket.on("message", socketObject.HandleIncomingPacket); socketObject.socket.bind(socketObject.port); sockets[socketObject.id] = socketObject; } Calling the function with object {ip: "127.0.0.1", port: 1234} works fine (read: no errors), but on incoming packets I receive the following output: ID: undefined | wrong IP. IP expected: undefined, given: 127.0.0.1 How come this is undefined in this context? Is it even possible to do anything like I am trying to do now? I'm probably missing out on something.
has comment: http://stackoverflow.com/comment/44724698
has comment: http://stackoverflow.com/comment/44724969
has comment: http://stackoverflow.com/comment/44725061
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28177729
type: Question

http://stackoverflow.com/q/28225390
has comment: http://stackoverflow.com/comment/44814064
tagged with: javascript
has title: whats wrong with my tracking code?
has comment: http://stackoverflow.com/comment/44813954
has comment: http://stackoverflow.com/comment/44814108
answer count: 1
has answer: http://stackoverflow.com/a/28225427
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44928771
upvote count: 2
score: 1
has body: I am trying to set up cross domain tracking and also some other add on's as per the web developer reference guide but its not working. When I use the google debugger it gives me this error: Uncaught SyntaxError: Unexpected token ILLEGAL related to my this line of code: ga('create', ‘UA-xxxxx-1', 'auto', {'allowLinker': true}); My full code is this: &lt;script&gt; (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', ‘UA-xxxxxx-1', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', [‘destination.com']); ga('send', 'pageview'); ga('require', 'ecommerce'); ga('send', 'social', 'socialNetwork', 'socialAction', 'socialTarget', {'page': 'optPagePath'}); ga('send', 'timing', 'timingCategory', 'timingVariable', timingValue, 'optLabel'); ga('send', 'event', 'category', 'action', 'opt_label', opt_value, {'nonInteraction': 1}); ga('require', 'displayfeatures'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); &lt;/script&gt; id really appreciate any help as the code is no longer working and I cant track any analytics. please help.
downvote count: 1
type: Question
tagged with: google-analytics

http://stackoverflow.com/q/28142566
tagged with: javascript
tagged with: jquery
has title: understanding $.proxy function in button.js
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has body: was going through the twitter bootstrap button.js code and code across some peice of code that really does't make sense to me , so i am here asking you guys help , if any one of you could be kind enough to explain the meaning of this code to me , it would simply be great . well , here is the peice of code that is really difficult to understand , setTimeout($.proxy(function () { if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d) } else if (this.isLoading) { this.isLoading = false $el.removeClass(d).removeAttr(d) } }, this), 2000) now here's my understanding of the proxy function in jquery. In the doc's i see the following example : $(document).ready(function(){ var me = { // I'm a dog type: "dog", // Note that event comes *after* one and two test: function( one, two, event ) { $( "#log" ) // `one` maps to `you`, the 1st additional // argument in the $.proxy function call .append( "Hello " + one.type + ":" ) // The `this` keyword refers to `me` // (the 2nd, context, argument of $.proxy) .append( "I am a " + this.type + ", " ) // `two` maps to `they`, the 2nd additional // argument in the $.proxy function call .append( "and they are " + two.type + "." ) // The event type is "click" .append( "Thanks for " + event.type + "ing." ) // The clicked element is `event.target`, // and its type is "button" .append( "the " + event.target.type + "." ); } }; var you = { type: "cat" }; var they = { type: "fish" }; // Set up handler to execute me.test() in the context // of `me`, with `you` and `they` as additional arguments var proxy = $.proxy( me.test, me, you, they ); $( "#test" ).on( "click", proxy ); }); now clearly proxy is being passed 4 arguments in the example listed in the doc's , but i don't see that happening in the proxy function inside the button.js code WHY ? i understand that proxy somewhat works like prototype.bind or prototype.call in javascript and can be used to change the context of a given call to a function , but this code in button.…
score: 1
type: Question
has answer: http://stackoverflow.com/a/28142728
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28152949
accepted answer: http://stackoverflow.com/a/28152988
upvote count: 1
has comment: http://stackoverflow.com/comment/44678127
type: Question
tagged with: javascript
has title: Can I call my function in this example immediately instead of wrap it by anonymous function?
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I don't know how to pass $(this) in direct call var parentLI = $("#nav .parent"); parentLI.hoverIntent(function() { showUL($(this)); }, function() { hideUL($(this)); });
has answer: http://stackoverflow.com/a/28152988
type: AnsweredQuestion
score: 1
tagged with: hoverintent

http://stackoverflow.com/a/58840045
type: Answer
has body: I got this error due to the use of Date.parse() method in javascript. Check this out: Date constructor returns NaN in IE, but works in Firefox and Chrome Date.parse failing in IE 11 with NaN You can parse the date values in server-side or use third-party packages like moment.js to parse the date to the required format
answers question: http://stackoverflow.com/q/28240796
score: 0

http://stackoverflow.com/q/28271303
has answer: http://stackoverflow.com/a/28271477
has body: hi i want to clear the form values after successfull completion. Houw should i implemnt Employee No FirstName LastName Department DOB which is the best way to implement this. I have tried many ways. please help. $scope.Add = function (emp,$scope) { this.EmployeeObject = angular.copy(emp); employee.push(this.EmployeeObject); $scope.emp = null; } which is the best way to implement this. I have tried many ways. please help.
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/44898172
has comment: http://stackoverflow.com/comment/44898613
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28271477
downvote count: 0
has comment: http://stackoverflow.com/comment/44908060
favorite count: 0
has title: Clear the form after submit angularjs
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/62769525
possible better answer: http://stackoverflow.com/a/28271543
has answer: http://stackoverflow.com/a/53078302
has answer: http://stackoverflow.com/a/28271543
has answer: http://stackoverflow.com/a/47773066
has comment: http://stackoverflow.com/comment/44901378
type: AnsweredQuestion

http://stackoverflow.com/a/28165893
type: Answer
has body: It sounds like you are on the right lines. You need some way of creating a unique identifier that both the anonymous user and the admin user know about. That identifier can then be used to route messages - probably via a Pusher channel. Since the user is anonymous using the session ID as part of a unique channel name for that user seems like a good idea. Alternatively you could make the server respond with a unique ID when the anonymous user sends a request for help. With this in mind, here's a diagram showing a potential way of achieving this: <img src="https://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgQW5vbnltb3VzIFVzZXIgcmVxdWVzdGluZyBhc3Npc3RhbmNlIGZyb20gYW4gQWRtaW4AJAUKCnBhcnRpY2lwYW50ABIGAAUNAB8FABcMU2VydgAED1B1c2hlcgoKbm90ZSByaWdodCBvZgBeBjoAZAdsb2dzIGluIHRvXG5hcHAgYW5kIGF3YWl0cyBoZWxwXG4AgSkHIGV2ZW50cy4KAIEdBS0-AGgGOiBMb2dpbgoAdgYtLT4AVgYAHQgAegY6c3Vic2NyaWJlKGhlbHAtAIF7BylcbmJpbmQoAIIKBy1yZWNlaXZlZCkAgSkGbGVmAIEpBVVzZXI6AII1BmFycml2ZXMgYXQgc2l0ZQpVc2VyAIEACkEAGQUAFAkAgQoJADwFAIF0DwBPBkFKQVgAgwgIAIF8BXN0YXJ0AIFzBSBwcm9jZXNzAF0HKwCBZwhSAIIHB0hlbHAAVA8gQWNrABgIAIFNCF9pZCkAgSAHAIF7EQAYCwCCAwdhAIJWBXJlc3BvbnNlKQCCTgg-LQCCQQd0cmlnZ2VyAII5DSwAgxkJAII4CSxcbgCEXggAewUAhAAGAIMUCAAONwCELxRCb3RoIHRoZQCFVAVcbmFuZAAJBQCFPwVcbm5vdyBoYXZlIGFjY2Vzc1xudG8AKAVgAIISCmAK&amp;s=rose" alt=""> Once the above process has completed the Admin and the anonymous User can now communicate by triggering events on the channel identified by the request_id.
accepted answer of: http://stackoverflow.com/q/28144354
upvote count: 1
answers question: http://stackoverflow.com/q/28144354
has comment: http://stackoverflow.com/comment/44807545
score: 1
has comment: http://stackoverflow.com/comment/117173601
has comment: http://stackoverflow.com/comment/117241615
has comment: http://stackoverflow.com/comment/117339074
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/117248265

http://stackoverflow.com/comment/44759625
type: Comment
comment on: http://stackoverflow.com/q/28195917
type: QuestionComment
has text: `APUnit` ? `APUnit1` ? `APunit1` ? Are you not messing with these terms?
score: 1

http://stackoverflow.com/q/28258943
tagged with: javascript
has body: basically I'm developing this page here: http://host.zadro.co/benchmarc/services.html I need the button and accordion to sync classes. So, if you click on either a letter or an accordion title, the "green" class will always be correct. Any ideas? It's driving me nuts and thinking there has to be any easy way.
score: 0
answer count: 1
has title: Toggle Bootstrap "collapsed" Class On Two Elements
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44973242
tagged with: css
has answer: http://stackoverflow.com/a/28259868
has comment: http://stackoverflow.com/comment/44876649
type: Question
has comment: http://stackoverflow.com/comment/45000190
has comment: http://stackoverflow.com/comment/44876261

http://stackoverflow.com/q/28173210
type: Question
accepted answer: http://stackoverflow.com/a/28174046
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28173285
favorite count: 0
has body: I have a basic form which contains a text field like this: But I want to control if exist any predefined word like "Mickey", If it does not exist, I want to block submitting, like validations in registration forms. This predefined word can be anywhere in textfield like "MickeyMouse" or "MouseMickey" or "MyMickeymouse".
upvote count: 2
has title: Check If String Exists in Text Field
answer count: 3
has answer: http://stackoverflow.com/a/28174046
possible better answer: http://stackoverflow.com/a/28173243
has answer: http://stackoverflow.com/a/28173243
downvote count: 5
tagged with: javascript
score: -3

html5-video
tags question: http://stackoverflow.com/q/28195567
tags question: http://stackoverflow.com/q/28204016
tags question: http://stackoverflow.com/q/28240621
tags question: http://stackoverflow.com/q/28225743
tags question: http://stackoverflow.com/q/28215873
tags question: http://stackoverflow.com/q/28255636
tags question: http://stackoverflow.com/q/28178558
tags question: http://stackoverflow.com/q/28149293
tag name: html5-video
type: Tag
tags question: http://stackoverflow.com/q/28192158
tags question: http://stackoverflow.com/q/28219611
tags question: http://stackoverflow.com/q/28165333
tags question: http://stackoverflow.com/q/28125068

http://stackoverflow.com/comment/44769373
comment on: http://stackoverflow.com/q/28201351
has text: I can reproduce your problem, and I notice that on the first click, the Call Stack says `(anonymous function)` and never enters `test`, while any click after that has the expected Call Stack of `onclick`, followed by `test` on top of `onclick`. Also curious is that the Scope of `(anonymous function)` is Global-only, rather than the usual `with` block scopes and local scope (including a `this` of the clicked input element). You can see this by setting a Watch Expression of `this==window` -- the first time it is `true` and all other times it is sometimes `false`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28240173
upvote count: 5
has answer: http://stackoverflow.com/a/28240213
downvote count: 1
linked to: http://stackoverflow.com/q/54994322
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28240300
has body: I found that both the Array Object and Array.prototype have the length property. I am confused on using the Array.length property. How do you use it? Console.log(Object.getOwnpropertyNames(Array));//As per Internet Explorer outputs: length,arguments,caller,prototype,isArray, Prototype and isArray is usable but how do you use the length property?
type: Question
accepted answer: http://stackoverflow.com/a/28240206
possible better answer: http://stackoverflow.com/a/28240213
tagged with: arrays
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28240387
has answer: http://stackoverflow.com/a/28240206
has title: Array.length vs Array.prototype.length
duplicate of: http://stackoverflow.com/q/54994322
answer count: 4
favorite count: 0

http://stackoverflow.com/a/28180446
answers question: http://stackoverflow.com/q/28180135
score: 0
has body: Go into the Developer Tools of any browser (click F12) and somethere is a small color Pipette (Ithink In IE in the Top Left Corner / FF top right, but you might Need to activate it)
type: Answer

http://stackoverflow.com/q/28166409
tagged with: gulp
favorite count: 0
has answer: http://stackoverflow.com/a/28194648
tagged with: gulp-watch
has answer: http://stackoverflow.com/a/42067530
has answer: http://stackoverflow.com/a/28169405
linked to: http://stackoverflow.com/q/21905875
answer count: 4
upvote count: 11
type: AnsweredQuestion
has body: I'm having a problem with gulp. I run gulp-watch along with gulp-less and gulp-clean. Everything is running perfectly. When I edit somefile.less and I save it with a semi-colon missing or maybe I accidentally leave a trailing ;s, just have errors in my code when saving, gulp-less logs an error in the console. After I fix it gulp-watch continues watching the files, but gulp-less doesn't fire and it doesn't compile. When I stop gulp and run it again in the terminal everything goes back to normal. Here is my gulpfile.js: var gulp = require('gulp'); var clean = require('gulp-clean'); var gutil = require('gulp-util'); var less = require('gulp-less'); var watch = require('gulp-watch'); var path = require('path'); gulp.task('clean', function() { return gulp.src('src/main/webapp/styles/build', {read: false}) .pipe(clean().on('error', gutil.log)) }); gulp.task('less', function() { return gulp.src(['src/main/webapp/styles/main.less'], {base: 'src/main/webapp/styles/'}) .pipe(less().on('error', gutil.log)) .pipe(gulp.dest('src/main/webapp/styles/build')) .on('error', gutil.log); }); gulp.task('watch', function() { watch('src/main/webapp/styles/**/*.{less, css}', function() { gulp.start('less') .on('error', gutil.log); }) }); gulp.task('default', ['clean'], function() { gulp.start(['less', 'watch']) .on('error', gutil.log); }); And here are my devDependencies: "devDependencies": { "gulp": "^3.8.10", "gulp-clean": "^0.3.1", "gulp-less": "^2.0.1", "gulp-util": "^3.0.2", "gulp-watch": "^3.0.0" } Finally, here is the message in the console: [10:21:03] imports/productSearchPage.less was changed [10:21:03] Starting 'less'... [10:21:03] { [Error: Unrecognised input. Possibly missing something in file /src/main/webapp/styles/imports/productSearchPage.less line no. 1008] type: 'Parse', filename: '/src/main/webapp/styles/imports/productSearchPage.less', index: 19127, line: 1008, callLine: NaN, callExtract: undefined, column: 0, extract: [ '', '', undefined ], message: 'Unrecognised input…
possible better answer: http://stackoverflow.com/a/28169405
accepted answer: http://stackoverflow.com/a/28194648
tagged with: gulp-less
type: Question
has answer: http://stackoverflow.com/a/28166546
score: 11
has title: Gulp.js stops compiling LESS when watched after there has been an error in the LESS files
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28221469
tagged with: node.js
tagged with: bluebird
score: 1
has comment: http://stackoverflow.com/comment/44806579
duplicate of: http://stackoverflow.com/q/28250680
type: Question
linked to: http://stackoverflow.com/q/28080290
upvote count: 1
has title: Nested promises with multiple return values
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44816879
favorite count: 0
linked to: http://stackoverflow.com/q/28250680
has body: I'm trying to switch from Async.waterfall to Bluebird promises (performance reason, and also because I think promises are more elegant, but that's another discussion). I have the following code in Async.waterfall: async.waterfall([ function callGoogle(next) { request.get(config.google.meEndpoint, { auth: {bearer: req.body.access_token}, json: true }, next); }, function handleGoogleResponse(response, body, next) { //error handling next(null, body); }, function queryDatabase(googleUserInfo, next) { googleUserModel //.findOne(...), etc. .exec(function (err, usr) { next(err, usr, googleUserInfo); }); }, function handleUser(googleUser, googleUserInfo, next) { //googleUser is my internal representation of a user logged in using Google //googleUserInfo is the information provided by Google //If googleUser exists, I'm done, otherwise I can use googleUserInfo to create a new googleUser }], function done()); The problem I'm facing is that using promises, I get something like this: httpGet(config.google.meEndpoint, { auth: {bearer: req.body.access_token}, json: true }).spread(function handleGoogleResponse(response, body){ //error handling return body; }).then(function queryDatabase(googleUserInfo){ return googleUserModel //.findOne(...), etc. .execAsync(); }).then(function handleUser(googleUser){ //I don't have access to the previous then's googleUserInfo! }); My queryDatabase function has a nested promise (execAsync), so the next then will only get the googleUserModel returned by mongoose. How can I cascade arguments down a promise chain?
tagged with: asynchronous
linked to: http://stackoverflow.com/q/28176140
tagged with: promise
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28141824
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has body: In my ionic app, I use an ng-repeat to display cards, tinder-style. The cards are loaded from a controller which contacts Firebase to source 100 of said objects in an array. Everything works as intended, except the cards don't display until I click the menu button on the upper right of the screen. Then they pop into existence, from not being on the DOM to all of them appearing when I do inspect element. I'm suspicious it has something to do with the organization of the HTML as set up by ionic, but my googling left my lacking and hoping someone here has had a similar experience. Back Left Login Search Browse Cards
tagged with: ionic-framework
type: Question
accepted answer: http://stackoverflow.com/a/28142705
tagged with: javascript
has answer: http://stackoverflow.com/a/28142705
score: 0
answer count: 1
tagged with: angularjs-ng-repeat
has title: ng-repeat not showing up in ionic

http://stackoverflow.com/q/28172785
has answer: http://stackoverflow.com/a/41956034
answer count: 3
has title: Bootstrap datepicker return focus after select
linked to: http://stackoverflow.com/q/20755762
favorite count: 0
tagged with: bootstrap-datepicker
has body: If you initialize a bootstrap datepicker from eternicode with autoclose: true, two undesirable behaviors happen: After the picker closes, when you tab into the next field, you'll start at the beginning of the document again. This can be quite cumbersome on long forms. Because the picker changes the value programatically, any listeners that you have that care about the blur event on the input won't behave properly. The blur actually occurs when you select the picker value and the input's value hasn't changed. Then the bootstrap-datepicker programmatically updates the field so blur is never fired with the new value. Here's a demo in stack snippets: *select any field, select a value from the picker, and then hit Tab $(".datepicker").datepicker({ autoclose: true }); According to the answer to Focus the field after selecting the jQuery UI datepicker, you can tap into the onClose or onSelect events, but the bootstrap picker doesn't offer those events. Simply replacing them with hide doesn't seem to work either, since the refocusing will create an endless loop that always keeps the picker open any time you try to close it. $(".datepicker").datepicker({ autoclose: true }) .on('hide', function () { $(this).focus(); }); Stack Snippet Demo: $(".datepicker").datepicker({ autoclose: true }) .on('hide', function () { $(this).focus(); });
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/36226166
tagged with: datepicker
score: 6
upvote count: 6
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28172787
possible better answer: http://stackoverflow.com/a/36226166
accepted answer: http://stackoverflow.com/a/28172787
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28163308
has body: I think you should do it like this: I am going to change this text, I hope. Style
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44697613
answers question: http://stackoverflow.com/q/28163255

http://stackoverflow.com/comment/44741050
type: Comment
comment on: http://stackoverflow.com/a/28186101
has text: I can do it, but I'm too lazy
type: AnswerComment
score: 0

http://stackoverflow.com/a/28261718
has comment: http://stackoverflow.com/comment/44880735
type: Answer
has comment: http://stackoverflow.com/comment/44881156
has comment: http://stackoverflow.com/comment/44881719
has comment: http://stackoverflow.com/comment/44880583
has comment: http://stackoverflow.com/comment/44881191
has comment: http://stackoverflow.com/comment/44880832
has comment: http://stackoverflow.com/comment/44891519
has comment: http://stackoverflow.com/comment/44880852
has body: You can't work with Numbers as a single number while it's an array. First generate random number n, then put that into FB link. var Numbers = [1,2,3]; var n = Numbers[Math.floor(Math.random() * 3)]; var link = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=" + n; // alert(link); http://jsfiddle.net/8u3b8q1x/ Update due to the comments below: &lt;script&gt; var Numbers = [1,2]; var n = Numbers[Math.floor(Math.random() * 2)]; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=" + n; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); FB.ui({ method: 'apprequests', data: n, message: davet_m, title: davet_t, to: string}); // here should be probably 'data: js.src' instead of 'data: n', I don't know FB API. // where are defined davet_m, davet_t, string variables? &lt;/script&gt;
answers question: http://stackoverflow.com/q/28261684
has comment: http://stackoverflow.com/comment/44881172
has comment: http://stackoverflow.com/comment/44881128
has comment: http://stackoverflow.com/comment/44880608
has comment: http://stackoverflow.com/comment/44880955
has comment: http://stackoverflow.com/comment/44891834
has comment: http://stackoverflow.com/comment/44881171
has comment: http://stackoverflow.com/comment/44880905
accepted answer of: http://stackoverflow.com/q/28261684
has comment: http://stackoverflow.com/comment/44881181
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44884076
score: 0

http://stackoverflow.com/comment/44859170
comment on: http://stackoverflow.com/q/28249734
type: Comment
score: 0
has text: Possibly you can go for `lazy loading`, e.g. [rpnzl](http://rpnzl.com/code/lazyjson-v1.0/demo)
type: QuestionComment

http://stackoverflow.com/comment/44913399
score: 0
type: Comment
has text: I agree with you that one should at least *try* to solve an issue by oneself. But that's because this is the most effective way of learning. If he c&p's this and is asked question on what the script is actual doing, he will find that this wasn't the best idea. I'll add some link to MDN, though. No offense, I see your point. I just think the situation isn't *that* bad.
type: AnswerComment
comment on: http://stackoverflow.com/a/28279613

http://stackoverflow.com/comment/44657009
comment on: http://stackoverflow.com/q/28142654
type: Comment
type: QuestionComment
has text: See [ECMAScript 5.1 Section 11.2.1 Property Accessors](http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.1)
score: 0

securityexception
tags question: http://stackoverflow.com/q/28272933
tag name: securityexception
type: Tag

http://stackoverflow.com/comment/131885387
has text: `arr.map(item => ({ ...defaults, ...item });`
type: AnswerComment
comment on: http://stackoverflow.com/a/28171330
type: Comment
score: 0

http://stackoverflow.com/a/28216267
score: 0
has comment: http://stackoverflow.com/comment/44797117
type: Answer
answers question: http://stackoverflow.com/q/28215821
has body: You maybe want to wrap it in a function? &lt;a onclick="doSomething('123456789')" href="tel:&lt;this phone number needs to be dynamic as well&gt;"&gt;Call this number: &lt;/a&gt; &lt;script language="javascript" &gt; function doSomething(telNumber){ var tel = telNumber; key = getVar("keyword"); tn = getVar("tfid"); source = getVar("source"); content = getVar("content"); campaign = getVar("campaign"); if(tn!="") { setcookie(key,tn); } getcookie(); } &lt;/script&gt;

http://stackoverflow.com/q/28214563
downvote count: 0
tagged with: javascript
has title: Magnific Popup blocked by Adblock (uBlock)
favorite count: 0
linked to: http://stackoverflow.com/q/28028932
tagged with: adblock
has comment: http://stackoverflow.com/comment/45393082
answer count: 0
tagged with: magnific-popup
type: UnansweredQuestion
upvote count: 1
has body: The open source shopping platform NopCommerce uses magnific popup (mp) on various occasions. I found that since a few days mp is being blocked by either Adblock Edge and uBlock. Certain pages become unusable since scripts that are usually loaded after mp are not loaded at all any longer. This happens because the browser will throw an exception on not being able to find the function mp exposes to use its functionality: TypeError: $(…).magnificPopup is not a function This basically breaks any web page using adblock and mp together.
score: 1
type: Question
tagged with: nopcommerce

http://stackoverflow.com/comment/44702007
type: AnswerComment
has text: Now i am using simple MVC model Sir
type: Comment
comment on: http://stackoverflow.com/a/28165102
score: 0

http://stackoverflow.com/comment/44760601
has text: Thank you for including the explanation! It is almost working, it won't accept the `2` or `7`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28195513
type: Comment

http://stackoverflow.com/a/28267853
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/76707551
downvote count: 0
has body: Damn. I had the question written up, but that last line I wrote made me think again. I went back to http://underscorejs.org and opened the browser console, and ran my code snippet there. It performed as expected, returning an empty object! I tried it with lodash 3.0.1 (released just two days ago!), and it also works as expected. I've since confirmed that I can't get lodash 2.4.1's _.omit to work with any predicate function. I guess there's a bug in lodash 2.4.1. That version was stable for quite a while, so I'm sure it's widespread, and I won't just throw away my question. Given the level of abstraction behind _.omit, I suspect that this bug affects other functions as well. I hope this helps someone.
accepted answer of: http://stackoverflow.com/q/28267852
has comment: http://stackoverflow.com/comment/76727787
answers question: http://stackoverflow.com/q/28267852
type: Answer
has comment: http://stackoverflow.com/comment/60348032
score: 4

http://stackoverflow.com/q/28270886
has comment: http://stackoverflow.com/comment/44897362
score: 0
linked to: http://stackoverflow.com/q/3076414
has comment: http://stackoverflow.com/comment/44897896
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: I have a question would like to ask you , is it possible to check if the url of website is embeddable with Iframe or not? I have try many website in Iframe,and it has shown the good result, which means it work but just a few website is not embeddable, although I would like to ask you how to alert if the website is not embeddable with jQuery. eg. 1- http://www.forbes.com/video/2590105606001/ (show blank in Iframe) 2- http://news.sabay.com.kh/article/260880 (show result in Iframe) so, how could I solve the first (number 1) problem.
has title: How to check if the url website is emebedable with iframe or not with jQuery
answer count: 0
type: Question

http://stackoverflow.com/a/28179266
type: AcceptedAnswer
has body: So the twitter button gets wrapped inside an iframe. When tweet button gets rendered as a hypertext link, this iframe does not wrap the div anymore. So I checked if the iframe exists or not and accordingly display/hide the Tweet button.
type: Answer
accepted answer of: http://stackoverflow.com/q/28173169
score: 0
answers question: http://stackoverflow.com/q/28173169

http://stackoverflow.com/a/28171864
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28171743
score: 4
has comment: http://stackoverflow.com/comment/44712857
answers question: http://stackoverflow.com/q/28171743
has comment: http://stackoverflow.com/comment/44712948
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/44712899
downvote count: 0
has body: You need to use traversal methods: $(document).ready(function(){ $(document).on("click", ".btn" , function(e) { e.preventDefault(); var myuser = $(this).closest('div').find('.user_name').text(); console.log(myuser); }); }); Click John: Hello! Click Jeff: Hi! Click Jane: Whats up?! Note how I've moved the button out of the span so that its text is not included in the result. Alternatively, you could use an input:
has comment: http://stackoverflow.com/comment/44712847

http://stackoverflow.com/q/28222624
has comment: http://stackoverflow.com/comment/44808619
score: 0
has comment: http://stackoverflow.com/comment/44809342
tagged with: javascript
tagged with: extjs
tagged with: sencha-touch-2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm working in Sencha Touch framework, I've created to boxes (for example) and want to give the outterbox relative to the innerbox, which has fixed position. But unfortunatly, my image wont show if the position is kept as relative (any one of that wont show if it has a relative positon property). My Question is, how can I relate two CSS classes/id in Extjs/javascript as my target is to give them a rotation, only possible when they have this property according to my knowledge. Any other suggestions are welcomed. #outterbox { width: 100% ; height: 100% ; background-image:url('outterbox.png'); position: relative; // not showing } #innerbox { width: 100% ; height: 100% ; background-image:url('innerbox.png'); position: fixed; }
tagged with: css
answer count: 0
has comment: http://stackoverflow.com/comment/44808436
type: Question
has title: relative postion css extjs Sencha touch

http://stackoverflow.com/comment/44651836
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28139723
type: AnswerComment
has text: Thanks Banana, you can look my final solution.

acrobat
type: Tag
tags question: http://stackoverflow.com/q/28234427
tags question: http://stackoverflow.com/q/28159688
tag name: acrobat

http://stackoverflow.com/comment/102027410
score: 0
comment on: http://stackoverflow.com/a/28223205
type: Comment
type: AnswerComment
has text: I was having a similar issue. My touch events were triggering a context menu. It appears touch events invoke mouse events after. You can stop this by calling "preventDefault()" within the touch event handler (touchDown, etc). This fixed the issue for me; I didn't need to preventDefault() within the context menu handler.

http://stackoverflow.com/comment/44848902
type: QuestionComment
type: Comment
has text: @RickHitchcock I guess I knew this, but I'm looking for an alternative.
comment on: http://stackoverflow.com/q/28243923
score: 0

http://stackoverflow.com/comment/44737097
score: 0
type: Comment
type: QuestionComment
has text: once you have done a request, do all three placeholders have the same ID?
comment on: http://stackoverflow.com/q/28183815

http://stackoverflow.com/q/28191841
has answer: http://stackoverflow.com/a/28191908
type: AnsweredQuestion
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/28191902
has answer: http://stackoverflow.com/a/28191929
accepted answer: http://stackoverflow.com/a/28191889
tagged with: php
has answer: http://stackoverflow.com/a/28191976
score: -1
has comment: http://stackoverflow.com/comment/44750837
has body: Someone using firebug or chrome console could intercept the submitted form data and then switch some of the values, eg. Sender's ID . I was wondering if I can make data sent less human readable so the attacker won't want to deal with it. I saw something like this: $.ajax({ type: "POST", url: 'http://www.example.com/widget_category.php', data: "p=[binary]", dataType:'html', success: function(res){ $('#limwidget').empty().append(res); } }); Edit: I see this question was accepted bad. I just want to point out that i am validating all data received on the server side and there should be no question about that, but I just wanted to hide the real sensitive data from database ( and maybe make them also timestamp signed in some manner and different from user to user). I realize that maybe this problem should be considered on server-side(php), that all sensitive data should be swaped on server-side instead of client-side, so we can avoid security by obscurity. Thanks for clarifying One more edit: I see now that output from atob function from the example given [binary] is {"TrazeniPojam":"","IDGrupa":"307","IDPodGrupa":307,"Prodavac":"","Okruzi":[],"Opstine":[],"CenaOd":-1,"CenaDo":-1,"StanjaPredmeta":[],"NaciniPlacanja":[],"Filter":[]} so I guess that it's useless to start hiding data on client-side.
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44750845
has comment: http://stackoverflow.com/comment/44750915
answer count: 5
tagged with: javascript
has title: How can i make jQuery(javascript) ajax form data sent less human readable?
has answer: http://stackoverflow.com/a/28191889
possible better answer: http://stackoverflow.com/a/28191908

http://stackoverflow.com/q/28174373
type: UnansweredQuestion
has title: how to get element from XMLHttpRequest
has answer: http://stackoverflow.com/a/28177954
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/28174555
has body: im trying to get a element from the url html file. element Thu Dec 18 10:33:19 EST 2014 which is in the url html page that is passed into loadHTML function. which sends the html page string to another function called handler. from the parser is it possible to get the specific . function loadHTML(spanId, url) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", url, true); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 /* complete */) { handler(xmlhttp.responseText, spanId); } }; xmlhttp.send(); } function handler(responseText, spanId) { var parser =new DOMParser(); parser.getDocument() //get the date/time from parser var dateTime = … //get class name from parser var className = … var span = document.getElementById(spanId); span.innerHTML = dateTime; span.className = className; }
answer count: 2
tagged with: javascript
score: 0
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0

http://stackoverflow.com/comment/44904481
type: AnswerComment
has text: @davidmarko in defence of Sameer, you did tag the question with jQuery. I would suggest you edit your question to remove that tag if you don't want jQuery related answers.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28274845

http://stackoverflow.com/comment/44810044
has text: Done. By the way I got another question. Whats the difference between .css and .animate?
type: Comment
comment on: http://stackoverflow.com/a/28203418
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45865847
has text: @MikeAnthony I don't have this problem on my site. http://www.bundlequest.com See here how it happens to work for you too?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28246523
type: AnswerComment

http://stackoverflow.com/comment/44689022
has text: Is there any chance you're playing that audio twice? I don't hear a buffer problem, it sounds to me like phasing.
comment on: http://stackoverflow.com/q/28141139
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28180166
answer count: 1
tagged with: templates
favorite count: 0
tagged with: frontend
has title: How does underscore replace variables?
has body: I have following row in code: terminalsListHtml += this.compiled(_.extend(this.terminals[i], {clazz: 'all'}, obj)); Behaviour of execution this row is surprising for me. I evaluate argument value of this.compiled method. It looks like this: more details: compiled: _.template($('#terminal-template').text()) Lets return to first row whos result is surprising for me: it returns following result: this.compiled(_.extend(this.terminals[i], {clazz: 'all'}, obj)); " Second Lenina, 5 Second Проходимость: 10 чел./час Стоимость: 5 руб./час Количество свободных слотов: 10 " As we can see {{imageId}} was replaced with 1. I don't understand where does this 1 takes. Please clarify. P.P.S. Sorry for screenshots instead of copied code. I wanted to pasted code but it render bad.
type: AnsweredQuestion
downvote count: 0
tagged with: underscore.js
score: 1
type: Question
has answer: http://stackoverflow.com/a/28180350
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28180350
has comment: http://stackoverflow.com/comment/44730631
upvote count: 1

http://stackoverflow.com/q/28155624
tagged with: jquery
has comment: http://stackoverflow.com/comment/44683787
has answer: http://stackoverflow.com/a/32328046
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44682999
tagged with: local-storage
has comment: http://stackoverflow.com/comment/44687927
has comment: http://stackoverflow.com/comment/44683915
has comment: http://stackoverflow.com/comment/44682710
has body: why is it that the $localStorage.mydata is not removed when using $localStorage.removeItem('mydata') ? $localStorage.mydata is still present even I already fired up this function. .controller('myCtrl', function($scope, $localStorage) { $scope.logout = function() { $localStorage.removeItem('mydata'); alert('Success!'); }; });
type: Question
has title: Ionic Framework (Angularjs) $localStorage not removed
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28167176
answers question: http://stackoverflow.com/q/28165946
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: There are links to all the downloads here: http://code.highcharts.com/ The highcharts-more download indicates it is v4.0.4. From this, I presume that highcharts-more is still required as a separate download.
downvote count: 0
has comment: http://stackoverflow.com/comment/44705593
score: 1
accepted answer of: http://stackoverflow.com/q/28165946

http://stackoverflow.com/q/28195465
has answer: http://stackoverflow.com/a/28195608
has comment: http://stackoverflow.com/comment/44757749
answer count: 4
has comment: http://stackoverflow.com/comment/44757675
type: AnsweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28196085
has answer: http://stackoverflow.com/a/28195657
tagged with: javascript
has answer: http://stackoverflow.com/a/28195614
has comment: http://stackoverflow.com/comment/44757751
possible better answer: http://stackoverflow.com/a/28195614
downvote count: 0
score: 1
has title: Angular JS ngShow and ngHide
accepted answer: http://stackoverflow.com/a/28196085
favorite count: 0
tagged with: angularjs
has body: I can't figure out why the ngShow and ngHide directives aren't working. Here is a simplified version of the problem. content here content here In controller $scope.showContent = false; $scope.myFunction = function() { $scope.showContent = true; } The "contactInfo" div never shows when I click the "callFunction" div.

http://stackoverflow.com/a/28259220
has body: Each modal should have a different id, the data-target for each button should be the id of each modal. Example: .... ... ... .... ... ... Each button should be something like: Button1 Button1
answers question: http://stackoverflow.com/q/28259146
downvote count: 0
score: 7
upvote count: 7
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28259146

http://stackoverflow.com/a/28129240
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28129198
has comment: http://stackoverflow.com/comment/44634727
type: Answer
score: 0
has body: Try this var time = data.fields.time[0].split(' - '); time = time[1] || time[0] || ''; Example
accepted answer of: http://stackoverflow.com/q/28129198

http://stackoverflow.com/comment/44877250
score: 0
type: AnswerComment
has text: This should be posted as a separate question. And I don't fully understand it. Why would you add the camera to the player and not the scene? Do you want the camera to follow the player? There are several SO posts on how to do that.
type: Comment
comment on: http://stackoverflow.com/a/28243186

http://stackoverflow.com/comment/44754752
type: QuestionComment
comment on: http://stackoverflow.com/q/28193902
has text: you should share the commentType class as well.
score: 0
type: Comment

http://stackoverflow.com/a/28234974
type: Answer
has body: HTML: &lt;img id="myImg" src="image.gif"&gt; JavaScript: document.getElementById("myImg").onerror = handleErrors(); function handleErrors() { document.getElementById("myImg").src = "http://blog.stackoverflow.com/wp-content/uploads/stackoverflow-logo-300.png"; return true; } Give an ID to image and use this for call your function: document.getElementById("myImg").onerror = handleErrors(); Giving an ID is more suitable way.
score: 0
answers question: http://stackoverflow.com/q/28234698

http://stackoverflow.com/q/28158472
has comment: http://stackoverflow.com/comment/44688596
upvote count: 2
has comment: http://stackoverflow.com/comment/44688230
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: if-statement
has title: JavaScript evaluates differently every time
has body: When I came back to work this morning I could reload and see the weird behavior, after restarting the server it was gone. I can not recreate it. So the question is "solved", feel free to delete it, I am not sure if I am allowed to do so. I try to return the window and document height on a resize event. Based on their values, I try to do the following using an if/else statement (Very basic but it doesn't seem to work, so I logged the data): Inside the if statement I logged "TRUE [number one] &gt;= [number two]" inside the else statement I logged "FALSE [number one] &gt;= [number two]". This was triggered on a window resize event. Then I resized the window horizontally, so the height values do not change. With two identical numbers I assumed that it logs always the TRUE part but output is: [...] TRUE 548 &gt;= 548 FALSE 548 &gt;= 548 TRUE 548 &gt;= 548 FALSE 548 &gt;= 548 TRUE 548 &gt;= 548 FALSE 548 &gt;= 548 TRUE 548 &gt;= 548 FALSE 548 &gt;= 548 [...] The type of the value is always "number", it is always an integer, no float. I also "Tested" in IE9 and FF35. Can someone explain what is going on? How can I avoid this behaviour? Thank you! EDIT: My original question was edited. It is o.k. to improve my English (I am still learning the language), but now the question is a different one as you see in the first answer. I did NOT ask how to get the height of the elements (so "I try to return ..." is not my intention), my question is about the behaviour of the if statement with two given equal values. I just tried to explain how I got there. – There is a difference between eliminating spelling errors and interpreting the text to another meaning.
score: 1
has answer: http://stackoverflow.com/a/28158833
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28166025
has body: I am trying to wrap two elements around a div, but my code is not working as expected. Here is my HTML: Password help text Here is what I want my HTML to look like: Password help text As you can see, I am trying to wrap the input and span tags in a . I have tried using the following jQuery snippets but to no avail: //This only wraps the span $("#form-group input").next().wrap(' '); I have also tried this: //This only wraps the input $("#form-group input").wrap(' ');
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28166042
tagged with: css
favorite count: 0
has title: Wrap two HTML elements in DIV with jQuery
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28166479
answer count: 4
has answer: http://stackoverflow.com/a/28812632
type: Question
tagged with: jquery-selectors
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28166183

http://stackoverflow.com/comment/44626687
type: Comment
comment on: http://stackoverflow.com/q/28122948
has text: You are already using jQuery - why not just do `var get = $.get`? - jQuery's ajax methods already return promises and have done so for years.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28272025
upvote count: 2
type: Answer
has body: ES5 spec follows IEEE 754 specification And the ECMAScript Intl API specification refers to ES5 spec for base types.
score: 2
accepted answer of: http://stackoverflow.com/q/28230012
downvote count: 0
answers question: http://stackoverflow.com/q/28230012
type: AcceptedAnswer

http://stackoverflow.com/comment/44704556
comment on: http://stackoverflow.com/q/28167051
type: Comment
has text: X - i.e. the close button in the corner of every webpage...
score: 0
type: QuestionComment

http://stackoverflow.com/q/28207114
tagged with: datetime
type: AnsweredQuestion
has body: Can someone explain how to add the UTC offset to getUTCHours so that it returns the correct hours? I know that it is currently 9:36pm MST. We currently are on Daylight saving time so we have a UTC offset of -6. So I would expect that if I add the offset to getUTCHours then I should get 21. Instead I get -2. What am I doing wrong? var offset=-6; var dt = new Date(); var h=dt.getUTCHours(); var hour=h+offset; console.log(hour);
type: Question
possible better answer: http://stackoverflow.com/a/28207318
has answer: http://stackoverflow.com/a/28207318
tagged with: javascript
has title: Using getUTCHours and adding the UTC offset in javascript
has answer: http://stackoverflow.com/a/28207267
score: 0
accepted answer: http://stackoverflow.com/a/28207267
answer count: 2

http://stackoverflow.com/comment/44881099
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28261912
has text: Consider sharing a chunk of code. Can you extract the minimal code snippet required to reproduce this behavior?

http://stackoverflow.com/a/28200971
answers question: http://stackoverflow.com/q/28200125
has comment: http://stackoverflow.com/comment/44777260
score: 9
upvote count: 12
has comment: http://stackoverflow.com/comment/44768468
has comment: http://stackoverflow.com/comment/60710085
type: Answer
has body: Angular's ngMouseenter directive fires an event whose type is mouseover, as you can see in this plunker. The difference from ngMouseover is that it's fired only once - when mouse enters the element, not after every movement within this element too. Enter Event type: {{lastEventType}}
downvote count: 3

http://stackoverflow.com/q/28135991
downvote count: 0
score: 1
type: Question
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34716288
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28136286
has body: I am trying to get bootstrap-datetimepicker to work the way I want it to. Normally the datetime selector only pops up when clicked on the icon. But I want it to pop up when clicked on the field and on the icon. I found out that if I added the same class (datepicker) on the input field the popup will appear when clicked on the field, which is what I want. The problem however is that if I click on the field first and then the icon the date picker that popped up when clicked on the field does not disappear. Which means there ends up being two date pickers on the screen. However if I click on the glphyicon first and then the field it works properly. As in, when the field is clicked the date picker on time disappears and the on field appears. How do I make it so that the same thing happens if the field is clicked first and then the icon. Here is the javascript codes that calls datetimepicker: $(document).on('ready page:change', function() { $('.datepicker').datetimepicker({ format: 'MMM Do YYYY', pickTime: false, collapse: true }); });
tagged with: datetimepicker
upvote count: 1
has answer: http://stackoverflow.com/a/28136286
favorite count: 0
tagged with: twitter-bootstrap-3
has title: Get bootstrap-datetimepicker to appear on field and on icon, without duplicating
has answer: http://stackoverflow.com/a/34716288
tagged with: ruby-on-rails
type: AnsweredQuestion

http://stackoverflow.com/comment/44748346
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28189165
has text: If I were to choose between using [`slice`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/slice), [`substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) or [`substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) then I would opt for `slice`. The ES6 [`endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) does not have wide enough support yet. You could also `split('.')` and `pop`.
type: AnswerComment

http://stackoverflow.com/q/28268665
has body: Is it possible to display message/description when a user chooses an option from a dropdown menu. Example: if user chooses "London" from the dropdown menu then we want to display a message from the a database/file relating to "London" ideally using Ajax so not to reload the page. Thanks in advance.
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28268844
favorite count: 0
type: Question
has title: gravity forms Displaying a message from dropdown select
answer count: 1
tagged with: wordpress
upvote count: 1
tagged with: gravity-forms-plugin
has answer: http://stackoverflow.com/a/28268844

http://stackoverflow.com/q/28122784
answer count: 2
possible better answer: http://stackoverflow.com/a/28123031
has title: Jtable An error occured while communicating to the server. - post 500 error
tagged with: jquery-mobile
tagged with: javascript
has answer: http://stackoverflow.com/a/28123031
favorite count: 0
tagged with: jquery-jtable
upvote count: 1
has answer: http://stackoverflow.com/a/28126153
downvote count: 1
type: AnsweredQuestion
tagged with: c#
accepted answer: http://stackoverflow.com/a/28126153
has body: when i am adding a new record i have the above error below is my code, i am stuck done some search on google but i am going nowhere i would be greateful if someone can point me in the right direction. $('#dataContent').jtable({ title: 'Data List', paging: true, pageSize: 5, actions: { listAction:'/Test.aspx/GetAllCars', createAction: 'Test.aspx/CreateCar' }, fields: { ID: { key: true, create: false, edit: false, list: false }, Make: { title: 'Make', width: '20%' }, Model: { title: 'Model', width: '20%' }, Engine: { title: 'Engine', width: '20%' }, Year: { title: 'Year', width: '20%' } } }); $('#dataContent').jtable('load'); }); [WebMethod(EnableSession = true)] public static Object CreateCar(Car c) { try { bool addresult = new CarRepo().CreateCar(c); return new { Result = "OK" }; } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } } public bool CreateCar(Car c) { using(var context = new DAL.DbAccess.DataContext()) { try { var Irepo = new DAL.Repository.MainRepository&lt;Car&gt;(context); Irepo.Insert(c); return true; } catch(Exception ex) { ex.ToString(); return false; } } } POST http://localhost:51598/Test.aspx/GetAllCars 200 OK 4ms jquery-....min.js (line 3) POST http://localhost:51598/Test.aspx/CreateCar 500 Internal Server Error 7ms jquery-....min.js (line 3) HeadersPostResponseJSON {"Message":"Invalid web service call, missing value for parameter: \u0027c\u0027.","StackTrace":" at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary2 parameters)\r\n at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary2 parameters)\r\n at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}
type: Question
tagged with: jquery-plugins
score: 0

http://stackoverflow.com/a/28167425
score: 1
downvote count: 0
type: Answer
has body: Remove the g (global) flag. &gt; var reg= /[-!*() ~{}'&lt;&gt;._a-zA-Z0-9]/; undefined &gt; var arr= ["-", ".", "!", "~", "*", "(", ")", "'", "_","&lt;","&gt;"]; undefined &gt; for(var i=0 ;i &lt; arr.length;i++) ... { ... console.log( arr[i] +" " + reg.test(arr[i])); ... } - true . true ! true ~ true * true ( true ) true ' true _ true &lt; true &gt; true
answers question: http://stackoverflow.com/q/28167296
upvote count: 1
has comment: http://stackoverflow.com/comment/44705674

http://stackoverflow.com/a/28217645
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28217490
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/44798989
has comment: http://stackoverflow.com/comment/44799018
upvote count: 3
has comment: http://stackoverflow.com/comment/44798747
has body: You shouldn't prevent default when using native JS for dragging. See here: var drag = document.getElementById('drag'), drop = document.getElementById('dropped'); drag.addEventListener('dragstart', function(e) { console.log('drag'); }) drop.addEventListener('drop', function(e) { e.preventDefault(); console.log(e); alert('dropped!'); }) drop.addEventListener('dragover', function(e) { e.preventDefault(); }) #dropped { background: #000; width: 400px; height: 400px; } Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi eveniet illo, nisi placeat neque voluptatem sit ipsam corporis. Veritatis dicta perspiciatis temporibus error amet. Laborum, vero amet magnam nihil debitis! A little explanation about preventDefault() and where and why it should be used: Calling the preventDefault method during both a dragenter and dragover event will indicate that a drop is allowed at that location. However, you will commonly wish to call the preventDefault method only in certain situations, for example, only if a link is being dragged. To do this, call a function which checks a condition and only cancels the event when the condition is met. If the condition is not met, don't cancel the event, and a drop will not occur there if the user releases the mouse button. A listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped. Most areas of a web page or application are not valid places to drop data. Thus, the default handling for these events is to not allow a drop. If you want to allow a drop, you must prevent the default handling by cancelling the event. You can do this either by returning false from an attribute-defined event listener, or by calling the event's event.preventDefault method. The latter may be more feasible in a function defined in a separate script. In a web page, you should call the preventDefault method of the event if you have accepted the drop so that the default browser handlin…
has comment: http://stackoverflow.com/comment/44799204
accepted answer of: http://stackoverflow.com/q/28217490

promise
tags question: http://stackoverflow.com/q/28221469
tags question: http://stackoverflow.com/q/28160811
tags question: http://stackoverflow.com/q/28122948
tags question: http://stackoverflow.com/q/28174167
tags question: http://stackoverflow.com/q/28134271
tags question: http://stackoverflow.com/q/28187228
tags question: http://stackoverflow.com/q/28182052
tags question: http://stackoverflow.com/q/28224896
tag name: promise
tags question: http://stackoverflow.com/q/28200018
tags question: http://stackoverflow.com/q/28218364
tags question: http://stackoverflow.com/q/28276454
type: Tag
tags question: http://stackoverflow.com/q/28191954
tags question: http://stackoverflow.com/q/28247389
tags question: http://stackoverflow.com/q/28250680
tags question: http://stackoverflow.com/q/28194853
tags question: http://stackoverflow.com/q/28238074
tags question: http://stackoverflow.com/q/28164642
tags question: http://stackoverflow.com/q/28275038
tags question: http://stackoverflow.com/q/28218329
tags question: http://stackoverflow.com/q/28176140
tags question: http://stackoverflow.com/q/28222439
tags question: http://stackoverflow.com/q/28168610
tags question: http://stackoverflow.com/q/28146276
tags question: http://stackoverflow.com/q/28237271
tags question: http://stackoverflow.com/q/28227399
tags question: http://stackoverflow.com/q/28267376

http://stackoverflow.com/comment/44826108
comment on: http://stackoverflow.com/q/28231825
has text: You can create a new array, have the first array to = the link for the first image, second array for the second image. Add array[x] for the links and have it display or whatever it is you wish to do with it.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44701090
has text: @PassionateDeveloper: Well, you start all these requests without waiting for each other. However, you are only looking at the result of the first request?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28164642

http://stackoverflow.com/a/28152245
answers question: http://stackoverflow.com/q/28152191
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28152191
type: Answer
has body: No need for recursion, you can use closest(): $clickedElement.click(function() { var $parent = $(this).closest('[data-status], [data-state], #main-container'); });
score: 4
has comment: http://stackoverflow.com/comment/44676289
upvote count: 4

http://stackoverflow.com/comment/44799018
type: Comment
has text: So why in the other events here you did not do this?
type: AnswerComment
comment on: http://stackoverflow.com/a/28217645
score: 0

http://stackoverflow.com/q/28276402
has comment: http://stackoverflow.com/comment/44907282
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44907219
downvote count: 6
has title: Auto refresh PHP script backend
type: AnsweredQuestion
tagged with: php
accepted answer: http://stackoverflow.com/a/28277131
has comment: http://stackoverflow.com/comment/44907740
possible better answer: http://stackoverflow.com/a/28276757
type: Question
has answer: http://stackoverflow.com/a/28276757
linked to: http://stackoverflow.com/q/333664
has comment: http://stackoverflow.com/comment/44907579
has body: I'm looking for a script that will automatically update a page but not reload it. I have one example, these divs are automatic reloading: http://prntscr.com/603k2n It's not my page of course, here is link: http://suna.e-sim.org/battle.html?id=13317 (you will need to register). I tried with jQuery but it won't reload PHP, just HTML. I need to reload MySQL and PHP - is it even possible? i see this guys are made it.
has comment: http://stackoverflow.com/comment/44907339
tagged with: mysql
has comment: http://stackoverflow.com/comment/44907439
answer count: 2
has comment: http://stackoverflow.com/comment/44907518
has comment: http://stackoverflow.com/comment/44907646
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44907283
score: -6
favorite count: 0
has answer: http://stackoverflow.com/a/28277131
has comment: http://stackoverflow.com/comment/44907760

http://stackoverflow.com/comment/44780675
comment on: http://stackoverflow.com/a/28207595
score: 0
type: AnswerComment
has text: @TechCrunch So if you have control over `responseMseg` and `errors`, and the way how they're returned, simply change it to be an `object` and not `string`.
type: Comment

http://stackoverflow.com/comment/44772928
has text: So the `modify_array` function that is originally 3 lines of C code translated to 9.8k LOC?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28202744

http://stackoverflow.com/a/28226812
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28226769
has body: I would just use a single template that looks like this: &lt;div ng-switch="dtype"&gt; &lt;directive-one ng-switch-when="directiveOne"/&gt; &lt;directive-two ng-switch-when="directiveTwo"/&gt; ... &lt;/div&gt; Add dtype: '@' to the scope of myDirective and Bob's your uncle. Edit: missed the ng-repeat. I would just remove myDirective entirely, because the whole thing is just equivalent to: &lt;directive-one/&gt; &lt;directive-two/&gt; ...
has comment: http://stackoverflow.com/comment/44844799

http://stackoverflow.com/comment/44690009
has text: I googled "history of Javascript", but none of the pages I checked have any details about the original syntax.
type: Comment
comment on: http://stackoverflow.com/q/28159189
score: 0
type: QuestionComment

http://stackoverflow.com/q/28217000
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44798059
type: Question
has title: C3JS - Text is too long c3-legend-item-event / background does not wrap
has comment: http://stackoverflow.com/comment/44797520
downvote count: 0
tagged with: javascript
tagged with: c3
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/44798176
has comment: http://stackoverflow.com/comment/44797555
tagged with: angularjs
has body: I am trying to make the Legend text to wrap by setting up some width limits. No matter what I tried I cannot figure out how to lessen the width of the ".c3-legend-item-event" so it can get to two lines or more, otherwise the text is so long that goes outside of my html. The legend is set to: legend: {position: 'inset'} and then I moved it toward the right of the graph but no way I can wrap or make it break to two lines or more. I read examples with jQuery to append your own Legend that is easily modified, however, I would like to avoid it. I also have no control over the data feed and cannot shorten the Legend text. Reference to the graph I am using to see the source code is here: http://c3js.org/samples/chart_bar.html Reference to legend options and setup is here: http://c3js.org/reference.html Here is the a part of my code: var bar = c3.generate({ legend: { position: 'inset', inset: { x: 300, y: 40, } }, data: { columns: list, type: 'bar', onclick: function (d, element) { console.log("onclick", d, element); }, onmouseover: function (d) { console.log("onmouseover", d); }, onmouseout: function (d) { console.log("onmouseout", d); }, order: "asc" }, bar: { width: { ratio: 0.7, //max: 50 }, }, }); Any help is appreciated. Thank you.
upvote count: 4
tagged with: css

http://stackoverflow.com/comment/44905218
comment on: http://stackoverflow.com/a/28273246
score: 0
type: Comment
has text: Thanks, I think the user can still input new lines in Chrome by pressing the enter key and not releasing though ...
type: AnswerComment

http://stackoverflow.com/a/28267969
answers question: http://stackoverflow.com/q/28267501
score: 0
type: Answer
has body: I've written something similar for performing a regex replace on fields nested within my object which matched a given pattern. I then mixed it into the underscore/lodash object so I could use it like you're wanting to do. Modified for your purposes it could look something like this: function(obj) { var $this = this, checkField = function(field) { if (typeof field === "undefined" || field === null || typeof field === "boolean") { return false; } else { return field; } }, checkObject = function(obj) { if (obj instanceof Object) { Object.getOwnPropertyNames(obj).forEach(function (val) { if (obj[val] instanceof Array) { obj[val] = checkArray(obj[val]); } else if (obj[val] instanceof Object) { obj[val] = checkObject(obj[val]); } else { obj[val] = checkField(obj[val]); } }); return obj; } else if (obj instanceof Array) { return checkArray(obj); } else { return checkField(obj); } }, checkArray = function(arr) { if (arr instanceof Array) { arr.forEach(function(val) { if (val instanceof Object) { obj[val] = checkObject(val); } else { obj[val] = checkField(val); } }); return arr; } else { return arr; } }; obj = checkObject(obj); } To add it as a mixin: window._.mixin({ setBoolsAndSuchToFalse: function(obj) { . . . . // The contents of the function from above } });

http://stackoverflow.com/a/40473384
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28166583
downvote count: 0
has body: replace : 'mode' =&gt; 'iframe' with 'hosted_checkout' =&gt; ['mode' =&gt; 'iframe']
type: Answer

http://stackoverflow.com/q/28196960
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28197080
has title: Run .each() based on elements within specific tab
tagged with: jquery
type: Question
has body: I've got a layout with something to this effect: Some Title Some content Some Stats Title Some Stats content Some Title Some content Some Title Some content Some Title Some content And on and on...Each main div serves as a jquery ui tab. So basically I've got tabs (as divs with the following IDs: issueWidgets, projectWidgets, and userWidgets). These divs contain some portlet divs (these are just divs that act as widgets within each column (div class=column). I've got code that looks for each class with name column to create some cookie information like so: // function that writes the list order to a cookie function saveOrder() { $(".column").each(function(index, value){ var colid = value.id; var cookieName = "cookie-" + colid; // Get the order for this column. var order = $('#' + colid).sortable("toArray"); // For each portlet in the column for ( var i = 0, n = order.length; i < n; i++ ) { // Determine if it is 'opened' or 'closed' var v = $('#' + order[i]).find('.portlet-content').is(':visible'); // Modify the array we're saving to indicate what's open and // what's not. order[i] = order[i] + ":" + v; } $.cookie(cookieName, order, { path: "/", expiry: new Date(2016, 1, 1)}); }); } The issue I am having is this runs for every element with class name column. So basically it goes out to issueWidgets and finds each column, and goes to projectWidget and finds any element with class=column, and finally to userWidgets and also finds any element with class=column and runs the above code. I want to limit it to run based on the its parent widget div. So for instance I'd want it to run only on issueWidgets when I am looking at the issueWidgets tab. Remember these are actually tabs (jquery ui). If I'm in the projectWidgets tab I'd want to find all elements with class=column but ONLY on the projectWidgets tab not all the other tabs...etc etc. So basically my function should take in the tab either issueWidgets, projectWidgets, userWidgets and work .each only located within those…
has comment: http://stackoverflow.com/comment/44760577
score: 0
has comment: http://stackoverflow.com/comment/44760447
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28197080

http://stackoverflow.com/comment/45015709
has text: Thanks @Joseph - I've created a rough draft of a custom RoatableTouchSync and custom scroll view. Like you said, all I needed to do was convert the delta in the TouchSync.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28228739

http://stackoverflow.com/a/28152188
upvote count: 3
has body: Actually, this code isn't valid: var === 2 &amp;&amp; console.log('true') VM132:2 Uncaught SyntaxError: Unexpected token === You can try it yourself in the browser (i.e. in Chrome look for Developer Tools). See http://jsfiddle.net/jcdxnte0/ EDIT: The syntax x &amp;&amp; y means that both x and y need to be true. This means, that if x is true, y will get evaluated, and if x is false, y will not get evaluated (because x was false, so both will never be true so why bother evaluating y? - evaluation goes from left to right). In your case, x is test === 2, and y is console.log(...).
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44675819
has comment: http://stackoverflow.com/comment/44675823
has comment: http://stackoverflow.com/comment/44675692
answers question: http://stackoverflow.com/q/28152164
downvote count: 1

http://stackoverflow.com/comment/44825438
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28230846
has text: i did something related a while back: http://danml.com/js/localstorageevents.js, that one has an event emmiter base and "local echo" so that you can use the EE for everything everywhere.
score: 1

http://stackoverflow.com/q/28199513
accepted answer: http://stackoverflow.com/a/28199536
answer count: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/28199573
has answer: http://stackoverflow.com/a/28199697
has answer: http://stackoverflow.com/a/28199573
has title: multiple span calls of javascript value
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28199583
has body: In my header I have function addusr() { document.getElementById("usrout").innerHTML = document.getElementById("usrin").value;} and in my text I have code-bla bla bla bla!! It works! but if I try to call again on the same page at a different location, none of the others appear. Example: text more text, code... another ... ... .. ... another ... Only the first one appears, why is this? How can I fix it?
has answer: http://stackoverflow.com/a/28199536
type: Question
downvote count: 4
tagged with: javascript
score: -3
has comment: http://stackoverflow.com/comment/44765373
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28195438
has body: I'm trying to get a text input field selected and focused from the beginning with my custom directive. Input Field: &lt;input type="text" value="Preset Value" select-on-load /&gt; Custom Directive: app.directive('selectOnLoad', function () { // Linker function return { restrict: 'A', link: function (scope, element, attrs) { element.focus().select(); } }; }); But I only get a javscript error saying that focus/select is not a function. How else should I do that?
has title: Angularjs: Select and focus of an element in directive link
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion
type: Question
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28195723
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28195723

http://stackoverflow.com/q/28157474
answer count: 2
tagged with: mobile
upvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/30261012
favorite count: 0
downvote count: 0
has title: Can't select text in TouchSwipe jQuery plugin
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3514784
tagged with: swipe
score: 1
has answer: http://stackoverflow.com/a/28157475
has body: TouchSwipe is a great plugin for adding swipe to your website. But I have an issue on selecting text when the this plugin is activated. $(window).swipe( { //Generic swipe handler for all directions swipeRight:function(event, direction, distance, duration, fingerCount) { dnlShow(); }, swipeLeft:function(event, direction, distance, duration, fingerCount) { dnlHide(); }, //Default is 75px, set to 0 for demo so any distance triggers swipe threshold: 75 }); Any good solution to fix this issue?
type: Question
tagged with: touch

http://stackoverflow.com/comment/44885607
type: QuestionComment
comment on: http://stackoverflow.com/q/28264386
has text: this may help if the object/site are not to big http://stackoverflow.com/questions/1068834/object-comparison-in-javascript
score: 0
type: Comment

http://stackoverflow.com/q/28133855
has body: Works on my website but want to it to show only once per 2-3 hours:- https://www.helpingtechie.com This not my code just download from a website which gave me. I think cookies will be needed to add. Code Used:- .guestwarn-mask{ position:absolute; background:#fff; opacity:0.5; filter:alpha(opacity=50); z-index: 4; overflow: hidden; } .guestwarn-layout{ -moz-transform: scale(0); -webkit-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); -webkit-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; -moz-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; -ms-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; -o-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; position:absolute; border:1px solid #eee; background:#fff; box-shadow: 1px 2px 4px rgba(100,100,100,0.1); display:none; z-index:5; } .guestwarn-layout-animate{ -moz-transform: scale(1); -webkit-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .guestwarn-layout-close{ -webkit-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; -moz-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; -ms-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; -o-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; top:-300px !important; } .guestwarn-content{ position:relative; color:#555; overflow:hidden; } .guestwarn-title{ position:absolute; left:0px; top:0px; height:40px; width:100%; overflow:hidden; background:#eee; font:normal 16px Microsoft Yahei; color:#fff } .guestwarn-title span{ display:block; float:left; padding:10px 20px; background:#08c; } .guestwarn-close{ position:absolute; right:0px; top:0px; background:#E04343; display:block; text-decoration:none; font-family:Tahoma; font-size:20px; line-height:37px; height:40px; width:40px; text-align:…
accepted answer: http://stackoverflow.com/a/28142840
tagged with: javascript
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28142840
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Display Dialog Box once every 3 hours
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44643562
downvote count: 1
type: Question

http://stackoverflow.com/q/28255636
tagged with: javascript
tagged with: jquery
has body: I frequently use jQuery's on function to handle future events. Eg: $(document).on('click', '.my-div', myHandler); But, I'm not able to get this to work with the play or playing events on my video tag: $(document).on('playing', 'video', function() { console.log('video playing'); }); The following works just fine, though does not bind to future elements: $('video').on('playing', function() { console.log('video playing'); }); Does jQuery's future binding syntax of the on function only work with certain events, or does it lack suppoert for HTMLMediaElement object events? I'm using jQuery 1.11.2.
favorite count: 0
has title: jQuery on function for future media elements
has answer: http://stackoverflow.com/a/28255671
accepted answer: http://stackoverflow.com/a/28255671
type: AnsweredQuestion
score: 2
downvote count: 0
tagged with: html5-video
type: Question
upvote count: 2
answer count: 1

http://stackoverflow.com/comment/44635902
comment on: http://stackoverflow.com/q/28123968
has text: Well i can offer a workarounds: If you control the remote url, do that if you add some QS param, EG: ?head=true the response will be JSON with information about the file. or you don't control, you can use a proxy server side file that will fetch the info for you
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28270818
tagged with: d3.js
has title: How to select all connecting nodes and links to a given node on mouse hover in D3.js?
type: UnansweredQuestion
has body: I am working with a force labelled D3 graph like this one: Force Labelled Layout I need to be able to hover on the circular nodes in a way that on hover, the color of the node being hovered upon, it's connecting links and their target nodes get highlighted (say, change in color). How can I achieve this? This is the code I'm using to create the graph: for(var i = 0; i &lt; JsonList.length; i++) { var nodeExists = 0; // check to see if a node for the current url has already been created. If yes, do not create a new node for(var j = 0; j &lt; nodes.length; j++) { if(JsonList[i].url == nodes[j].label) nodeExists = 1; } if (nodeExists == 0) { //var urlLabel = JsonList[i].url; var node = { label : JsonList[i].url, category : JsonList[i].category }; nodes.push(node); labelAnchors.push({ node : node }); labelAnchors.push({ node : node }); } }; // create links for connecting nodes for(var i = 0; i &lt; JsonList.length; i++) { var srcIndx = 0, tgtIndx = 0; for(var j = 0; j &lt; nodes.length; j++) { if( JsonList[i].url == nodes[j].label ) // find the node number for the current url { srcIndx = j; } if( JsonList[i].parentURL == nodes[j].label ) // find the node number for the parent url { tgtIndx = j; } } // connecting the current url's node to the parent url's node links.push({ source : srcIndx, target : tgtIndx, weight : 1, }); labelAnchorLinks.push({ source : srcIndx * 2, target : srcIndx * 2 + 1, weight : 1 }); }; I'm currently able to change the color of the target single node on mouse hover using the following code: var node = vis.selectAll(".node") .data(nodes) .enter().append("g") .attr("class", "node") .style("font-size", 12) .call(force.drag); node.append("circle") .attr("r", 10) .style("fill", function(d) { return color[d.category]; }) .on("mouseover", mouseover) .on("mouseout", mouseout); function mouseover(d) { d3.select(this) .style("fill", "green"); } function mouseout(d) { d3.select(this) .transition() .duration(250) .style("fill", function(d) { return color[d.c…
type: Question
tagged with: mousehover
linked to: http://stackoverflow.com/q/8739072
tagged with: force-layout
has comment: http://stackoverflow.com/comment/44904125
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44898598
answer count: 0

http://stackoverflow.com/a/28211846
score: 0
type: AcceptedAnswer
has body: $(document).ready(function(){ $('#dropDown').on('change', function() { if ( this.value == 'page5') { $("#page0").show(); } else { $("#page0").hide(); } }); });
type: Answer
has comment: http://stackoverflow.com/comment/44790592
accepted answer of: http://stackoverflow.com/q/28211709
answers question: http://stackoverflow.com/q/28211709

http://stackoverflow.com/a/28139295
type: Answer
score: 0
has body: Works perfectly here: http://jsfiddle.net/kez5zwgq/ Make sure you have your "a" tags defined in your HTML ;) HTML potato tomato You might want to consider using the following CSS: CSS .active { text-decoration: underline; }
answers question: http://stackoverflow.com/q/28139230
accepted answer of: http://stackoverflow.com/q/28139230
has comment: http://stackoverflow.com/comment/44656120
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44650273
has comment: http://stackoverflow.com/comment/44650186

http://stackoverflow.com/a/28125111
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28124613
answers question: http://stackoverflow.com/q/28124613
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Change your HTML to: doetwel hi doetwel hi .... so on or 15 divs I m assuming you have 5x3 divs and onClick of one div the previous one will be decrease in width to 0px. //also change 'vakinfo1'...15 classes to 'vakinfo' now you JS code will be: var vakDivs=$(".vak"); var vakInnerDivs=$(".vakinnerlinks"); var vakInfoDivs=$(".vakinfo"); var expandDivs=$("#expand"); var lastExpanded=-1; vakDivs.each(function(i){ expandDivs[i].click(function(){ if(lastExpanded>-1){ var lastDecreased=lastExpanded-1; if(lastExpanded%5==0) lastDecreased=lastExpanded+1; vakDivs[lastExpanded].animate({width: '25%',}, 990 ); vakInnerDivs[lastExpanded].animate({marginLeft: '150%',},1010); vakInfoDivs[lastDecreased].animate({width: '25%',}, 1000 ); vakInfoDivs[lastDecreased].css({"padding":'25px'}); } if(lastExpanded==i) lastExpanded=-1; else{ var divNoToDecrease=i-1; if(i%5==0) divNoToDecrease=i+1; vakDivs[i].animate({width: '50%',}, 1010 ); vakInnerDivs[i].animate({marginLeft: '55%',}, 1010 ); vakInfoDivs[divNoToDecrease].animate({width: '0px',}, 990 ); vakInfoDivs[divNoToDecrease].css({"padding":'0px'}); lastExpanded=i; } }): }); You can play/change with javascript code to meet your requirement, debugging. Edit: As I can see your HTML code on paste2.org I guess you have only one vakinfo div and each time you want to decrease that one only. You can change the javascript according to that. If any query/problem, comment... :)
score: 1

http://stackoverflow.com/comment/44684766
has text: You made a mistake by attempting to access the DOM from the controller. Read this SO question first: http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28154449
type: Comment

http://stackoverflow.com/q/28208332
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: video
has answer: http://stackoverflow.com/a/28208569
score: 0
answer count: 1
tagged with: javascript
has title: How to put video playlist next to the video player?
accepted answer: http://stackoverflow.com/a/28208569
has body: I made a web player for mp4 and mkv videos, it works but the problem is that I still can't keep the playlist next to the video player, right now the playlist is at the bottom of the video player, this is the script: SnK Titanic Titanic Titanic Titanic Titanic Titanic Shutter AB1 AB2 D My goal is to keep the video player centered and the playlist next to the video player (on the right of the video player), how should I do that? Solved with the help of Nitin Suri: here's the complete code http://pastebin.com/YS2cGdG7
type: AnsweredQuestion
type: Question

http://stackoverflow.com/a/28228307
score: 1
has comment: http://stackoverflow.com/comment/44819785
has body: You cannot use inside a . Make sure the ID selectors you're targeting they actually exist. You can wrap all you need inside a label without the need to use for and id attributes: function _(x) { return document.getElementById(x); } function _n(x) { return document.getElementsByName(x); } //Needed to get elements by Name var gender, input; function next1() { var radio = _n("gender"); // get the elements by Name !! for (var i=0, j=radio.length; i<j; i++) { // Loop all radio buttons if (radio[i].checked) { // If one is Checked... gender = radio[i].value; // All fine _("step1").style.display = "none"; _("step2").style.display = "block"; break; // and exit the loop. } } if(!gender) return alert("Please select a gender"); // If no value, alert something } function next2() { input = _("input").value; // Use the right ID !!!!! if(!input) return alert("Please enter your name"); _("step2").style.display = "none"; _("show_data").style.display = "block"; _("display_gender").innerHTML = gender; _("display_input").innerHTML = input; } label{display:block;} #step1, #step2m #show_data{ background:#eee; width:200px; padding:30px; } #step2, #show_data{display:none;} MALE FEMALE Next Enter your name: Next
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28228075
has comment: http://stackoverflow.com/comment/44820096
has comment: http://stackoverflow.com/comment/44820161
accepted answer of: http://stackoverflow.com/q/28228075
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44648221
comment on: http://stackoverflow.com/a/28138226
has text: It is google maps with pins on it generated from database. I'm submitting the form to send lat and lng coordinates sto haversine sql. AJAX would make things more complicated
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28197405
upvote count: 7
has body: I'm investigating virtual-dom right now, and I'm wondering whether virtual-dom is really faster than manual manipulation with view. Now I understand that virtual-dom and diff algorithm can prevent unnecessary re-flows, for example when we want to change this: a b To this one: c d So when we use direct manipulation we will have probably 4 re-flows: 2 for removing each div and for creating new one. We will also have more manipulation with dom, because we should create new elements (Maybe removing from dom -> creating new dom -> setting properties -> mounting to document is faster then just direct editing dom properties?). From the other side we have fast pretty diff algorithm that generate 2 patches just to replace content of our divs, probably we will have 1 re-flow. (if I made a mistake while writing number of re-flows, please tell me) In this case virtual-dom probably rules, but when we have 2 really different trees, we will not have a lot of benefits from diff, so we will prevent some re-flows, maybe, but time for generating new tree and running diff and patch is much longer. And here is my second question. For example, in the motivation to https://github.com/Matt-Esch/virtual-dom library, they say: "So instead of updating the DOM when your application state changes, you simply create a virtual tree or VTree". Is it really nice to build a new virtual tree every time when I need to change something on my view? Of course, I will try to make some test to evaluate the performance, but I want to know some more technical aspects and reasons why virtual-dom is really better or, maybe, not?
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/44764976
score: 5
tagged with: javascript
has title: When virtual-dom is faster than manual manipulation?
answer count: 2
has comment: http://stackoverflow.com/comment/44764808
favorite count: 0
tagged with: dom-manipulation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44776067
has answer: http://stackoverflow.com/a/28199479
has answer: http://stackoverflow.com/a/28311992
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/a/28126659
has comment: http://stackoverflow.com/comment/44632468
score: 18
accepted answer of: http://stackoverflow.com/q/28126345
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28126345
has body: Try this way to validate your date in YYYY-MM-DD HH:MM format var re = /[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]/; var str = '2014-02-04 12:34'; var m; while ((m = re.exec(str)) != null) { if (m.index === re.lastIndex) { re.lastIndex++; } // View your result using the m-variable. // eg m[0] etc. } SEE DEMO :https://www.regex101.com/r/rT6vJ4/1
upvote count: 18
type: Answer
downvote count: 0

http://stackoverflow.com/a/28232375
type: Answer
has comment: http://stackoverflow.com/comment/44829469
score: 0
has comment: http://stackoverflow.com/comment/44832562
has body: Try this, <?php $STRING .= ''.$CORE->_e(array('auction','41')).''; $data = get_user_meta( $authorID, 'cellno', true); if(strlen($data) > 0){ echo " Also, try learning onclick events.
answers question: http://stackoverflow.com/q/28232190

gulp
tags question: http://stackoverflow.com/q/28142177
tags question: http://stackoverflow.com/q/28254683
tags question: http://stackoverflow.com/q/28166295
tags question: http://stackoverflow.com/q/28202389
tags question: http://stackoverflow.com/q/28217262
tags question: http://stackoverflow.com/q/28170705
type: Tag
tag name: gulp
tags question: http://stackoverflow.com/q/28240731
tags question: http://stackoverflow.com/q/28162686
tags question: http://stackoverflow.com/q/28217712
tags question: http://stackoverflow.com/q/28229633
tags question: http://stackoverflow.com/q/28172896
tags question: http://stackoverflow.com/q/28166409
tags question: http://stackoverflow.com/q/28181554
tags question: http://stackoverflow.com/q/28205034
tags question: http://stackoverflow.com/q/28220760
tags question: http://stackoverflow.com/q/28205696
tags question: http://stackoverflow.com/q/28191918
tags question: http://stackoverflow.com/q/28269149

http://stackoverflow.com/q/28212069
score: 0
tagged with: llvm
has answer: http://stackoverflow.com/a/28222290
accepted answer: http://stackoverflow.com/a/28222290
answer count: 1
has body: I'm working on my own program language which can be created in a web based editor. I want to translate my code to LLVM-IR on client side. The IR code will be transfer, translate to instruction set and execute on an embedded device. Well, my plan is to create a lexer, parser and code-generator in C/C++ which used the LLVM-API to create LLVM-IR code. Later I will translate my C/C++ code to JavaScript by using emscripten. However i need to translate the LLVM-toolchain to JavaScript before i can convert my own project to javascript. But does anybody knows if it is possible to translate the LLVM to JavaScript? I found a similar question here: Can Emscripten compile LLVM to JavaScript? But with no clear result... Or does anyboy have comments to my plan? Thanks a lot!
tagged with: emscripten
tagged with: c++
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9194825
type: Question
has title: Can Emscripten compile LLVM to JavaScript for a webbased program language
tagged with: javascript
tagged with: http://stackoverflow.com/tag/c

http://stackoverflow.com/q/28175179
has body: I have a web page with multiple full screen panels. For ascetic purposes, I am trying to make the user have to scroll a certain amount of wheel deltas for the body to animate to the next page. I have no idea what I am doing wrong over here: page = document.body.scrollTop; currentPage = 0; tick = 0; wheelBounds = 500; wheelTimeout = null; window.onmousewheel = function(e){ clearTimeout(wheelTimeout); document.body.scrollTop = page; tick += -e.wheelDelta; wheelTimeout = window.setTimeout(function(){ tick = 0; },100); // document.body.scrollTop = window.innerHeight*(currentPage); $("html,body").animate({ scrollTop: window.innerHeight*(currentPage) }); if(tick &gt; wheelBounds || tick &lt;-wheelBounds){ page = document.body.scrollTop; currentPage = tick &gt; wheelBounds ? (currentPage+1): currentPage &gt; 0 ?(currentPage-1): currentPage; tick = 0; console.log(currentPage); } }
score: 0
linked to: http://stackoverflow.com/q/5527601
has comment: http://stackoverflow.com/comment/44719593
has comment: http://stackoverflow.com/comment/44719718
type: UnansweredQuestion
has title: Mousewheel delaying/delta summing function extremely jolty
answer count: 0
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44642948
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28135408
type: Comment
has text: but in my snippets page there are many div....how to load one particular div with the id of Data-snippet??

http://stackoverflow.com/comment/44637237
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28131355
has text: since you marked your question as angular i am referring 2 links https://github.com/btford/angular-socket-io and https://github.com/mbenford/ngSocketIO

http://stackoverflow.com/a/28621389
type: Answer
answers question: http://stackoverflow.com/q/28165900
downvote count: 0
score: 1
has body: You are setting element value via JavaScript, while IME also attempts to set it when composition finish. The actual behavior differ per browser. Google Chrome accepts your JS value (300) and IME value (300) together, that's where the 300300 comes. You can test this behavior with jsfiddle below: https://jsfiddle.net/bootleq/x14w3Lts/4/embedded/result/ A workaround is to use setTimeout to delay your JS setter execution later to IME compositionend, as demonstrated in the fiddle. And there would be nothing wrong in angular or jsfiddle, without doing $render in angular $parsers function, everything works fine.
upvote count: 1

http://stackoverflow.com/comment/44716049
type: Comment
has text: Then, how can I block submitting ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28173243

http://stackoverflow.com/a/48887468
has body: This is just a version of @JeremyWeir's directive using ui-router@1.x transition hooks. import angular from 'angular'; class RouteCssClassNamesDirective { constructor($transitions) { this.$transitions = $transitions; this.restrict = 'A'; } link(scope, element, attrs) { this.$transitions.onSuccess({}, (trans) =&gt; { const fromClassNames = angular.isDefined(trans.from().data) &amp;&amp; angular.isDefined(trans.from().data.cssClassNames) ? trans.from().data.cssClassNames : null; const toClassNames = angular.isDefined(trans.to().data) &amp;&amp; angular.isDefined(trans.to().data.cssClassNames) ? trans.to().data.cssClassNames : null; if (fromClassNames !== toClassNames) { if (fromClassNames) { element.removeClass(fromClassNames); } if (toClassNames) { element.addClass(toClassNames); } } }); } static create() { return new RouteCssClassNamesDirective(...arguments); } } RouteCssClassNamesDirective.create.$inject = ['$transitions']; export default angular.module('shared') .directive('routeCssClassNames', RouteCssClassNamesDirective.create);
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28204606

http://stackoverflow.com/comment/44678203
comment on: http://stackoverflow.com/a/28148188
score: 0
type: AnswerComment
type: Comment
has text: it gives me the error "Uncaught SyntaxError: Unexpected token {" as soon as I include the liquid tags

http://stackoverflow.com/q/28251331
tagged with: ember-router
downvote count: 0
answer count: 1
favorite count: 0
tagged with: handlebars.js
tagged with: ember.js
type: AnsweredQuestion
has title: Ember Nested Routes and rendering models
score: 1
has answer: http://stackoverflow.com/a/28251722
has body: I have an invoice application generator and i want to show the invoices with all his transactions in 2 different ways, at the moment i can only do it in 1 way ( Edit Link) On Edit link where i can see all my invoices and transactions together ( it s how it works now) On View link where i want to see only the specific Invoice information with his own transactions and not any of the other invoices and informations I have reproduced my case here This is the route code App.Router.map(function(){ this.resource('invoices', function(){ this.resource('invoice', { path:'/:invoice_id' }, function(){ this.route('edit'); }); this.route('create'); }); }); The problem is that as long as i am inside the invoices resources i am sharing the invoices templates where everything is generated, but is there a way where i can see only my single invoice with his own transactions inside the invoices route? Is it achievable with the same Route Code? What's the best way to get this done?
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28251722
tagged with: javascript
tagged with: routes

http://stackoverflow.com/comment/44914789
has text: No, it's not. You can create a overlayer or modal to show content and close it or direct to another page.. but browser denied to close when not did open by script.
comment on: http://stackoverflow.com/a/28276740
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44849996
has text: Thanks. Just tired. I've updated the link and my question. The real question is why jQuery Mobile does not append styles and refresh list though.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28244510

http://stackoverflow.com/comment/44672899
comment on: http://stackoverflow.com/q/28149815
score: 0
type: QuestionComment
has text: create a fiddle that demonstrate the problem, it will be easier to help.
type: Comment

http://stackoverflow.com/q/28225530
answer count: 1
accepted answer: http://stackoverflow.com/a/28229729
type: AnsweredQuestion
type: Question
tagged with: polymer
tagged with: pie-chart
has title: Polymer elemento <chart-pie> and binding
has body: I have developed a polymer element. In this element I receive some parameters. When I pass [value array] parameter to element does not work. But if I put the values manually, it works. This is the polymer element head: <polymer-element name="nick-viewer-card" attributes="program details link chart"> This is the code problem: {{ program }} {{ details }} more details {{ chart }} And this is the invocation: I included #mudasobwa suggestiong: {{ chart }} more details This is the output: and the console error is related the type:
tagged with: javascript
has answer: http://stackoverflow.com/a/28229729
score: 0
tagged with: web-component

http://stackoverflow.com/q/28253499
has comment: http://stackoverflow.com/comment/48584926
has body: I'm having a bit of fun on https://blockly-games.appspot.com and have got to the last level where you can write full blown javascript (new Date().getTime(); is very handy). Despite having the console open in Chrome (ctrl-shift-j) I can't seem to write anything to it with console.log("test"); from within the game. When I do I see: // Starting battle with 2 players. compressed.js:420 // [Player] throws an error: Unknown identifier: console compressed.js:423 // undefined compressed.js:423 // [Player] dies. compressed.js:416 Yet if I type console.log("hmm"); in the console I properly see: // console.log("hmm"); // hmm VM1038:2 // undefined Same story if I try to use alert("test"). I want to debug, but the only forms of output I've found are manipulating the duck and throwing Unknown identifiers. Is there any way out of this sandbox? Update: How do I print debug messages in the Google Chrome JavaScript Console? has some ideas for restoring console but they don't seem to work in this case. Update: just to be clear this is what chrome looks like when experiencing this error.
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48661877
has comment: http://stackoverflow.com/comment/48644476
has comment: http://stackoverflow.com/comment/48584964
score: 2
upvote count: 2
tagged with: blockly
has comment: http://stackoverflow.com/comment/48663656
has title: How to output a message in Googles Blockly?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48642642
has answer: http://stackoverflow.com/a/28256972
has comment: http://stackoverflow.com/comment/48644162
linked to: http://stackoverflow.com/q/217957

http://stackoverflow.com/a/28273911
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44903157
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28273823
accepted answer of: http://stackoverflow.com/q/28273823
has body: In bodyBackgroundColor, you need document. before body (body is not a global): document.body.style.backgroundColor = "red"; In divBackgroundColor, you've left out .style.: divColor.style.backgroundColor = "red"; And rather than the complicated addLoadEvent, just move your script tag to the end of the page, just before the closing &lt;/body&gt; tag. Then all of the elements defined above it will exist and you can interact with them. More in the YUI Best Practices for Speeding Up your Website. To debug these kinds of things, with any modern browser you can use the built-in debugger. Press F12 or Ctrl+Shift+I or find "Dev Tools" on the browser's menu, and you'll find that you can see the source code of your page, set breakpoints in it (places where the JavaScript engine stops and lets you see what's going on before it continues); you can single-step through code (watch it execute one line at a time), inspect variables, etc. The most basic part of the debugger is the console, which shows you errors (amongst other things).

http://stackoverflow.com/q/28268982
has comment: http://stackoverflow.com/comment/44894257
tagged with: javascript
has comment: http://stackoverflow.com/comment/44894116
has comment: http://stackoverflow.com/comment/44894031
downvote count: 4
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44894201
tagged with: jquery
has title: JSON data is undefined but appears in console log
has comment: http://stackoverflow.com/comment/44894215
favorite count: 0
has comment: http://stackoverflow.com/comment/44894088
has body: I am accessing the following JSON data at: http://veratech.co.nz/blog/?json=1 When I try to access the "url" property that sits within an array on line 4 of the code below, I get an undefined error. Even though it will appear in console.log (line 13) with console.log(val.attachments[0].url);. Code below: $.each(data.posts, function(index, val){ output += '&lt;li&gt;'; output += '&lt;a href="#blogpost" onclick = showPost(' + val.id + ')"&gt;'; output += '&lt;img src="' + val.attachments[0].url + '" alt=""&gt;'; output += '&lt;h3&gt;' + val.title + '&lt;/h3&gt;'; //Here we shorten the paragraph to 60 characters. var str = val.excerpt; var paraInfo = str.slice(0, 60); output += '&lt;p&gt;' + paraInfo + '&lt;/p&gt;'; //Closing off the the closing html tags output += '&lt;/a&gt;'; output += '&lt;/li&gt;'; console.log(val.attachments[0].url); });//Go through each post Advice would be greatly appreciated
has comment: http://stackoverflow.com/comment/44894351
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44894040
has answer: http://stackoverflow.com/a/28269335
tagged with: http://stackoverflow.com/tag/json
score: -4
tagged with: each
type: Question
has comment: http://stackoverflow.com/comment/44894268

http://stackoverflow.com/a/28229839
has comment: http://stackoverflow.com/comment/44823188
has comment: http://stackoverflow.com/comment/44823960
accepted answer of: http://stackoverflow.com/q/28229306
has comment: http://stackoverflow.com/comment/44824011
has comment: http://stackoverflow.com/comment/44823124
upvote count: 1
has comment: http://stackoverflow.com/comment/44823334
has comment: http://stackoverflow.com/comment/44824031
answers question: http://stackoverflow.com/q/28229306
has comment: http://stackoverflow.com/comment/44823224
has comment: http://stackoverflow.com/comment/44822948
has body: url = 'http://losangeles.craigslist.org/wst/sof/4869468306.html'; soup = BeautifulSoup(urllib2.urlopen(url).read()); reply = soup.findAll('a', attrs = {"id": "replylink"}); if reply: url = 'http://losangeles.craigslist.org' + reply[0].get('href'); soup = BeautifulSoup(urllib2.urlopen(url).read()); reply = soup.findAll(['div', 'a'], attrs = {"class": re.compile(r'anonemail|mailapp')}); if reply: reply[0].getText() returns: u'qx8ft-4869445564@job.craigslist.org'
score: 1
has comment: http://stackoverflow.com/comment/44823587
has comment: http://stackoverflow.com/comment/44823845
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44822440
type: Answer
has comment: http://stackoverflow.com/comment/44822450
has comment: http://stackoverflow.com/comment/44823917

google-chrome-extension
tags question: http://stackoverflow.com/q/28227093
tags question: http://stackoverflow.com/q/28250887
tags question: http://stackoverflow.com/q/28186349
tags question: http://stackoverflow.com/q/28274264
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/28154220
tags question: http://stackoverflow.com/q/28257914
tags question: http://stackoverflow.com/q/28170471
tags question: http://stackoverflow.com/q/28277312
tags question: http://stackoverflow.com/q/28142515
tags question: http://stackoverflow.com/q/28197570
tags question: http://stackoverflow.com/q/28149327
tags question: http://stackoverflow.com/q/28140147
tags question: http://stackoverflow.com/q/28218215
tags question: http://stackoverflow.com/q/28166076
tags question: http://stackoverflow.com/q/28127553
tags question: http://stackoverflow.com/q/28207112
tags question: http://stackoverflow.com/q/28243398
tags question: http://stackoverflow.com/q/28242827
tags question: http://stackoverflow.com/q/28228743
tags question: http://stackoverflow.com/q/28202736
tags question: http://stackoverflow.com/q/28153982
tags question: http://stackoverflow.com/q/28259350
type: Tag
tags question: http://stackoverflow.com/q/28211174
tags question: http://stackoverflow.com/q/28250625
tags question: http://stackoverflow.com/q/28137557
tags question: http://stackoverflow.com/q/28166607
tags question: http://stackoverflow.com/q/28273271
tags question: http://stackoverflow.com/q/28199770
tags question: http://stackoverflow.com/q/28130521
tags question: http://stackoverflow.com/q/28142365
tags question: http://stackoverflow.com/q/28122513
tags question: http://stackoverflow.com/q/28220721
tags question: http://stackoverflow.com/q/28270978
tags question: http://stackoverflow.com/q/28198851
tags question: http://stackoverflow.com/q/28132068
tags question: http://stackoverflow.com/q/28262796

http://stackoverflow.com/comment/44639327
comment on: http://stackoverflow.com/a/28133349
score: 0
type: AnswerComment
has text: I will try that way for now on, but it isn't changing anything in the outcome, unfortunately.
type: Comment

http://stackoverflow.com/a/28177795
answers question: http://stackoverflow.com/q/28177748
type: Answer
score: 0
has body: You can toggle classes. Use the following CSS: .red { color: red; } And change your js to: $(function() { $("#left,#center,#right").click(function(){ $(this).toggleClass('red'); }); }); And then remove the inline styles on the HTML.

http://stackoverflow.com/comment/44935389
comment on: http://stackoverflow.com/q/28273271
has text: Thanks for your great example. I have followed the basics of packaging an add-on to a xpi file based on the link you gave. It involves a main.js. I copied the contents of bootstrap.js into main.js, which does not work. Would you help with how I can use your bootstrap.js file in more detail?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28211376
score: -3
has comment: http://stackoverflow.com/comment/44787436
has answer: http://stackoverflow.com/a/28211663
tagged with: hide
downvote count: 3
type: Question
tagged with: addclass
has title: add class after jquery's show and hide animation
has body: How do I slow down the add class event to occur gradually after the hide and show animation in Jquery? The add class in this instance is read from the CSS file which essentially positions the paragraph. Every occurs sweetly but the add class is too abrupt and fast after the smooth animation. The js file: $(".grad").hide().show(3000, function() { $( this ).addClass("menubar"); });
tagged with: javascript
answer count: 2
upvote count: 0
tagged with: show
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28211933
type: UnansweredQuestion

http://stackoverflow.com/a/28243085
accepted answer of: http://stackoverflow.com/q/28239284
score: 2
answers question: http://stackoverflow.com/q/28239284
downvote count: 0
has body: I would recommend consolidating all your initializing functionality into one initialize() function, much like the user Ramesh Kotha pointed out: &lt;body onload="initialize();"&gt; function initialize(){ initializeA(); initializeB(); initializeC(); // other init tasks ... } But it should be added, that body onload can sometimes be problematic if you are trying to support older browsers (especially older versions of IE or Safari), so I wanted to add that if you are using jQuery in your application, then you can use jQuery's $(document).ready() handler to load any of your init functions after the DOM is ready (which is essentially what is happening with body onload, without all the hassle), so this code is functionally equivalent to the above code: // Example using jQuery's .ready() function $(document).ready(function(){ initializeA(); initializeB(); initializeC(); // other init tasks ... }); The reason why one of the functions isn't being called is most likely due to an error in the function. Just put a console.log() statement at the top of the function you think isn't working and check the console for output: function initialize() { console.log("initialize function has been called"); } Hope this helps.
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28227482
favorite count: 0
has answer: http://stackoverflow.com/a/73448069
tagged with: regex
answer count: 4
type: AnsweredQuestion
has title: determine if string/url belongs to particular domain
possible better answer: http://stackoverflow.com/a/28227564
score: 1
has answer: http://stackoverflow.com/a/28227533
has answer: http://stackoverflow.com/a/28227564
upvote count: 1
has body: I'm trying to use a RegExp in JavaScript to determine if the current string (which represents a URL) belongs to the github.com domain. Example, if http://developer.github.com or http://subdomain.github.com return true, otherwise return false. Tried using a wildcard in place of the subdomain to allow for any number of any characters between http:// and .github.com .. /http://[a-z]*.github.com/ig http://jsfiddle.net/bobbyrne01/nrp6pkkq/1/ js .. var str0 = 'http://exämple.org/foo.html?baz=la#bumm'; var str1 = 'https://developer.github.com/v3/'; var str2 = 'http://developer.github.com/v3/'; var str3 = 'http://test.github.com/v3/'; var str4 = 'http://example.org'; var patt = new RegExp("/http://[a-z]*.github.com/ig"); document.getElementById('results').innerHTML = patt.test(str0) + '&lt;br/&gt;'; document.getElementById('results').innerHTML += patt.test(str1) + '&lt;br/&gt;'; document.getElementById('results').innerHTML += patt.test(str2) + '&lt;br/&gt;'; document.getElementById('results').innerHTML += patt.test(str3) + '&lt;br/&gt;'; document.getElementById('results').innerHTML += patt.test(str4) + '&lt;br/&gt;'; html .. &lt;div id="results"&gt;&lt;/div&gt; output .. false false false false false Expected output: false false true true false
has answer: http://stackoverflow.com/a/28227921
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/13465733
accepted answer: http://stackoverflow.com/a/28227533
downvote count: 0

http://stackoverflow.com/comment/44730031
type: QuestionComment
has text: @micha yes all is ok, just my mistake, i updated question...
score: 0
comment on: http://stackoverflow.com/q/28180000
type: Comment

http://stackoverflow.com/comment/44640612
comment on: http://stackoverflow.com/a/28133755
has text: Is there a way to do this and still keep the hyphens on focusin.I am guessing NO but I would like an answer,if you please.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28183743
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28164968
accepted answer of: http://stackoverflow.com/q/28164968
type: AcceptedAnswer
has body: I found a solution to the problem here : jquery how to get form element types, names and values I wound up doing this: $("div[id^='question-']").each(function () { var id = '#' + $(this).attr('id'); var $this = $(this); var inputs= $(id+' :input').map(function(index, elm) { return {name: elm.name, value: $(elm).val()}; }).get(); formData[id]=inputs; });

http://stackoverflow.com/q/28156986
tagged with: internet-explorer
score: 1
linked to: http://stackoverflow.com/q/3629183
type: Question
has comment: http://stackoverflow.com/comment/47355171
downvote count: 0
duplicate of: http://stackoverflow.com/q/3629183
tagged with: javascript
has answer: http://stackoverflow.com/a/28157062
has body: I am using the custom ExtJS "treecombo", works fine in FF and Chrome but sucks in IE. I am using IE8. Here is the code: Ext.define('MyApp.plugins.TreeCombo', { extend: 'Ext.form.field.Picker', alias: 'widget.treecombo', tree: false, constructor: function(config) { this.addEvents( { "itemclick" : true }); this.listeners = config.listeners; this.callParent(arguments); }, records: [], recursiveRecords: [], ids: [], selectChildren: true, canSelectFolders: true, multiselect: false, displayField: 'text', valueField: 'text', treeWidth: 300, matchFieldWidth: false, treeHeight: 400, masN: 0, recursivePush: function(node, setIds) { var me = this; me.addRecRecord(node); if(setIds) me.addIds(node); node.eachChild(function(nodesingle) { if(nodesingle.hasChildNodes() == true) { me.recursivePush(nodesingle, setIds); } else { me.addRecRecord(nodesingle); if(setIds) me.addIds(nodesingle); } }); }, recursiveUnPush: function(node) { var me = this; me.removeIds(node); node.eachChild(function(nodesingle) { if(nodesingle.hasChildNodes() == true) { me.recursiveUnPush(nodesingle); } else me.removeIds(nodesingle); }); }, addRecRecord: function(record) { var me = this; for(var i=0,j=me.recursiveRecords.length;i&lt;j;i++) { var item = me.recursiveRecords[i]; if(item) { if(item.getId() == record.getId()) return; } } me.recursiveRecords.push(record); }, afterLoadSetValue: false, setValue: function(valueInit) { if(typeof valueInit == 'undefined') return; var me = this, tree = this.tree, values = (valueInit == '') ? [] : valueInit.split(','), valueFin = []; inputEl = me.inputEl; if(tree.store.isLoading()) { me.afterLoadSetValue = valueInit; } if(inputEl &amp;&amp; me.emptyText &amp;&amp; !Ext.isEmpty(values)) { inputEl.removeCls(me.emptyCls); } if(tree == false) return false; var node = tree.getRootNode(); if(node == null) return false; me.recursiveRecords = []; me.recursivePush(node, false); me.records = []; Ext.each(me.recursiveRecords, function(record) { var id = record.get(me.valueField); var…
answer count: 1
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/28157062
has comment: http://stackoverflow.com/comment/44685364
type: AnsweredQuestion
has title: IE8 JS error -- object doesnt support this property or method

http://stackoverflow.com/a/28165136
has comment: http://stackoverflow.com/comment/44701038
score: 1
accepted answer of: http://stackoverflow.com/q/28164923
has body: Any html tag after the first one will be removed. To fix this just place your template code inside of a hidden textarea, then the value will be preserved literally. Updated Fiddle: http://jsfiddle.net/j64r54rj/5/ $('#save_editor').click(function(){ var full_value=$("#editor textarea").val(); $('#write_html').val(full_value); }); title my body save
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44702164
answers question: http://stackoverflow.com/q/28164923
type: Answer
has comment: http://stackoverflow.com/comment/44701704
upvote count: 1
has comment: http://stackoverflow.com/comment/44701806

http://stackoverflow.com/comment/44806527
comment on: http://stackoverflow.com/a/28221174
has text: @Chrillewoodz Yeah, you're right. The truth is I didn't read your question completely. Just saw the cause or your trouble and answered at the same time. Sorry.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28125509
type: Question
has comment: http://stackoverflow.com/comment/44624354
accepted answer: http://stackoverflow.com/a/28125622
tagged with: javascript
tagged with: image
has body: This is just a basic slide show using js but I'm not getting the output. I want it to perform automatic slideshow, should I add jquery script into my program. Please help me out &lt;script&gt; var images = new Array(); images[0] = new Image(); images[0].src = "first.jpg"; images[1] = new Image(); images[1].src = "second.jpg"; images[2] = new Image(); images[2].src = "third.jpg"; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;img src="first.jpg" id="slide" width="500" height="500" /&gt; &lt;script type="text/javascript"&gt; var step=0; function slideit(){ document.getElementById('slide').src = images[step].src; if (step&lt;2) step++; else step=0; setTimeout("slideit()",2500); } slideit(); &lt;/body&gt;
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44624310
favorite count: 0
linked to: http://stackoverflow.com/q/27640896
has comment: http://stackoverflow.com/comment/44624624
tagged with: http://stackoverflow.com/tag/html
has title: Basic slideshow program
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28125622
upvote count: 1

http://stackoverflow.com/a/67028610
has body: I don't know if this would be considered hacky but it certainly works (using CSS variable): const passedInlineStyle = { '--color':'blue'} Then in an imported CSS file: background:var(--color);
downvote count: 0
answers question: http://stackoverflow.com/q/28269669
type: Answer
upvote count: 5
score: 5

http://stackoverflow.com/comment/116806233
comment on: http://stackoverflow.com/a/28235391
score: 0
type: AnswerComment
type: Comment
has text: I struggled a lot with this, because I had lots of async tests, until I realized I had to put before() and after() INSIDE the top level describe.

http://stackoverflow.com/q/28229591
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28229652
accepted answer: http://stackoverflow.com/a/28229781
has body: For example I have this kind of div hierarchy: Alex 90 Benny 60 If I have this kind of checking: If (parseInt($('.score').text()) > 80) { // set status div value to pass // set name color to red } But all I have is only this structure of generic, class-named divs. How if I want that the jQuery code will result in only Alex name become red and status become pass, and Benny will be unaffected, but my starting point will be from detecting the div with the score? So I hope I can understand how to target the siblings and the parents of the score div, without the need to browse and loop all from the root. I'm looking for something maybe like $('.score').parent or $('.score').sibling('.status') or $('score').parent.child('.status') if that's even exist. I hope jQuery has feature like that. But if not, please give the closest way possible to target relative tags according to you. Thanks.
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44822039
answer count: 3
possible better answer: http://stackoverflow.com/a/28229642
has answer: http://stackoverflow.com/a/28229642
has answer: http://stackoverflow.com/a/28229781
has title: Targeting generic-named div attribute using relative level position

web-component
tags question: http://stackoverflow.com/q/28225530
tags question: http://stackoverflow.com/q/28215439
tag name: web-component
tags question: http://stackoverflow.com/q/28252506
tags question: http://stackoverflow.com/q/28187244
type: Tag
tags question: http://stackoverflow.com/q/28246140
tags question: http://stackoverflow.com/q/28127388
tags question: http://stackoverflow.com/q/28260839

http://stackoverflow.com/comment/44753605
has text: Replacing the return statement with this `return x.toUpperCase().charCodeAt(0) - 55;` will add more obscurity.
comment on: http://stackoverflow.com/a/28193337
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29497172
answers question: http://stackoverflow.com/q/28196165
score: 0
accepted answer of: http://stackoverflow.com/q/28196165
has body: I fixed this problem for all states by downloading the full project for jvectormap - http://jvectormap.com/download/ and under /tests/assets/us the author includes all the js files needed. Just copy them over to your project and use: new jvm.MultiMap({ container: $('.jvectormap-container'), maxLevel: 1, main: { map: 'us_lcc_en' }, mapUrlByCode: function(code, multiMap){ return '../js/counties/jquery-jvectormap-data-'+ code.toLowerCase()+'-'+ multiMap.defaultProjection+'-en.js'; } }); and it will load each of the county maps on demand
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45038920
type: Comment
has text: ahaaa, I called with those params and there's my data, hooray! Thank you soOOoo much! I appreciate your patience, i don't API great yet. Might be nice to add something to the documentation to that effect, it passively says the external data will be in the payload with the task when you get the task.
comment on: http://stackoverflow.com/a/28223618
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44651222
comment on: http://stackoverflow.com/q/28139658
has text: could also be a data size issue. Maybe it needs to be partitioned differently in storage
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28149327
tagged with: javascript
tagged with: ejs
tagged with: google-chrome-extension
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44670241
has title: Chrome Extension development error : Resources must be listed in the web_accessible_resources
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44670141
has comment: http://stackoverflow.com/comment/44670059
downvote count: 0
has answer: http://stackoverflow.com/a/28149651
score: 1
has body: I am new to writing chrome extension. I am trying to open an ejs template inside my injected content script, but I get below error in content_script.js when I do new EJS({}) "Denying load of chrome-extension://eadcfllkpeiejpedposonemnmmpnggie/content.html.ejs. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension." Note: I have added the resource in the web_accessible_resource Manifest.json { "name" : "test", "description" : " app", "version" : "1.0", "manifest_version" : 2, "browser_action" :{ "default_icon" : "images/icon.png" }, "permissions" : ["tabs","notifications","contextMenus","background","http://*/*","https://*/*","&lt;all_urls&gt;"], "options_page" : "views/options.html", "icons" : {"16" : "images/icon-16.png"//Icon context menu}, "background" : { "page" : "views/background.html", "js" : ["scripts/jquery-1.10.2.min.js"] }, "web_accessible_resources": ["views/content.html.ejs"] } Background.js 'use strict'; document.addEventListener("DOMContentLoaded", function(tab){ chrome.contextMenus.create({ title : "Add as reminder", id : "rappelSelection", contexts: ["selection"], onclick: function(info,tab){addContent(info,tab)} }) }); function addContent(info, tab){ var details = {}; details.text = info.selectionText; chrome.tabs.executeScript(tab.id, { file : "scripts/jquery-1.10.2.min.js" }); chrome.tabs.executeScript(tab.id, { file : "scripts/ejs_min.js" }); chrome.tabs.executeScript(tab.id, { file : "scripts/content_script.js" }); chrome.tabs.getSelected(null,function(tab){ chrome.tabs.sendRequest(tab.id, {details: details}, function(response){ console.log(response); }); }); } content_script chrome.extension.onRequest.addListener(function newContent(request, sender, sendResponse){ var template_path = chrome.extension.getURL('content.html.ejs'); var data = {content: request.details.text }; var template = new EJS({url:template_path}).render(data); $("body").append(template); sendResponse({conte…
tagged with: google-chrome
type: Question

http://stackoverflow.com/comment/44719593
type: Comment
comment on: http://stackoverflow.com/q/28175179
has text: Can you better explain what is going wrong? Also, what browser are you doing this in? Wheel deltas can differ between browsers. [See this question](http://stackoverflow.com/q/5527601/691711)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44790380
comment on: http://stackoverflow.com/a/28212317
type: Comment
score: 0
type: AnswerComment
has text: Thanks, I was testing your code, but the problem is I need to get the value of the response out of the $http.get, for use like: $scope.dataJson = this.content; I'm using MorrisJs to load wiith this data a Chart, but I try to use inside this scope but didn't work... works outside of this $http this is the reasson because I want to get this value outside. With your code the content is always undefined, I check that directly in the Debugger from Firefox

http://stackoverflow.com/a/28142705
has body: It sounds like you need to trigger a digest once the data has loaded from firebase. I suspect this because the view updates when you click on something. Try calling $timeout after the async code that loads the data. You will need to inject it like $scope into that context. $timeout is a trick to trigger digest loops.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44657953
accepted answer of: http://stackoverflow.com/q/28141824
answers question: http://stackoverflow.com/q/28141824
type: AcceptedAnswer

http://stackoverflow.com/comment/44731086
has text: Actually, when the operator is overloaded. One of them not having any impact on the final result does not change anything. Shameless plug of a question I answered about the feasability of allowing overloaded operators to short-circuit: https://stackoverflow.com/a/25913422
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28180593

http://stackoverflow.com/a/70379121
has comment: http://stackoverflow.com/comment/136385370
type: Answer
upvote count: 4
has body: I changed the accepted answer a little because didn't want to hide Dropzone. So maybe this tiny modification be helpful for others: 1- Made a full width hidden wrapper: DROP HERE 2- Show it on [dragenter] event: window.addEventListener("dragenter", function(e){ // drag start // unhide our green overlay showWrapper(); lastTarget = e.target; // cache the last target here }); 3- if user drop the file, pass it to Dropzone: window.addEventListener("drop", function(e){ e.preventDefault(); hideWrapper(); // if drop, we pass object file to dropzone var myDropzone = Dropzone.forElement(".dropzone"); myDropzone.handleFiles(e.dataTransfer.files); }); I made a live demo with more details on codepen. Thank you
downvote count: 0
answers question: http://stackoverflow.com/q/28226021
score: 4

http://stackoverflow.com/comment/44908999
comment on: http://stackoverflow.com/q/28277312
has text: In addition, `chrome.storage.sync.set` takes a JSON object, not a simple string value: https://developer.chrome.com/extensions/storage
type: QuestionComment
type: Comment
score: 3

http://stackoverflow.com/comment/44696951
has text: If its just a case of your event firing too frequently, you can debounce the event handler. `$.debounce` or vanilla alternative. Otherwise a WebWorker might work well.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28162859
score: 0

http://stackoverflow.com/comment/44780075
has text: no as i said in the js it self they are decoding these with "&" not with "&amp;" , it doesnt work
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28184342

http://stackoverflow.com/q/28131363
has answer: http://stackoverflow.com/a/28132650
possible better answer: http://stackoverflow.com/a/28131495
tagged with: arrays
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28131566
has comment: http://stackoverflow.com/comment/44635410
favorite count: 0
has comment: http://stackoverflow.com/comment/44635370
has comment: http://stackoverflow.com/comment/44635448
has body: I'd like to compare a user input value, to a set of values arranged in an object literal. The user will input two values, a reference variable wk and a number. Those need to be cross referenced in the object literal, but I can't seem to figure out the logic to do so? The object literal is constructed as follows: var reference = { wk31: { _90th: '758', _75th: '683', _50th: '600', _25th: '516', _10th: '441' }, wk32: { _90th: '815', _75th: '734', _50th: '644', _25th: '554', _10th: '472' }, wk33: { _90th: '870', _75th: '783', _50th: '687', _25th: '590', _10th: '503' } } For example, if wk = 32 &amp; number = 755, then I'd like to make the user aware that their number is between the 75th and 90th percentile for that wk value. Any help is appreciated. Thanks.
tagged with: object-literal
accepted answer: http://stackoverflow.com/a/28132650
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44635395
score: 1
upvote count: 1
type: Question
has title: How to I compare an input value to reference values in an object literal?
has answer: http://stackoverflow.com/a/28131517
has comment: http://stackoverflow.com/comment/44635462
has answer: http://stackoverflow.com/a/28131495
tagged with: javascript

http://stackoverflow.com/comment/93612926
type: AnswerComment
comment on: http://stackoverflow.com/a/28260919
score: 0
type: Comment
has text: Thanks for such ace API investigation: saved tons of time for others!

performance-testing
tags question: http://stackoverflow.com/q/28233456
tag name: performance-testing
type: Tag
tags question: http://stackoverflow.com/q/28144173

http://stackoverflow.com/comment/44728111
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28174293
has text: you need to call pickRandom() when closing or opening the overlay
type: AnswerComment

http://stackoverflow.com/a/28122950
has body: The getChart function is just console logging the eventNameList as the array is being built. If you move the getChart function out of the loop it will only log the array after it is finished the loop. You can put it after the loop, after the AJAX, or anywhere besides where it is now and it will display fine. You are watching your code in action and your eyes are playing tricks on you.
answers question: http://stackoverflow.com/q/28122750
type: Answer
score: 0

http://stackoverflow.com/q/28134271
score: 6
tagged with: ecmascript-6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44644527
possible better answer: http://stackoverflow.com/a/28145039
has comment: http://stackoverflow.com/comment/44653899
has body: I'm trying to make an asynchronous loop with native ES6 promises It kind of works, but incorrectly. I suppose I made a huge mistake somewhere and I need someone to tell me where it is and how it's done correctly var i = 0; //creates sample resolver function payloadGenerator(){ return function(resolve) { setTimeout(function(){ i++; resolve(); }, 300) } } // creates resolver that fulfills the promise if condition is false, otherwise rejects the promise. // Used only for routing purpose function controller(condition){ return function(resolve, reject) { console.log('i =', i); condition ? reject('fin') : resolve(); } } // creates resolver that ties payload and controller together // When controller rejects its promise, main fulfills its thus exiting the loop function main(){ return function(resolve, reject) { return new Promise(payloadGenerator()) .then(function(){ return new Promise(controller(i&gt;6)) }) .then(main(),function (err) { console.log(err); resolve(err) }) .catch(function (err) { console.log(err , 'caught'); resolve(err) }) } } new Promise(main()) .catch(function(err){ console.log('caught', err); }) .then(function(){ console.log('exit'); process.exit() }); Now the output: /usr/local/bin/iojs test.js i = 1 i = 2 i = 3 i = 4 i = 5 i = 6 i = 7 fin error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] error: [TypeError: undefined is not a function] caught [TypeError: undefined is not a function] exit Process finished with exit code 0 The good part: it reaches the end. The bad part: it catches some errors and I don't know why.
downvote count: 0
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/28137179
type: Question
has answer: http://stackoverflow.com/a/44053362
upvote count: 6
tagged with: node.js
has answer: http://stackoverflow.com/a/44208280
linked to: http://stackoverflow.com/q/36664272
has comment: http://stackoverflow.com/comment/44648326
has title: Loop with native promises;
has comment: http://stackoverflow.com/comment/44645308
linked to: http://stackoverflow.com/q/36847394
linked to: http://stackoverflow.com/q/750486
accepted answer: http://stackoverflow.com/a/28137179
tagged with: es6-promise
has answer: http://stackoverflow.com/a/28145039
answer count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28134358

http://stackoverflow.com/a/28202729
upvote count: 1
has body: I would probably use XPath for this. You can use evaluateXPathExpression to create an array of the elements you want to target. Assuming your root element is cars and it contains elements called cars1, and you want to delete all free elements within a cars1 element, you could do something like: var myDoc = app.activeDocument; //xmlElements[0] is your root element, in this case "cars". The xPath expression is evaluated from cars. //evaluateXPathExpression returns an array of all of the free elements that are children of cars. var myFrees = myDoc.xmlElements[0].evaluateXPathExpression("cars1/free"); for (var i = myFrees.length - 1; i&gt;=0; i--){ myFrees[i].remove(); } Tweaking this would require some knowledge of xPath, but it's not terribly hard to learn the basics and it does seem like the simplest approach.
has comment: http://stackoverflow.com/comment/44814748
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28194596
type: Answer
has comment: http://stackoverflow.com/comment/45001329
answers question: http://stackoverflow.com/q/28194596
score: 1
has comment: http://stackoverflow.com/comment/44811435

http://stackoverflow.com/comment/44912195
type: QuestionComment
has text: That would suck up more system resources from the browser though right?
type: Comment
comment on: http://stackoverflow.com/q/28278604
score: 0

http://stackoverflow.com/comment/44642416
has text: @Skarlinski: `ajax` returns a promise (well, it returns a `jqXHR`, which is an XHR with promise stuff mixed in). Implementing your own just lets you control what it's resolved/rejected with.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28135001

http://stackoverflow.com/comment/44749300
comment on: http://stackoverflow.com/q/28190919
type: Comment
type: QuestionComment
score: 2
has text: This is something that you should do in your _controller_. Separate business logic from your views.

http://stackoverflow.com/comment/44825672
score: 0
has text: @Jamiec The specific case that prompted this question, is I want to simulate for debugging purposes what happens if the processing time of the script changes a little. i.e. I have a number of events being triggered that could potentially affect the same object, what happens if one of them takes a little more time to execute than expected? If the order in which they complete shifts slightly? But, mostly it's just for interest.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28218863

http://stackoverflow.com/comment/44830512
has text: You're welcome, glad I could help! :) Yes, you had a problem with keys using the standard arrays, but I'm sure you'll never make the same mistake.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28228027
type: Comment

http://stackoverflow.com/comment/44631291
type: Comment
type: QuestionComment
has text: This is not a valid JSON
score: 1
comment on: http://stackoverflow.com/q/28129198

http://stackoverflow.com/q/28256514
has comment: http://stackoverflow.com/comment/44871315
upvote count: 1
has title: Fade in background image on load
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44871303
tagged with: jquery
favorite count: 0
has body: I want to load one of the random background image by using jquery. Below is the script I am using and it shows random background on refresh but without fadeIn effect. How can I create fadeIn effect onload. Note: I don't want to cycle random images. $(document).ready(function() { var images = ['01.jpg', '02.jpg', '03.jpg', '04.jpg', '05.jpg', '06.jpg', '07.jpg', '08.jpg', '09.jpg', '10.jpg']; $('.about').css({'background-image': 'url(../img/bg/' + images[Math.floor(Math.random() * images.length)] + ')'}); ('.about').fadeIn(1000); });
tagged with: fadein
has comment: http://stackoverflow.com/comment/44871328
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44871249
score: 1
has comment: http://stackoverflow.com/comment/44871305
accepted answer: http://stackoverflow.com/a/28256614
type: Question
has comment: http://stackoverflow.com/comment/44871342
tagged with: javascript
has answer: http://stackoverflow.com/a/28256614

http://stackoverflow.com/a/28173417
has comment: http://stackoverflow.com/comment/44716125
has comment: http://stackoverflow.com/comment/44716405
upvote count: 1
has body: Instead of using a for loop and a setTimeout(), you could simply use a setInterval. Using .offsetWidth you could get the width of .track in pixels, subtract .follower's width from it and animate to the new value. var follower = document.getElementsByClassName('follower')[0]; var track = document.getElementsByClassName('track')[0]; var tW; var num = 0; var percentage = 50; function loading() { var num = 0; tW = (percentage * (track.offsetWidth - follower.offsetWidth)) / 100; var anim = setInterval(function() { follower.style.left = num++ + 'px'; if (num &gt; tW) { clearInterval(anim); } }, 10); } function resizeHandler() { tW = (percentage * (track.offsetWidth - follower.offsetWidth)) / 100; follower.style.left = tW + 'px'; } window.onresize = resizeHandler; loading() .track { width: 90%; height: 40px; background: #999; border-radius: 10px; margin: 0 auto; position: relative; } .follower { width: 60px; height: 20px; border: 1px solid; border-radius: 10px; background: #222; position: absolute; top: 54px; left: 100%; } .follower:after { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #222; position: absolute; top: -8px; left: 0; right: 0; margin: auto; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="track"&gt; &lt;div class="follower"&gt;&lt;/div&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/44716003
has comment: http://stackoverflow.com/comment/44716027
type: Answer
answers question: http://stackoverflow.com/q/28172955
downvote count: 0
score: 1

http://stackoverflow.com/comment/91330484
has text: Be careful with this method and empty strings. `!isNaN("")` resolves to true, which is unexpected
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28251237
type: Comment

http://stackoverflow.com/comment/44645850
has text: within the click event you can write var index = $.inArray( $this,$('.mybutton') ); which will return u the index
comment on: http://stackoverflow.com/q/28136931
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28244792
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44850602
has body: I am using asp.net mvc and iis 7 to host some javascript files. I have a simple webpage (in a different domain, but the effect is the same if I serve the page from my own domain) with the following script tags: JQuery loads just fine, where as MYJSFILE does not load at all. I recieve no error in the console, making this hard to investigate. If I enter "http://www.example.com/Scripts/MYJSFILE.js" into the browser, I get the js file in plain text, as though it is being served correctly. Any help/thoughts on this would be fantastic.
score: 0
has title: Some .js files load from server, others dont. No errors
has comment: http://stackoverflow.com/comment/44850642
has comment: http://stackoverflow.com/comment/44850428
tagged with: asp.net-mvc
answer count: 0
tagged with: javascript

http://stackoverflow.com/a/28165867
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28165229
has comment: http://stackoverflow.com/comment/44707039
answers question: http://stackoverflow.com/q/28165229
has body: I added one more attribute in isolated scope, called isChild, when it`s true im listening for event valueChanged. So i bind even listener in controller without function psChanged, and it works. angular.module('plexusSelect', []).directive('plexusSelect', ['$ionicModal', '$timeout', '$ionicScrollDelegate', '$rootScope', function($ionicModal, $timeout, $ionicScrollDelegate, $rootScope) { // Runs during compile return { scope: { 'items': '=', 'id': '@', 'text': '@', 'textIcon': '@', 'headerText': '@', 'textField': '=', 'valueField': '@', 'callback': '&', 'isChild' : '@' }, require: 'ngModel', restrict: 'E', templateUrl: 'plexusSelect.html', controller: ['$scope', '$rootScope', function($scope, $rootScope) { $scope.$watch('value', function(val) { $rootScope.$broadcast('valueChanged', $scope.id); }); if ($scope.isChild === 'true') { //$scope.psChanged = function() { $scope.$on('valueChanged', function(event, value) { if ($scope.id === value) { //Do nothing. } else { $scope.clearSearch(); $scope.value = ''; $scope.text = $scope.defaultText; console.log("Text change"); } }); } } ], html Search plunk
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44702299

http://stackoverflow.com/comment/44655204
score: 0
has text: Any CSS transitions involved?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28141788

http://stackoverflow.com/q/28233018
has comment: http://stackoverflow.com/comment/44829324
tagged with: google-maps
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/10027094
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/28236462
has comment: http://stackoverflow.com/comment/44829397
favorite count: 0
accepted answer: http://stackoverflow.com/a/28236462
has body: I have a problem with this operation using Javascript and Google Maps API. I have a rectangle with their bounds (latitude and longitude). Also, I have a polygon with their bounds (latitude and longitude for each point). I need to get a new polygon with the first rectangle without the polygon, so I need to substract the polygon to the rectangle and get the bounds of the new polygon. How can I do this? Thanks in advance!
upvote count: 2
has comment: http://stackoverflow.com/comment/44830069
has comment: http://stackoverflow.com/comment/44829270
downvote count: 1
type: AnsweredQuestion
has title: Javascript: Subtract polygons with Latitude and Longitude
score: 1
has comment: http://stackoverflow.com/comment/44829770
has comment: http://stackoverflow.com/comment/44829583
has comment: http://stackoverflow.com/comment/44831075
has comment: http://stackoverflow.com/comment/44829699
type: Question

http://stackoverflow.com/q/28220088
has answer: http://stackoverflow.com/a/28220190
accepted answer: http://stackoverflow.com/a/28220791
score: 0
has title: unbinding e.preventDefault from another function to forward to link clicked
has body: Is there a way to get this working on the first click? When the link is clicked it seems to unbind the event, but does not forward to the link till the second click. Is there a way to have it forward to the link on the first click unbinding the e.preventDefault from the click function? jsfiddle: http://jsfiddle.net/542fnbbL/ jQuery: var clickTime = function(e){ $('a').unbind('click').submit(); }; $('a').click(function(e){ e.preventDefault(); clickTime(); });
has answer: http://stackoverflow.com/a/28220791
has comment: http://stackoverflow.com/comment/44803387
type: AnsweredQuestion
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44804703
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28220190

http://stackoverflow.com/q/28269399
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44895248
has body: I am writing an app with dynamic content loads. I am using Iron Router and am aiming to avoid Sessions if possible. I wrote the following route bellow: Router.route('/:publisher',{ name: "publisher", action: function(){ this.render("Publisher") }, data: function(){ return Comics.findOne({publisher: this.params.publisher}); } }); Which works, as it uses .findOne. If I switch .findOne to .find, nothing loads, but there are no errors. Any help is appreciated. Thanks Note: I looked at this link, but it's sadly not the same problem: findOne works but not get all/find
has answer: http://stackoverflow.com/a/28269510
accepted answer: http://stackoverflow.com/a/28269510
type: Question
has title: .findOne works in data attribute of Iron Router Route but .find does not?
tagged with: javascript
upvote count: 2
linked to: http://stackoverflow.com/q/27823478
answer count: 1
tagged with: meteor
favorite count: 0
tagged with: iron-router
has comment: http://stackoverflow.com/comment/44894990

http://stackoverflow.com/comment/44729515
comment on: http://stackoverflow.com/q/28132068
score: 0
type: QuestionComment
type: Comment
has text: You can call chrome.identity.removeCachedAuthToken to flush the token from the cache before you call getAuthToken again. To see the reference on the link: https://developer.chrome.com/apps/identity#method-removeCachedAuthToken

http://stackoverflow.com/a/28146328
accepted answer of: http://stackoverflow.com/q/28146312
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44664376
type: Answer
has body: You can use the attribute selector to achieve this: $("#form-builder-wrapper input[style]").each(function() { alert('Has style attribute'); });
has comment: http://stackoverflow.com/comment/44664468
score: 2
answers question: http://stackoverflow.com/q/28146312
downvote count: 0

http://stackoverflow.com/comment/44785078
has text: When I say alert($('input[id^="textbox_"').val()); IT PRINTS OUT THE VALUE!! However blanks out the dropdown1 when I wrote -- $('.select-change').click(function(){ $('dropdown1').val($('input[id^="textbox_"').val()); });
comment on: http://stackoverflow.com/a/28209725
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44849700
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28244416
score: 0
has text: If you want the text in your select box to be red, you have to describe the style for it separately, and if you want specific css for specific options, you need to use javascript/jquery

http://stackoverflow.com/a/28146003
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28144929
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/28144929
has body: Two things to keep in mind. 1) expect(dataFromDb).toEqual('foo')): Protractor wrapped expect to understand promises. However, it only understands webdriver.promise (i.e. no $q or any other promise). If you want to make assertions against non webdriver promises, you have to resolve the promise yourself like: dataFromDb.then(function(resolvedData) { expect(resolvedData).toEqual('foo') }) 2) Protractor does not "terminate". Protractor only helps you kick off your test using another test framework (i.e. jasmine, mocha); once it does that it is only a library of tools (i.e. locators, waitForAngular, etc) that you run on top of that test framework. It's that other framework you must prevent from terminating. I don't know what framework you're using, but I'll use jasmine as an example: it('call db', function(done) { //notice the inclusion of `done` browser.get('something'); //this is protractor element(by.xyz).click(); //this is protractor var data = queryDatabase(); // you must tell jasmine to wait for this. data.then(function(resolvedData) { expect(resolvedData).toBe('foo'); done(); // tell jasmine you're done. }) }) Side note, protractor patched jasmine it to wait for webdriver commands to finish (just like how it patched expect) for user's convenience. However, if you don't use webdriver's promise you need to tell it when the test is done via the done callback

http://stackoverflow.com/q/28274940
has body: I am trying to get to grips with Knockout and so I have created the following html file... Welcome Say it When I load the page all is well in the land of milk and honey. I get an alert that says the binding is starting.... Then I get another alert saying that its done and when I click the button... Yip you guessed it I get an alert stating that its working. The problem I am having is when I try to separate the java-script code out into an external file it does not apply the bindings. So my html file will look like this...... Welcome Say it And my file "jsfile.js" looks like this.... alert('Binding Started'); function indexViewModel() { this.speak = function() { alert('Working asstastic'); }; } ko.applyBindings(new indexViewModel()); alert('Binding Done'); When I now load the html page I get an alert for the binding starting and then ... Nothing...... :( If I remove the line for the ko.applyBindings(.. then it gives me the second alert that the binding is done. however obviously the button does noting. What am I doing wrong It seems like its not seeing the knockout functions in the .js file but I have hit a brick wall.. Please help..
accepted answer: http://stackoverflow.com/a/28275014
has answer: http://stackoverflow.com/a/28275022
type: AnsweredQuestion
has title: Using a external .js file with knockout not applying bindings
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/28275022
type: Question
tagged with: knockout.js
has answer: http://stackoverflow.com/a/28275014
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/40624792
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28146988
has comment: http://stackoverflow.com/comment/44665820
has comment: http://stackoverflow.com/comment/44666601
score: 0
has comment: http://stackoverflow.com/comment/44665669
has answer: http://stackoverflow.com/a/28164271
tagged with: javascript
type: UnansweredQuestion
has title: Angular promise does not resolve when I want it
type: Question
tagged with: asynchronous
tagged with: angularjs
tagged with: angular-promise
answer count: 1
tagged with: firebase
has body: I am fighting with Angular's promises to let them resolve when I want it. Given my code below, I first want to retrieve the KeyDataFromServer() and only then execute the rest of the commands after all the Keys have been loaded from the server. However, with the setup as below, first the other commands are executed and shown in my view and then when the data is loaded from the server, the server data is included. What am I doing wrong? // controller (injected $q and KeyGenerationService) $scope.KeyData = null; var defer = $q.defer(); var promise = defer.promise; promise .then( function() { var KeyData = { Server: KeyGenerationService.getKeyDataFromServer() }; return KeyData }) .then( function(KeyDataFromFunction1) { var KeyData = { KeyDateGroup: KeyGenerationService.generateKeyDateGroup(), KeyID: KeyGenerationService.generateKeyID(), Server: KeyDataFromFunction1.Server }; return KeyData }) .then( function(KeyDataFromFunction2){ $scope.KeyData = KeyDataFromFunction2; }) .catch( function(error){ window.alert(error); }) defer.resolve($scope.KeyData) // factory .factory('KeyGenerationService', function($q, fbutil) { // returns return { generateKeyDateGroup: function() { var today = new Date(); var d = today; var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd&lt;10) { dd='0'+dd } if(mm&lt;10) { mm='0'+mm } today = yyyy+''+mm+''+ dd; return today; }, generateKeyID: function() { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (d + Math.random()*16)%16 | 0; d = Math.floor(d/16); return (c=='x' ? r : (r&amp;0x3|0x8)).toString(16); }); return uuid; } getKeyDataFromServer: function() { return fbutil.syncArray('keys'); } } // return }) // .factory KeyGenerationService

http://stackoverflow.com/q/28165995
upvote count: 2
has comment: http://stackoverflow.com/comment/44706781
tagged with: socket.io
has comment: http://stackoverflow.com/comment/44708807
tagged with: mootools
type: Question
has body: Good morning, i have a client side Mootools class. Inside this class i have a socket.io variable. From server side i send a service message (emit) to the client and i want the client disconnect, reinizialize the socket.io and reconnect to the server. My problems is in the reinizialize socket.io variable. I try the command "delete socket.io" but seems not work and when the socket.io reconnect to the server it receive data message twice. How can i do to delete the socket.io variable inside my class and recreate it? Thanks in advance var Push = new Class({ Implements: [Events], attachSocketIOEvents : function() { var self = this; self.socketIO.on('connecting', function () { self.logger.info('Connessione in corso...'); }); self.socketIO.on('connect', function(){ self.clientId = self.socketIO.io.engine.id; self.logger.info('Connessione avvenuta. Id associato: ', self.socketIO.io.engine.id); }); self.socketIO.on('connect_failed', function() { self.logger.error('Connessione fallita'); self.initSocketIOConnection(); }); self.socketIO.on('reconnecting', function() { self.logger.error('Riconnessione in corso'); self.isReconnect = true; }); self.socketIO.on('disconnect', function() { self.logger.error('Client disconnesso'); }); self.socketIO.on('error', function (error) { self.logger.error(error); }); self.socketIO.on('servicedata', function(data) { self.processServiceMessage(data); }); self.socketIO.on('updatedata', function(data) { self.processUpdateMessage(data); }); }, initialize : function(domContainer) { var self = this; this.socketIO = ''; this.clientId = ''; this.container = ''; this.socketIoUrl = ''.concat(window.location.protocol, '//', window.location.host, '/mfwebpushjs'); if (this.isValidHTML) { self.processDOMButtons(); self.attachPushClassEvents(); } }, initSocketIOConnection: function() { var self = this; if (self.socketIO === '' || self.socketIO.connected == false) { self.socketIO = io.connect(this.socketIoUrl, { 'query': "enviroment=" + self.enviroment + "&am…
tagged with: javascript
has comment: http://stackoverflow.com/comment/44708701
has title: Destroy Socket.io in client side
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44704422
answer count: 0

http://stackoverflow.com/q/28191243
score: 58
type: Question
linked to: http://stackoverflow.com/q/43229233
tagged with: mocha.js
has answer: http://stackoverflow.com/a/28191657
answer count: 6
has answer: http://stackoverflow.com/a/46330238
linked to: http://stackoverflow.com/q/24153261
has answer: http://stackoverflow.com/a/31730467
has comment: http://stackoverflow.com/comment/45100322
has answer: http://stackoverflow.com/a/36266849
has title: How can I make Mocha load a helper.js file that defines global hooks or utilities?
downvote count: 0
has answer: http://stackoverflow.com/a/59874822
tagged with: javascript
linked to: http://stackoverflow.com/q/31282839
possible better answer: http://stackoverflow.com/a/31730467
favorite count: 0
has body: I have a file named test/helper.js that I use to run Mocha tests on my Node.js apps. My tests structure looks like: test/ test/helper.js # global before/after test/api/sometest.spec.js test/models/somemodel.spec.js ... more here The file helper.js has to be loaded because it contains global hooks for my test suite. When I run Mocha to execute the whole test suite like this: mocha --recursive test/ the helper.js file is loaded before my tests and my before hook gets executed as expected. However, when I run just one specific test, helper.js is not loaded before the test. This is how I run it: mocha test/api/sometest.spec.js No global before called, not even a console.log('I WAS HERE');. So how can I get Mocha to always load my helper.js file?
accepted answer: http://stackoverflow.com/a/28191657
has answer: http://stackoverflow.com/a/42671728
upvote count: 58
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28276597
answer count: 1
has title: How can I set ng-model in jQuery callback
tagged with: angularjs
has answer: http://stackoverflow.com/a/28276786
accepted answer: http://stackoverflow.com/a/28276786
type: AnsweredQuestion
has body: &lt;script&gt; $("#point-range").ionRangeSlider({ min: 0, max: 10, from: 1, from_min: 1, from_max: 10, step: 1, grid: true, hide_min_max: true, onFinish: function (data) { $('#point-value').val(data.from); } }); &lt;/script&gt; How can I set value for ng-model when onFinish function is called. I try to set value into a hidden input: onFinish: function (data) { $('#point-value').val(data.from); } {{ Form::hidden('point', null, ['ng-model' =&gt; 'evaluationData.point', 'id' =&gt; 'point-value']) }} But when I submit the form, I don't get evaluationData.point.
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44657392
has text: Not if your used `@Model` because razor code is parsed on the server. Check the html generated by `var myModel = JSON.parse('@Html.Raw(Json.Encode(Model.Product))');` - its the original model and the value of `myModel` does not change just because you change the value in a text box. You need to serialize the form and post that back using ajax.
type: QuestionComment
comment on: http://stackoverflow.com/q/28138918
type: Comment
score: 0

http://stackoverflow.com/a/28175828
downvote count: 0
answers question: http://stackoverflow.com/q/28172726
accepted answer of: http://stackoverflow.com/q/28172726
upvote count: 2
has body: You could create a globally accessible variable called isSpecPhase, and set it initially to false. Then, define a global beforeEach: beforeEach(function () { isSpecPhase = true; }); Make sure to define the beforeEach before all your other suites, so that it runs before each of your specs. In your util function, you could then check if isSpecPhase === true, and throw an exception otherwise.
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/comment/44648633
type: AnswerComment
has text: Thanks for the answer! Sometimes even the most simple things can mess with your mind, I guess :)
score: 0
comment on: http://stackoverflow.com/a/28138279
type: Comment

http://stackoverflow.com/comment/44887209
has text: The header seems to be a bit high-flying ; ). Assigning the interval to a variable, and using that variable as id in [`clearInterval(id)`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setInterval) will stop the clock though.
comment on: http://stackoverflow.com/q/28265290
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28143574
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28143487
has body: Depending on how granular you wanted to be, you could use seconds or milliseconds. So: var time = 900; // 900 seconds = 15:00 Then in your JavaScript you could instantiate that time in todays date like so: // get the current date and time var date = new Date(); // reset the hours, mins, seconds, ms date.setHours(0, 0, 0, 0); // set according to the stored time date.setSeconds(time); In answer to a more standardised approach: most computers use the Unix Timestamp, which counts the number of milliseconds from 1 January 1970 UTC. But, as you've already stated, the date is not important to you. Regardless of the importance of the day/month/year - using seconds or milliseconds is a good way of rehabilitating your data back into the common JavaScript Date object, which is a very useful thing at the application level. For a mammoth amount of over-consideration and syntactic sugar, you may or may not find Moment useful. var time = 900; // get the current date and time var date = new Date(); // reset the hours, mins, seconds, ms date.setHours(0, 0, 0, 0); // set according to the stored time date.setSeconds(time); document.body.innerHTML = date;
score: 10
upvote count: 10

http://stackoverflow.com/comment/44774654
type: Comment
has text: you put `{{var}}` on the main page, it should reside in the child's template
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28203887

http://stackoverflow.com/comment/44627070
type: AnswerComment
comment on: http://stackoverflow.com/a/28126931
type: Comment
has text: So I suppose that after a successful insert, you need to know what the random number is that was just inserted?
score: 0

http://stackoverflow.com/a/28235020
has comment: http://stackoverflow.com/comment/44833742
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44834097
type: Answer
answers question: http://stackoverflow.com/q/28234894
has body: You could try flexbox nav { display: flex; justify-content: center; } nav ul { display: flex; list-style: none; margin: 0; padding: 0; } nav li a { padding: 1rem 2rem; } NAV #1 NAV #2 NAV #3 NAV #4 NAV #5
score: 1

http://stackoverflow.com/comment/44847926
score: 0
type: Comment
has text: This is closer to what I am looking for, check the edit for what I kind of want to do.
type: AnswerComment
comment on: http://stackoverflow.com/a/28239876

http://stackoverflow.com/a/28180953
has body: I actually have a canvasDiv container, which is the real scrollable element, not the canvas itself. This means your canvas is the full size and you're using the container div as a sort of a "frame". That's really bad as canvas pixels are quite expensive, especially if you're not even using them (they're out of the viewport). The best approach here is to set the canvas size to the container size and use the drawImage function to control the scrolling. The original image would be places either on an offscreen canvas or an image element. I can guarantee you a much better performance this way. You'll lose the scrollbars, that's the downside.
downvote count: 0
has comment: http://stackoverflow.com/comment/44731502
score: 1
has comment: http://stackoverflow.com/comment/44731574
accepted answer of: http://stackoverflow.com/q/28180574
upvote count: 1
answers question: http://stackoverflow.com/q/28180574
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44731669
has comment: http://stackoverflow.com/comment/44731221
type: Answer
has comment: http://stackoverflow.com/comment/44731182

http://stackoverflow.com/q/28224912
has comment: http://stackoverflow.com/comment/44813508
answer count: 0
downvote count: 0
score: 1
tagged with: ionic-framework
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has body: Title might be a little confusing, but I'll explain. I have this Header with dynamic content that will be displayed in every page. So I created a controller to it: .controller("HeaderCtrl", function($log) { var HeaderCtrl = this; HeaderCtrl.HelpButtonVisible = "false"; HeaderCtrl.HideHelpButton = function() { HeaderCtrl.HelpButtonVisible = "false"; $log.log("HideHelpButton"); } HeaderCtrl.ShowHelpButton = function() { HeaderCtrl.HelpButtonVisible = "true"; $log.log("ShowHelpButton"); } $log.log("HeaderCtrl Initialized"); }) And I have the index.html: {{}} Help The Controller is referenced in the body tag: Then I have the login.html, which is redered in the index.html . In this template, I have a button: Login For some reason, as soon as I load the page, I get the following log: HeaderCtrl Initialized ionic.bundle.js:19387 ShowHelpButton ionic.bundle.js:19387 ShowHelpButton ionic.bundle.js:19387 ShowHelpButton ionic.bundle.js:19387 ShowHelpButton (2) ionic.bundle.js:19387 ShowHelpButton Why is it being called so many times? I didn't even click the button, I don't understand why it's being called at all.
favorite count: 0
has comment: http://stackoverflow.com/comment/44813041
tagged with: angularjs
type: UnansweredQuestion
has title: Ng-click being called multiple times without being fired

http://stackoverflow.com/comment/44930298
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28247421
has text: Yes, you should definitely do that. My code is just meant to show you the approach, it's not meant to be used as it is in production. You should definitely clear the cache immediately after use. You should also make sanity checks in your Get method for what is retrieved from the cache, before using it. Also, you might want to take additional security precautions, because in this way ANY content stored in cache can be accessed. Using a prefix for the cache key might be enough in your case.

http://stackoverflow.com/q/28128150
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28128274
has title: Submit a form generated by jquery
has answer: http://stackoverflow.com/a/28128220
accepted answer: http://stackoverflow.com/a/28128198
type: Question
has body: The login form on my site is shown using an overlay/modal with jquery-modal (http://kylefox.ca/jquery-modal/examples/) I'm using ajax + php to validate the form. If validation passes, the form should be submitted. I can halt the submit for validation (using return false), and the validation itself is working fine. But I don't know how to submit the form I have tried many naive variations: return true, $theform.submit(), $("body").unbind("#myloginform") and more.. but so far no luck $("body").on("submit", "#myloginform", function() { $theform = $(this); $.ajax({ url: "login_check.php", type: "POST", cache: false, timeout: 9000, data: $theform.serialize(), dataType: "json", success: function(data) { if (data) { if (data.status == "ok") { alert("success! now the form can be submitted"); // SUBMIT THE FORM (instead of the alert) } else { $("body #loginstatus").html(data.status); } } else { alert("Error bla bla."); } }, error: function(e) { alert("Error (ajax) bla bla."); } }); return false; });
tagged with: javascript
tagged with: forms
has answer: http://stackoverflow.com/a/28128198
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28128274
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/44629253
has comment: http://stackoverflow.com/comment/44629380

http://stackoverflow.com/q/28219354
has comment: http://stackoverflow.com/comment/44802920
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28220591
score: 0
answer count: 3
tagged with: checkbox
has title: Click Label if checkbox prop check is true
has comment: http://stackoverflow.com/comment/44802261
has answer: http://stackoverflow.com/a/28219401
has answer: http://stackoverflow.com/a/28220193
tagged with: siblings
possible better answer: http://stackoverflow.com/a/28219401
type: Question
has comment: http://stackoverflow.com/comment/44802422
type: AnsweredQuestion
has body: All check boxes by default are unchecked. I cannot use radio buttons in the problem. When a checkbox is changed to 'checked' then look to see if any of the sibling checkboxes are 'checked', if it is then .click() the parent of the checkbox. I have to .click() the because the connected API is listening for a click on the label, $('input').prop("checked", false); doesn't seem to work. Here is the structure: Product Filter Original Pouch Original Can Gold Pouch Gold Can Menthol Pouch Menthol Can This is what i tried but it's wrong. $('.featureCheck').click(function(){ if $('.featureCheck').siblings().prop('checked',true){ this.find('label').click(); } });
has comment: http://stackoverflow.com/comment/44803695
has answer: http://stackoverflow.com/a/28220591

http://stackoverflow.com/comment/44806259
type: Comment
score: 1
has text: I don't see a jQuery tag, and the OP seems to be new to JavaScript, don't expect him or her to know jQuery.
type: AnswerComment
comment on: http://stackoverflow.com/a/28220079

http://stackoverflow.com/comment/44855559
has text: You do know that Java is a completly different language than javascript or GWT, right?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28247451
score: 0

http://stackoverflow.com/q/28169982
tagged with: d3.js
has title: d3.js (d.geometry.coordinates) issue when placing labels
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44711668
type: Question
answer count: 1
tagged with: javascript
has body: I'm trying to place labels using the larskotthoff block page http://bl.ocks.org/larskotthoff/11406992 The issue I'm having is where the labels translate is worked out on the line. .attr("transform", function (d) { return "translate(" + projection(d.geometry.coordinates[0][0][0]) + ")"; }) So in his guide he is not doing d.geometry.coordinates[0][0][0] but just d.geometry.coordinates. This works for him because he is not working out the labels for multi-polygons because when I tried without the [0][0][0] So my labels are not where they should be as you can see in the following image. Although I've managed to get the labels drawing the structure of my feature (in this case d) is different and not a single array of coordinates. It is a 3 dimension array. So for this reason the placement (translate) is happening based on the first element [0][0][0] of each dimension. How do I overcome this? I want it to work out its placement from the whole set of polygons. Does d3 make something available for this? UPDATE: Solution (thanks to Lars) .data(json.features) .enter().append("text") .attr("class", "place-label") .attr("transform", function (d) { console.log("test"); return "translate(" + path.centroid(d) + ")"; }) .attr("x", function (d) { return path.centroid(d)[0] &gt; -1 ? 6 : -6; }) .attr("dy", ".35em") .style("text-anchor", function (d) { return path.centroid(d)[0] &gt; -1 ? "start" : "end"; })
tagged with: label
has comment: http://stackoverflow.com/comment/44709834
score: 0
linked to: http://stackoverflow.com/q/13897534
has answer: http://stackoverflow.com/a/40846371
accepted answer: http://stackoverflow.com/a/40846371

http://stackoverflow.com/comment/44708393
comment on: http://stackoverflow.com/a/28169284
type: AnswerComment
score: 0
type: Comment
has text: I've ticked the other answer but you're both right so thank you. I'd upvote if I had sufficient reputation!

http://stackoverflow.com/comment/44757106
type: Comment
type: QuestionComment
has text: Have you tried `height: 100%;` on the section that needs to stretch?
comment on: http://stackoverflow.com/q/28195131
score: 0

http://stackoverflow.com/a/28174923
type: Answer
answers question: http://stackoverflow.com/q/28159523
score: 0
has body: David Millar's code pointed me in the right direction. I tried to put the initEventHandling function in the onload of the body tag but I couldn't get it to work. It executed the function but I could not get the eventListeners to work. I solved it by creating an event listener using the onload for each img tag, so my code ended up like this: &lt;img id=\"".$appChart['ID']."_down-arrow\" onload=\"addEvent('".$appChart['ID']."')\" onclick=\"clickReviewArrow('".$appChart['ID']."')\" src='...' /&gt; javascript: function addEvent(ID) { var downArrow = document.getElementById(ID+'_down-arrow'); downArrow.addEventListener('click',arrowCheck,false); } function arrowCheck(e) { e.stopPropagation(); } David Millar may have been suggesting this, if so I'll mark his answer.

http://stackoverflow.com/comment/44817155
comment on: http://stackoverflow.com/a/28226943
score: 0
type: AnswerComment
has text: If it's for a really specific need a regex is probably easier to implement indeed.
type: Comment

http://stackoverflow.com/comment/44816465
score: 0
type: QuestionComment
type: Comment
has text: Well, I was abusing the JS language a bit it seems by adding named properties to an array (this works because arrays are objects), but you were right to pinpoint that as the problem. I've spun out the named props into separate objects and `track by` is now working. The performance still isn't what I had hoped it would be, and I'll look into other ways to improve performance, but it's much better. Thanks for the help. I would be happy to accept an answer if you feel like posting one (i.e. rephrasing the above question as a statement).
comment on: http://stackoverflow.com/q/28209526

http://stackoverflow.com/comment/44684128
comment on: http://stackoverflow.com/q/28156270
has text: yes. I took out the fading out code because it would only make the div invisible, not make it delete
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28246643
type: Answer
has comment: http://stackoverflow.com/comment/45104136
has body: Using https://code.google.com/p/jquery-aop/ it is "easy". Create a native JSNI method such that you can access "this" as the local GWT module functions...: public static native void weave() /*-{ $wnd.jQuery.aop.around({ target : this, method : 'viewScene.*' }, function(invocation) { var t0 = $wnd.performance.now(); var result = invocation.proceed(); var t1 = $wnd.performance.now(); console.log("Call to " + invocation.method + " took " + (t1 - t0) + " milliseconds.") return result; }); }-*/; The only challenge now is how to associate "function viewScene_0_g$" with the original code. However, this should be possible with the sourcemaps.
score: 0
answers question: http://stackoverflow.com/q/28204716

http://stackoverflow.com/comment/44654180
type: Comment
has text: Make sure you understand how and where php works.
comment on: http://stackoverflow.com/q/28141263
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44662383
type: QuestionComment
comment on: http://stackoverflow.com/q/28145259
has text: Also see this solution: https://remysharp.com/2013/01/14/cors-isnt-just-for-xhr
score: 0
type: Comment

http://stackoverflow.com/comment/44793427
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28214222
has text: @EikePierstorff I was afraid of that. And I guess it's not possible to catch events like `onKeyPressed` from within iframe with JavaScript outside it? That's bad :(

http://stackoverflow.com/comment/44757675
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28195465
has text: you can forget about the controller and do it all in your html: ```ng-click='myvar = !myvar'```. This is maybe also the solution, because you scope/controller is not loaded?

http://stackoverflow.com/a/28203475
accepted answer of: http://stackoverflow.com/q/28202811
upvote count: 2
type: Answer
score: 2
has body: The problem is that .replace belong to the String prototype. You are getting TypeError: html.replace is not a function because html is not a string. To fix this, you should cast html to a string and then perform the necessary .replace operation: var htmlParse = html.toString().replace(/* etc */);
answers question: http://stackoverflow.com/q/28202811
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44873586
score: 0
comment on: http://stackoverflow.com/a/28257712
type: AnswerComment
has text: still not working, as i said, it may be cause i render them? : http://gyazo.com/4eae72e08ef33415c38f904c01a9c915
type: Comment

http://stackoverflow.com/a/28332839
accepted answer of: http://stackoverflow.com/q/28174502
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/69949272
type: AcceptedAnswer
downvote count: 0
has body: You shouldn't use both the key and the direction in a single string on your order. From the docs: 'username DESC', // will return username DESC -- i.e. don't do it! The correct solution is: order: ['updatedAt', 'DESC'] Complete working example: 'use strict'; var Sequelize = require('sequelize'); var sequelize = new Sequelize( 'test', // database 'test', // username 'test', // password { host: 'localhost', dialect: 'postgres' } ); var Customer = sequelize.define('Customer', { firstName: {type: Sequelize.STRING}, lastName: {type: Sequelize.STRING} }); var Order = sequelize.define('Order', { amount: {type: Sequelize.FLOAT} }); var firstCustomer; Customer.hasMany(Order, {constraints: true}); Order.belongsTo(Customer, {constraints: true}); sequelize.sync({force: true}) .then(function () { return Customer.create({firstName: 'Test', lastName: 'Testerson'}); }) .then(function (author1) { firstCustomer = author1; return Order.create({CustomerId: firstCustomer.id, amount: 10}); }) .then(function () { return Order.create({CustomerId: firstCustomer.id, amount: 20}) }) .then(function () { return Order.findAll({ limit: 10, include: [Customer], order: [ ['updatedAt', 'DESC'] ] }); }) .then(function displayResults(results) { results.forEach(function (c) { console.dir(c.toJSON()); }); }) .then(function () { process.exit(0); }); Produces: SELECT "Order"."id", "Order"."amount", "Order"."createdAt", "Order"."updatedAt", "Order"."CustomerId", "Customer"."id" AS "Customer.id", "Customer"."firstName" AS "Customer.firstName", "Customer"."lastName" AS "Customer.lastName", "Customer"."createdAt" AS "Customer.createdAt", "Customer"."updatedAt" AS "Customer.updatedAt" FROM "Orders" AS "Order" LEFT OUTER JOIN "Customers" AS "Customer" ON "Order"."CustomerId" = "Customer"."id" ORDER BY "Order"."updatedAt" DESC LIMIT 10;
type: Answer
answers question: http://stackoverflow.com/q/28174502
has comment: http://stackoverflow.com/comment/61778551

http://stackoverflow.com/comment/44697844
has text: This what I was looking for! Tested it and it works. Beautiful. Thanks @Aaron!!
comment on: http://stackoverflow.com/a/28163354
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44818867
score: 0
comment on: http://stackoverflow.com/q/28227925
type: Comment
type: QuestionComment
has text: Just move your `or` up. End each line with `or` instead of starting with it.

http://stackoverflow.com/a/28232195
has body: In your index.html, remove double brackets in attribute item, &lt;bootstrap-menuitem ng-repeat="item in menuItems" item="item"&gt;&lt;/bootstrap-menuItem&gt; Besides, in your bootstrapMenuitem, change scope item's declaration from item: "@" to item: "=": app.directive('bootstrapMenuitem',function(){ return { restrict:'EA', templateUrl:'bootstrap-menuItem.html', scope:{ item:"=" }, link:function(scope,element,attrs){ console.log(scope); console.log(element); console.log(attrs); } } }); This way, item can be passed to your directive's template as an object instead of plain text string.
type: Answer
has comment: http://stackoverflow.com/comment/44826642
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44827350
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28232073
has comment: http://stackoverflow.com/comment/44827952
answers question: http://stackoverflow.com/q/28232073
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44832415

http://stackoverflow.com/a/28244042
type: Answer
upvote count: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/44850437
score: -1
answers question: http://stackoverflow.com/q/28243732
has comment: http://stackoverflow.com/comment/44849072
has body: Then start from the beginning: Is your query right? Do you have datas in your controller and how is the JSON looking?

http://stackoverflow.com/q/28221590
tagged with: mesh
has comment: http://stackoverflow.com/comment/44806452
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28236290
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28236290
favorite count: 0
tagged with: geometry
has comment: http://stackoverflow.com/comment/44806616
tagged with: three.js
has title: Determine if a mesh is inside another mesh in threejs
score: 2
has comment: http://stackoverflow.com/comment/44806262
upvote count: 2
has body: I am playing with three JS and want to determine if a mesh is fully inside another mesh. I wrote a little robot which should run into a home box navigated by the player. I know how to detect collision, but is there an easy way to detect if an object is inside another object? I could calculate center Position of the homebox and compare to robot Position, but maybe there is something build in to threejs.
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/44719875
score: 0
comment on: http://stackoverflow.com/q/28174857
has text: Yes, if two digits are beside and sequential, it should return true
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28146748
score: 3
possible better answer: http://stackoverflow.com/a/45644632
has answer: http://stackoverflow.com/a/45644632
upvote count: 3
tagged with: reactjs
answer count: 2
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28146821
has body: I have a Window (a div) in React that I want to be resizable. Using the onMouseDown={this.handleMouseDown} interface I can implement it, but the problem is that those handlers will only be called as long as I stay inside the div. When you resize an element, you often move the cursor outside the div to indicate that you want it to grow. Therefore, I want to attach a global listener to onMouseMove in the onMouseDown event so that I can achieve that. How would I go about that, or is there a better way?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28146821
downvote count: 0
type: Question
has title: How can I dynamically attach an event in React?

http://stackoverflow.com/q/28138566
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28138589
accepted answer: http://stackoverflow.com/a/28138589
has body: I am trying to parse this array of checkbox values and remove the "N". Using the replace function yields the error TypeError: numberArr[i].replace is not a function, and if I remove the replace function, the script simply outputs NaN for my values. Fiddle here http://jsfiddle.net/j0w5tkg9/3/ &lt;div id='opts'&gt; &lt;input type="checkbox" data-cost="0" value="44N12345" name="options[]"&gt; &lt;input type="checkbox" data-cost="0" value="55N6789" name="options[]"&gt; &lt;/div&gt; &lt;div id='output'&gt;&lt;/div&gt; function getAllocArray() { var numberArr = $.map($('input:checkbox:checked'), function (e, i) { return +e.value; }); var varOutput = '&lt;ul&gt;'; for (var i = 0, len = numberArr.length; i &lt; len; i++) { varOutput += "&lt;li&gt;" + numberArr[i].replace(/N/,'') + "&lt;/li&gt;"; } varOutput += '&lt;/ul&gt;'; $('#output').text(varOutput); }; $('#opts').on('click', 'input:checkbox', null, getAllocArray);
type: Question
has comment: http://stackoverflow.com/comment/44648653
score: 0
has comment: http://stackoverflow.com/comment/44648731
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44648667
has title: jquery map array returning NaN in iterator
has comment: http://stackoverflow.com/comment/44648838

http://stackoverflow.com/comment/44688230
has text: Can you include the code that ran this check? I suspect there's some minor detail in the implementation that will shed light on the issue.
type: Comment
type: QuestionComment
score: 11
comment on: http://stackoverflow.com/q/28158472

http://stackoverflow.com/a/28449056
has body: Your Tag is firing with wrong variables for a number of reasons. If the dataLayer.push() were correct, you Tag would only need the {{url}} matches RegEx .* as its rule, since all pushes that occur before the container snippet are available to the All Pages rule. However, you can also push the 'event' : 'GAEvent' pre-container-snippet, if you wish. But then you must remove the {{url}} rule, as it would make your tag fire twice: First with {{event}} equals GAEvent and then with the {{url}} rule. The reason why your code doesn't work even if you fix the above issues is because you have renamed the dataLayer object in your container snippet: })(window, document, 'script', 'primecont', 'GTM-1234'); the 'primecont' String is the new name for Google Tag Manager's Data Layer that you have given, for some reason. This is why your dataLayer.push() will not work, since Google Tag Manager is listening for a primecont.push() instead. So, either change all your dataLayer interactions to primecont, or edit the container snippet's invocation line to look like this: })(window, document, 'script', 'dataLayer', 'GTM-1234');
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28236289
score: 6
answers question: http://stackoverflow.com/q/28236289
has comment: http://stackoverflow.com/comment/45259468
type: Answer
upvote count: 6

http://stackoverflow.com/a/28224796
downvote count: 0
score: 5
has body: Reduce everything you have to: jQuery( "ul.fusion-megamenu &gt; li" ).hover( function(){ jQuery(this).find('ul.sub-menu').show(); }, function(){ jQuery(this).find('ul.sub-menu').hide(); } ); By using jQuery(this).find() you only search the list relative to the list you hover over.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44814801
accepted answer of: http://stackoverflow.com/q/28224676
answers question: http://stackoverflow.com/q/28224676
upvote count: 5
has comment: http://stackoverflow.com/comment/44813859
type: Answer

http://stackoverflow.com/comment/44689489
type: QuestionComment
has text: @DanBracuk Changing the input from submit to button have the same effect. It won't validate first. The modal dialogue (signin) window has all the functions that you have mentioned. It submits the form when login is successful. Unfortunately, the validation is skipped.
score: 0
comment on: http://stackoverflow.com/q/28142742
type: Comment

http://stackoverflow.com/comment/44750450
score: 0
type: Comment
has text: @techie_28 You can pre-process the result within the `getData` function. Please see my edit.
comment on: http://stackoverflow.com/a/28173552
type: AnswerComment

http://stackoverflow.com/a/28146001
answers question: http://stackoverflow.com/q/28145963
has comment: http://stackoverflow.com/comment/76604722
has comment: http://stackoverflow.com/comment/44663819
upvote count: 5
score: 5
has body: What is your goal? In your code you design your structure same to your desktop structure. Change the div classes in your inner container to something like this: &lt;div class="col-lg-2 col-md-2 col-sm-4 col-xs-4"&gt; The number after the classes indicates the width inside the grid. The prefix col-lg, col-md, col-sm, col-xs indicates the different screen sizes (desktop, tablet, mobile) More information you can find in the bootstraps grid section: http://getbootstrap.com/css/#grid
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44663777
type: Answer
accepted answer of: http://stackoverflow.com/q/28145963

http://stackoverflow.com/q/28134555
type: Question
has title: Javascript: Is there any backdoor way to access the real hidden/private length property of an array?
possible better answer: http://stackoverflow.com/a/28134926
answer count: 2
has answer: http://stackoverflow.com/a/28134721
accepted answer: http://stackoverflow.com/a/28134721
tagged with: javascript
has comment: http://stackoverflow.com/comment/44641800
has comment: http://stackoverflow.com/comment/44641385
score: 0
has body: I learned at the JavaScript Garden that an arrays length property is a facade. It is an API and not the literal property that holds the length. It acts as a getter/setter to the real length property: "While the getter of the length property simply returns the number of elements that are contained in the array, the setter can be used to truncate the array." Is there any backdoor way to access the real hidden/private length property of an array?
has answer: http://stackoverflow.com/a/28134926
has comment: http://stackoverflow.com/comment/44641457
has comment: http://stackoverflow.com/comment/44641310
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44641290

http://stackoverflow.com/comment/44848588
type: Comment
comment on: http://stackoverflow.com/q/28243775
type: QuestionComment
has text: @RobertHarvey Whether you call them references or pointers, they refer to the values, not the variables.
score: 0

http://stackoverflow.com/q/28219419
has comment: http://stackoverflow.com/comment/44802501
has title: Angular, ng-repeat with some kind of recursive search
has body: I have a bit of a strange problem I am trying to solve. I have an idea of how I may be able to solve it, but I'm certainly open to any advice or other directions I could take because I'm not entirely sure this is the right route. What I'm trying to do is have an ng-repeat but have it show the lowest level items in the object (it's a big object) that are inside a key of 'apps'. So the object is set up like so ( I would like to note it would be great if I didn't have to change this object too much as it is being used elsewhere as well) Here is one item inside the object. $scope.myObject = [{ name: 'Name1', subs: [ { name: 'Sub 1', subs: [ { name: 'Sub 1-1', apps: [ { name: 'App 1' } ] } ], apps: [ { name: 'App' } ] } So the idea is - any level inside the object can either have subs or apps. Subs means it has group inside of it, and the apps array is the lowest desired level. My intended effect is do be able to do a repeat of myObject where it only shows the apps, the order does not really matter right now but I would like to traverse inside the whole object and pull out any apps, regardless of how deep they are. I could use some guidance in how to retrieve all the apps inside this object, any help would be greatly appreciated. Thanks! Edit 1 : So to clarify, the end result I am looking for is to do something like an ng-repeat (again it doesn't have to be a repeat necessarily ) and end up with a list of all the apps, regardless of where they are in the object. so like - {{name}} would spit back only apps , so App 1 and App in this example object. Edit 2 : Here is my recursion attempt
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44802153
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28221855
has comment: http://stackoverflow.com/comment/44802786
type: Question
linked to: http://stackoverflow.com/q/14430655
score: 3
has comment: http://stackoverflow.com/comment/44802420
has comment: http://stackoverflow.com/comment/44802543
favorite count: 0
tagged with: angularjs
upvote count: 3
has comment: http://stackoverflow.com/comment/44802837
answer count: 1

http://stackoverflow.com/a/28209359
score: 9
downvote count: 0
answers question: http://stackoverflow.com/q/28209328
type: Answer
has body: You can disable selectability of future dates by specifying 0 for the maxDate option. Documentation $( "#datepicker" ).datepicker({ maxDate: 0 // 1 for tomorrow, 2 for day-after, and so on.. });
upvote count: 9

http://stackoverflow.com/comment/44889677
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28266061
type: AnswerComment
has text: Also to answer your first question, yes, you need to specify that.

http://stackoverflow.com/a/28219624
upvote count: 0
type: Answer
has body: First, keep your success &amp; error callbacks in ajax call. This is syntex mismatch..please correct. Second, data:{} should be serialized in json string. $.ajax({ url: "https://euw.api.pvp.net/api/lol/" + region + "/v1.4/summoner/by-name/" + sumName + "?api_key=MYAPIKEYIDONTSHOWYOU", type: "GET", dataType: "json", data: JSON.stringify({}), success: function (json) { var sumNameNoSpace = sumName.replace(" ", ""), sumID = json[sumNameNoSpace].id; console.log(sumID); }, error: function (XMLHttpRequest, textStatus, errorThrown) ({ alert("error getting Summoner data!"); } });
downvote count: 1
answers question: http://stackoverflow.com/q/28219551
score: -1

passport.js
tags question: http://stackoverflow.com/q/28139894
tag name: passport.js
tags question: http://stackoverflow.com/q/28258153
tags question: http://stackoverflow.com/q/28131736
type: Tag
tags question: http://stackoverflow.com/q/28143064

http://stackoverflow.com/comment/44782092
comment on: http://stackoverflow.com/q/28208523
score: 0
type: Comment
type: QuestionComment
has text: Use a factory to link $scopes across different views. Example & demo code here http://stackoverflow.com/a/25418541/1803298

http://stackoverflow.com/q/28190651
tagged with: javascript
has answer: http://stackoverflow.com/a/28190713
has comment: http://stackoverflow.com/comment/44748959
has comment: http://stackoverflow.com/comment/44748953
has comment: http://stackoverflow.com/comment/44749022
possible better answer: http://stackoverflow.com/a/28196422
has title: '$' symbol in typescript class
has answer: http://stackoverflow.com/a/28196422
has body: Why the '$' symbol is not recognized in typescript, since it is a super set of javascript? When I type for example $('#example') I have this error Cannot find name '$' but in the javascript file everything is ok and it works. Otherwise I'd like to know whether the function document.getElementById("something") has the same meaning, so I can replace easly the '$' symbol.
accepted answer: http://stackoverflow.com/a/28190713
type: Question
tagged with: typescript
type: AnsweredQuestion
score: 0
answer count: 2

http://stackoverflow.com/comment/44979851
has text: And you want the output to be with spaces? I changed it - see above. If you want the output to be with commas or something else, just change what's between the quotes in $ymail = implode(" ",$exploded_emails);
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28276340

http://stackoverflow.com/q/28167215
has title: SQL Update Column on new Datarow
type: Question
has comment: http://stackoverflow.com/comment/44747420
accepted answer: http://stackoverflow.com/a/28210643
tagged with: php
has comment: http://stackoverflow.com/comment/44747344
score: 0
tagged with: mysql
answer count: 1
has comment: http://stackoverflow.com/comment/44785456
tagged with: procedures
tagged with: javascript
has body: I've a MySQL server and I'm running a WebShop on it. Is it possible to calculate the sum of all articles on an order. Now when I add a new row I have to call a method in my PHP Script to calculate the sum. Is this possible to automate in MySQL (ex. Procedures)? With Best Regards Kevin Horvat
has answer: http://stackoverflow.com/a/28210643
has comment: http://stackoverflow.com/comment/44785505
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44704627

http://stackoverflow.com/comment/44771534
has text: I can't use find() because it is not restricted to an element. I did try `$iframe.find('*').hover(function () {...` and it changes the border for the element but also the parents with I don't want.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28182389

http://stackoverflow.com/a/28155002
has comment: http://stackoverflow.com/comment/44681286
score: 0
answers question: http://stackoverflow.com/q/28154732
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28154732
has comment: http://stackoverflow.com/comment/44681326
has body: Have you tried to add some css property which is useful for you? however, let me tell you. you should use position and top property for the box which is going out of thr body. here is that code: &lt;div id="firstBox" style=" position: relative; top: -800;"&gt;&lt;/div&gt; or in your #firstdiv of css stylesheet add these two: position: relative; top: -800;
type: Answer
has comment: http://stackoverflow.com/comment/44681452

http://stackoverflow.com/q/28250094
answer count: 2
tagged with: textarea
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28250999
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44859883
has comment: http://stackoverflow.com/comment/44859913
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44860927
has body: I wanna know how do you send the content of the textarea into a new window by using the Window open() method. heres is my little code: HTML Open in New window Javascript function myFunction() { window.open("insert the new window path here"); }
linked to: http://stackoverflow.com/q/9399354
score: 1
has comment: http://stackoverflow.com/comment/44860104
upvote count: 1
has comment: http://stackoverflow.com/comment/44860261
type: Question
has title: How to send the content of a textarea into a new window
has comment: http://stackoverflow.com/comment/44860167
has answer: http://stackoverflow.com/a/28250291
tagged with: javascript
has comment: http://stackoverflow.com/comment/44860787

http://stackoverflow.com/q/28162119
has answer: http://stackoverflow.com/a/28175637
tagged with: cordova
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: ionic-framework
type: Question
has title: How to store connection strings for Ionic/Cordova app?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44697928
accepted answer: http://stackoverflow.com/a/28175637
has comment: http://stackoverflow.com/comment/44716614
has body: I maintain a set of connection strings (local, dev, stg, prod) and prefer to keep this in a single spot to change only once. During development and testing I have these in a JSON file and use $.getJSON to grab the relevant connection string. var serviceBase; $.getJSON("../config.json", function (data) { serviceBase = data['serviceBase']; }); This worked fine when testing on local machine but on an emulator or on device I receive an error that it cannot find the file; I presume this is a limitation on jQuery's getJSON not being able to access the iOS file system. Temporarily I have the connection strings hard coded into my javascript; but how can I store connection strings in my Ionic/Cordova app in a safe manner?
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28171702
answer count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/2646514
has comment: http://stackoverflow.com/comment/44712586
has title: javascript why is (true)^2 = 3, (true)^3=2
has body: In node I happened to use a power operator on a boolean and got some funny results. I guess the '^' operator is implemented as something other than 'power'. Initially I wrote !!a^3 and got 2. Is it a shift operator or some binary operation?
type: Question
has comment: http://stackoverflow.com/comment/44712679
linked to: http://stackoverflow.com/q/2646514
tagged with: javascript
has comment: http://stackoverflow.com/comment/44712594
score: 0
has comment: http://stackoverflow.com/comment/44713086
tagged with: binary
has comment: http://stackoverflow.com/comment/44712648
has comment: http://stackoverflow.com/comment/44713628

http://stackoverflow.com/comment/44893518
comment on: http://stackoverflow.com/a/28268317
score: 0
has text: Thanks for this well explained answer. So you mean to load the player even if the id is wrong and then hide it?
type: AnswerComment
type: Comment

http://stackoverflow.com/a/42042630
answers question: http://stackoverflow.com/q/28253435
has body: This can be solved by using the scan function. In the accumulated value the commands are stored for which no data response has been received yet. var result = Rx.Observable .merge(data, command) .scan(function (acc, x) { if (x === 'd') { acc.result = acc.commands.length &gt; 0 ? acc.commands.shift() : 'dc'; } else { acc.result = ''; acc.commands.push(x); } return acc; }, {result: '', commands: []}) .map(function (x) { return x.result; }) .filter(function (x) { return x !== ''; }); Please find a complete more detail here: http://jsbin.com/tubade/edit?html,js,console
score: 0
type: Answer

http://stackoverflow.com/q/28271847
has comment: http://stackoverflow.com/comment/44899060
has title: resize window in jquery
score: 0
has answer: http://stackoverflow.com/a/28272913
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44899031
has body: I have a tooltip that might be appear in 2 position : top &amp; bottom i want do this with jquery resize. when user resize his browser in with less than 768px , my tooltip appear on the top position and when greater than 768px appear on bottom position but resize() wont work!! $(window).ready(function () { if ($(window).width() &gt;= 768) { $(document).ready(function () { $(".green-tooltip").tooltip({placement: 'bottom'}); }); } else if ($(window).width() &lt;= 767) { $(document).ready(function () { $(".green-tooltip").tooltip({placement: 'top'}); }); } $(window).resize(function () { var wi = $(window).width(); if (wi &gt;= 768) { $(document).ready(function () { $(".green-tooltip").tooltip({placement: 'bottom'}); }); } else if (wi &lt;= 767) { $(document).ready(function () { $(".green-tooltip").tooltip({placement: 'top'}); }); } }); });
has comment: http://stackoverflow.com/comment/44899547
has comment: http://stackoverflow.com/comment/44899569
type: Question
has comment: http://stackoverflow.com/comment/44901331
has comment: http://stackoverflow.com/comment/44899026
tagged with: javascript
tagged with: resize
tagged with: jquery

http://stackoverflow.com/q/28176225
upvote count: 0
has answer: http://stackoverflow.com/a/28179832
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28179832
tagged with: mysql
type: Question
tagged with: javascript
score: -1
tagged with: date
answer count: 1
downvote count: 1
favorite count: 0
tagged with: date-format
has body: Hello and sorry my bad english :-) i have a little problem with my json data. I have a mysql database. in this database i have safed data in a date format. But the date format is in this format: YYYY.MM.DD. I need the Format DD.MM.YYYY. Well, i changed the request in this way: $rs = mysql_query("SELECT event_name, DATE_FORMAT(beginn,'%d.%m.%Y'), DATE_FORMAT(ende,'%d.%m.%Y') FROM party WHERE ende &gt;= CURDATE()ORDER BY beginn ASC"); Now i get this string with the right date-format {"sommer":[{"event_name":"testevent","DATE_FORMAT (beginn, '%d.%m.%Y')":"28.01.2015","DATE_FORMAT (ende, '%d.%m.%Y')":"30.01.2015"}]} But now i have the problem, with my javascript. Before i did this with: DATE_Format (beginn,'%d.%m.%Y'), i got the date (but not in the right format). Now i got nothing. here my javascript: var url="party.php"; var activitydetail = sessionStorage.activitydetail; $.getJSON(url,function(json){ $.each(json.sommer,function(i,item){ $('&lt;li&gt;&lt;a href="#'+item.event_name+'"&gt; '+item.DATE_FORMAT (beginn, '%d.%m.%Y')+' - '+item.event_name+'&lt;/a&gt;&lt;/li&gt;').appendTo('#accor2'); }); }); The function doesn't work any more with '+item.beginn+' and doesn't work with '+item.DATE_FORMAT(beginn, '%d.%m.%Y')+' Anybody knows a solution? A big thanks in advance :-)
has title: JSON-Data Date_Format doesnt show
type: AnsweredQuestion

http://stackoverflow.com/a/42767905
score: 4
answers question: http://stackoverflow.com/q/28135485
downvote count: 1
upvote count: 5
type: Answer
has body: Performance test const vs let usage on require for Node.js 6.10: require('do-you-even-bench')([ { name: 'test 1', fn: function() { const path = require('path'); } }, { name: 'test 2', fn: function() { let path = require('path'); } } ]); test 1 .... 2,547,746.72 op/s test 2 .... 2,570,044.33 op/s

http://stackoverflow.com/a/28161468
has comment: http://stackoverflow.com/comment/44736537
has comment: http://stackoverflow.com/comment/52885342
answers question: http://stackoverflow.com/q/28147486
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/52840951
has comment: http://stackoverflow.com/comment/44747211
accepted answer of: http://stackoverflow.com/q/28147486
has body: As of right now you have to use a work around to work with multiple files. The multiple attribute only works in IFRAME mode, but file inputs are broken in IFRAME mode. To see this workaround take a look at the bug submission for this issue: https://code.google.com/p/google-apps-script-issues/issues/detail?id=4610 Also in your code you have some mixing of server side and client side code that will not work: var folder = DriveApp.getFolderById(dropBoxId); //server side var input = document.getElementById('myFiles'); //client side You will need to do your multiple file processing on the client side I came up with a nice solution for multi-file uploading. Limitations are files must be under 10 MB. CODE.GS function doGet() { return HtmlService.createHtmlOutputFromFile('index').setSandboxMode(HtmlService.SandboxMode.IFRAME); } function saveFile(data,name,folderId) { var contentType = data.substring(5,data.indexOf(';')); var file = Utilities.newBlob(Utilities.base64Decode(data.substr(data.indexOf('base64,')+7)), contentType, name); DriveApp.getFolderById(folderId).createFile(file); } index.html &lt;div&gt; &lt;input type="file" id="myFiles" name="myFiles" multiple/&gt; &lt;input type="button" value="Submit" onclick="SaveFiles()" /&gt; &lt;/div&gt; &lt;script&gt; var reader = new FileReader(); var files; var fileCounter = 0; var folderId = ""; reader.onloadend = function () { google.script.run .withSuccessHandler(function(){ fileCounter++; postNextFile(); }).saveFile(reader.result,files[fileCounter].name,folderId); } function SaveFiles(){ var folderSelect = document.getElementById("folderSelectId"); folderId = folderSelect.options[e.selectedIndex].value; files = document.getElementById("myFiles").files; postNextFile(); } function postNextFile(){if(fileCounter &lt; files.length){reader.readAsDataURL(files[fileCounter]);}else{fileCounter=0;alert("upload done")}} &lt;/script&gt;
has comment: http://stackoverflow.com/comment/44721601
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28183225
answers question: http://stackoverflow.com/q/28182755
downvote count: 1
has body: Check this example. It works for you. enter link description here Remove class and add new class
upvote count: 0
type: Answer
score: -1

http://stackoverflow.com/comment/45713807
has text: updates in original question.
type: Comment
comment on: http://stackoverflow.com/q/28183444
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44785537
score: 0
has text: In this case you should add your own answer with the code and explanation of how you solved it, and then accept it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28137908

http://stackoverflow.com/a/28148186
has body: Could you wrap them both in a div? .container:hover .hov { background-color: #cde0c4; cursor: pointer; } NUMBER 1 NUMBER 2
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/28148040
type: Answer
upvote count: 4

http://stackoverflow.com/comment/44839362
type: Comment
comment on: http://stackoverflow.com/q/28224586
type: QuestionComment
has text: I'm a little fuzzy on what your question is specifically. I think you might need a different data structure than an Array to hold two different values (item id and quantity of that item). Have you considered using an object instead?
score: 0

http://stackoverflow.com/comment/44716003
has text: Ah I see, but this will not allow for the size change of the window (making the window smaller when this follower is on the move). I guess I did not state this in the question but I was using a percentage for the track.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28173417
score: 0

http://stackoverflow.com/comment/44668415
comment on: http://stackoverflow.com/q/28148336
score: 0
type: Comment
type: QuestionComment
has text: without isolated scope can still have attributes and access those values. Still lots of power under the hood of a directive to do lots of things with attributes

http://stackoverflow.com/a/33063095
has comment: http://stackoverflow.com/comment/124791428
has comment: http://stackoverflow.com/comment/54340682
has comment: http://stackoverflow.com/comment/88302617
has comment: http://stackoverflow.com/comment/64018570
has comment: http://stackoverflow.com/comment/63623618
score: 103
downvote count: 1
has comment: http://stackoverflow.com/comment/57434300
has comment: http://stackoverflow.com/comment/61737466
type: Answer
has body: I was recently looking for a nice solution to this without adding React-Bootstrap to my project (as Bootstrap 4 is about to be released). This is my solution: https://jsfiddle.net/16j1se1q/1/ let Modal = React.createClass({ componentDidMount(){ $(this.getDOMNode()).modal('show'); $(this.getDOMNode()).on('hidden.bs.modal', this.props.handleHideModal); }, render(){ return ( × Modal title One fine body… Close Save changes ) }, propTypes:{ handleHideModal: React.PropTypes.func.isRequired } }); let App = React.createClass({ getInitialState(){ return {view: {showModal: false}} }, handleHideModal(){ this.setState({view: {showModal: false}}) }, handleShowModal(){ this.setState({view: {showModal: true}}) }, render(){ return( Open Modal {this.state.view.showModal ? <Modal handleHideModal={this.handleHideModal}/> : null} ); } }); React.render( <App />, document.getElementById('container') ); The main idea is to only render the Modal component into the React DOM when it is to be shown (in the App components render function). I keep some 'view' state that indicates whether the Modal is currently shown or not. The 'componentDidMount' and 'componentWillUnmount' callbacks either hide or show the modal (once it is rendered into the React DOM) via Bootstrap javascript functions. I think this solution nicely follows the React ethos but suggestions are welcome!
upvote count: 104
answers question: http://stackoverflow.com/q/28241912
has comment: http://stackoverflow.com/comment/105685452

http://stackoverflow.com/comment/44636701
has text: @Kashif - forgot to answer your question. xmlDoc.documentElement is the <toolbox> element that is generated by my PHP
score: 0
comment on: http://stackoverflow.com/q/28126681
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44729579
comment on: http://stackoverflow.com/q/28180092
has text: If the right box is inside the form, just give it a `name` attribute and it will be sent. And in Javascript select the element by `ID` not `name`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44745189
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28188477
has text: Where exactly? I am using ng-repeat in link function (second example) but it does not work.

http://stackoverflow.com/q/28133053
favorite count: 0
has comment: http://stackoverflow.com/comment/44638913
has comment: http://stackoverflow.com/comment/44638772
score: 2
upvote count: 2
has title: how does 'window.location.href' work?
has comment: http://stackoverflow.com/comment/44638642
accepted answer: http://stackoverflow.com/a/28133093
has body: there is some code in "new.html" like $('#publish').click(function(){ window.location.href = "/index"; alert(window.location.href); return false; }) when it works with chrome debug, it display: Navigated to http://127.0.0.1/new Navigated to http://127.0.0.1/index why it can redirect to index? if i remove "return false", it doesn't work conversely...I don't understand it...please give me some pointers...thank you!
has comment: http://stackoverflow.com/comment/44638669
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44638617
type: Question
has comment: http://stackoverflow.com/comment/44638680
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28133093
has comment: http://stackoverflow.com/comment/44638640

http://stackoverflow.com/comment/44839687
type: QuestionComment
comment on: http://stackoverflow.com/q/28239157
has text: Well, I thought c is now the second element. Because it is from now on accessible with `someArr[1]`
score: 0
type: Comment

http://stackoverflow.com/q/28223008
tagged with: javascript
has comment: http://stackoverflow.com/comment/44809115
has comment: http://stackoverflow.com/comment/44808978
answer count: 1
duplicate of: http://stackoverflow.com/q/1695376
favorite count: 0
has comment: http://stackoverflow.com/comment/44809127
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6927637
has comment: http://stackoverflow.com/comment/44809048
upvote count: 0
has title: Make JavaScript specific code work in IE7
linked to: http://stackoverflow.com/q/1695376
downvote count: 2
has body: This code works in modern browsers - but is not working in the IE7. Can someone help me where the problem lies: function makePay() { var obj = { 'product' : 'speakers', 'paid' : 300, 'toBePaid' : 560, 'paymentsLeft' : 3, } return (obj.toBePaid - obj.paid) / obj.paymentsLeft; } var btn = document.getElementById("result"); btn.addEventListener("click", function(){ alert(makePay()); }, false);
has comment: http://stackoverflow.com/comment/44809152
type: Question
has comment: http://stackoverflow.com/comment/44809032
has answer: http://stackoverflow.com/a/28223070
tagged with: function
score: -2

http://stackoverflow.com/comment/44856318
score: 0
comment on: http://stackoverflow.com/q/28247734
type: QuestionComment
type: Comment
has text: @AndroidBeginner your code pasted shows you are loading only one controller but referrring to 2 different in your route, i.e `ChatRoomsCtrl` and `ChatRoomCtrl` so if you load the one with the controller that is not registered you will see that error and btw what exactly is the complete error message say, which controller is missing?

http://stackoverflow.com/comment/44628248
has text: This is the correct answer. Chrome seems to have a similar problem. Evaluating `019` with Spidermonkey yields `1: warning: 09 is not a legal ECMA-262 octal constant: 019`. It seems like it was backed out because existing (important) sites would break.
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/28127633

http://stackoverflow.com/comment/44875309
comment on: http://stackoverflow.com/q/28258579
has text: GruntJS and GulpJS are popular tools for building front end resources. Is it a requirement to use ant or bat?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28157312
has title: function not responding to button click
has comment: http://stackoverflow.com/comment/44686538
tagged with: google-api
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44688150
linked to: http://stackoverflow.com/q/27862865
type: Question
has comment: http://stackoverflow.com/comment/44685934
has answer: http://stackoverflow.com/a/28158912
tagged with: javascript
has comment: http://stackoverflow.com/comment/44686167
has comment: http://stackoverflow.com/comment/44685864
score: 0
has comment: http://stackoverflow.com/comment/44685784
answer count: 1
tagged with: jquery
has body: I am trying to load the following function upon button click: Upload However its not responding and no errors is displayed on console. Any help would be greatly appreciated. I am not sure if its how its being called, but no error whatsover is displayed on console, so i am not exactly sure where the issue lies. The button is found in the body, and the script inside the header. Update: Below is the entire code: Upload

http://stackoverflow.com/q/28192958
accepted answer: http://stackoverflow.com/a/28193351
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28193251
has comment: http://stackoverflow.com/comment/44753304
upvote count: 3
has answer: http://stackoverflow.com/a/28193251
downvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/44752956
has answer: http://stackoverflow.com/a/28193351
tagged with: javascript
has comment: http://stackoverflow.com/comment/44753099
has comment: http://stackoverflow.com/comment/44752911
has answer: http://stackoverflow.com/a/28193147
score: 0
answer count: 3
tagged with: jquery
has title: Cannot read property 'match' of undefined
has body: I'm running the following: var token = document.location.href.split('?s=')[1].match(/[a-z0-9]+/); var longString = "?s=" + token + "?_sft_category="; var tokenB = document.location.href.split(longString)[1].match(/[a-z0-9]+/); var attribuB = "." + tokenB; jQuery('a[data-filter-value="' + attribuB + '"]').parent().parent().parent().find(".dropdown-toggle").html(tokenB).append(' &lt;span class="caret"&gt;&lt;/span&gt;'); How come I get? Uncaught TypeError: Cannot read property 'match' of undefined If I remove .match(/[a-z0-9]+/) i don't get any error, but I do need match .. The URL looks like: http://www.example.com/xchanges/results/?s=sky&amp;_sft_category=ogilvy
favorite count: 0
has comment: http://stackoverflow.com/comment/44753432

http://stackoverflow.com/a/28209073
answers question: http://stackoverflow.com/q/28209026
score: 0
has body: You missed \ in your iframe element to mask the " function add_new_frame(){ $("&lt;iframe class=\"a\" id=\"a\" name=\"a\"/&gt;").appendTo(id); var editor = document.getElementById ("a"); editorDoc = editor.contentWindow.document; editorDoc1 = document.getElementById ("a").contentDocument; var editorBody = editorDoc.body; if ('spellcheck' in editorBody) { // Firefox editorBody.spellcheck = false; } if ('contentEditable' in editorBody) { // allow contentEditable editorBody.contentEditable = true; editorDoc1.designMode = "on"; } else { if ('designMode' in editorDoc1) { editorDoc1.designMode = "on"; } } }
has comment: http://stackoverflow.com/comment/44783611
has comment: http://stackoverflow.com/comment/44783140
has comment: http://stackoverflow.com/comment/44783315
type: Answer

http://stackoverflow.com/q/28197170
has comment: http://stackoverflow.com/comment/44760948
has comment: http://stackoverflow.com/comment/44760942
type: Question
has comment: http://stackoverflow.com/comment/44760821
tagged with: javascript
has answer: http://stackoverflow.com/a/28197251
has comment: http://stackoverflow.com/comment/44760878
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28197252
tagged with: jquery
type: UnansweredQuestion
tagged with: regex
has title: jquery get value in brackets using regex
has body: This has probably been asked a million times, and i am probably way off in what i have below, but i can not find it anywhere on SO. I need to get my alert below to show the value inside the brackets. //the element(thisId) holds the following string: id[33] var thisId = $(this).attr('id'); var idNum = new RegExp("\[(.*?)\]"); alert(idNum); I need the alert to show the value 33.

http://stackoverflow.com/q/28139230
score: 0
tagged with: css
tagged with: ruby-on-rails
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28139295
accepted answer: http://stackoverflow.com/a/28139295
has body: So in my rails app, I am trying to have it so that when when a user clicks a link in a menu, that link becomes underlined to indicate it is the current page. I have the basic set up down with javascript and css but I am having trouble getting the addClass() and removeClass() functions working. Right now, the active link underlines fine, however when the other link is clicked, the active class doesn't transfer (although the link seems to flicker). Any help would be much appreciated! The Menu HTML &lt;div id="collective_tabs"&gt; &lt;ul&gt; &lt;li&gt; &lt;%= link_to 'Projects', collective_projects_path(@collective) %&gt; &lt;/li&gt; &lt;li&gt; &lt;%= link_to 'Members', collective_members_path(@collective) class: 'active' %&gt; &lt;/li&gt; &lt;ul&gt; &lt;/div&gt; CSS .active { border-bottom: 1px solid; } application.js //= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require chosen-jquery //= require messages //= require bootstrap //= require turbolinks //= require_tree . $(document).ready(function() { $('#collective_tabs li a').on('click', function(){ $('li a.active').removeClass('active'); $(this).addClass('active'); }); });
tagged with: navigation
type: Question
answer count: 1
has title: Adding and Removing Classes on click with Javascript
tagged with: javascript

http://stackoverflow.com/comment/44960097
type: AnswerComment
comment on: http://stackoverflow.com/a/28233928
type: Comment
has text: How can we bower install the unstable version?
score: 0

http://stackoverflow.com/q/28257452
type: Question
tagged with: iphone
downvote count: 0
tagged with: url
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
type: UnansweredQuestion
has body: I am having problem playing videos on iphone/ipad. I have multiple videos on a single page called "VideoPlayer.html" with the following script. Then i got a page called "Main.html" where i am linking these videos from Videoplayer.html with the following code. Play Movie Scene Selection Special Features It all works fine on desktop when I click the "Play Movie" the url opens up with VideoPlayer.html?V=MainMovie and plays the video in a new window. which is exactly what i want but i need this code to work on iphone/ipad as well. I am really new to JavaScript and HTML. All these videos and HTML files will be used offline. Thanks
upvote count: 1
tagged with: parameters
score: 1
has title: Javascript url parameters with html5 video tag not working on iphone/ipad via wifi thumb drive

http://stackoverflow.com/q/28168259
possible better answer: http://stackoverflow.com/a/28168811
has answer: http://stackoverflow.com/a/28168811
has answer: http://stackoverflow.com/a/28168397
tagged with: javascript
tagged with: inheritance
favorite count: 0
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28168434
has body: I working out the inheritance and OOPS in JavaScript. I created 'A' object and 'B' object and inherited all the properties of 'B' to 'A'. While I check the newly created object instance by using 'instanceof', I am getting both objects are true. But I have created the object using 'B' constructor only. function A(){ this.a = "test1", this.b = "test2" } function B(){ this.c = "test3", this.d = "test4" } B.prototype = new A(); var userObj = new B(); console.log(userObj instanceof B); // true console.log(userObj instanceof A); // true, How this can be true?
type: AnsweredQuestion
has title: OOP inheritance and objects instaces
accepted answer: http://stackoverflow.com/a/28168397
upvote count: 1
downvote count: 1
type: Question
tagged with: oop

http://stackoverflow.com/q/28243359
tagged with: javascript
has answer: http://stackoverflow.com/a/28245459
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28245459
has title: angular ui-grid grid height/rows visible
type: AnsweredQuestion
tagged with: angular-ui-grid
score: 1
upvote count: 1
type: Question
has body: I am using angular ui-grid. I would like to set the height of the grid's contents or the number of rows visible. Ideally, I would like this to set dynamically based on the window size, but, will settle for hard-coding it for now. All of the grids in the ui-grid tutorial appear to have the same height/columns visible so I'm not sure this is possible through UI-grids API.

http://stackoverflow.com/q/28239277
tagged with: popup
upvote count: 2
has answer: http://stackoverflow.com/a/29277279
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36594547
answer count: 3
downvote count: 0
tagged with: javascript
has title: How to make responsive popup div?
favorite count: 0
tagged with: css
has body: Basically my website is Responsive but below is the code for my popup div div is working good on desktop but on mobile portrait it just goes out of the screen, I need to make this div responsive also. additionally i want this div to appear on screen with fadein or other animation which is i dont know how to use now. plz help HTML is here: HTML Tutorials More HTML Tutorials HTML You are currently viewing HTML Box. Click here to close popup box one. CSS Here: #popupBoxOnePosition, #popupBoxHTML{ margin:10px 0 0 0; top: 0; left: 0; position: fixed; width: 100%; height: 100%; background:#333; display: none; opacity:.95; z-index:100; widows:50%; } .popupBoxWrapper{ width: 550px; margin: 50px auto; text-align: left; } .popupBoxContent{ background-color: #000; padding: 15px; opacity:1; border-radius:15px; -o-box-shadow:0 0 50px ##219ab3; -moz-box-shadow:0 0 50px ##219ab3; -webkit-box-shadow:0 0 50px ##219ab3; -ms-box-shadow:0 0 50px ##219ab3; transition:ease-in; transition-delay:1s; -webkit-transition:ease-in; } javascript here: function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; }
possible better answer: http://stackoverflow.com/a/36594547
score: 2
has answer: http://stackoverflow.com/a/28240522
accepted answer: http://stackoverflow.com/a/28240522

http://stackoverflow.com/q/28160361
tagged with: node-modules
has comment: http://stackoverflow.com/comment/44693438
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44692362
has comment: http://stackoverflow.com/comment/44692243
score: 0
has comment: http://stackoverflow.com/comment/44692188
has title: Accessing Node Modules
has comment: http://stackoverflow.com/comment/44692250
has comment: http://stackoverflow.com/comment/44692261
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44692434
tagged with: yeoman
tagged with: node.js
has comment: http://stackoverflow.com/comment/44692268
has comment: http://stackoverflow.com/comment/44692385
has comment: http://stackoverflow.com/comment/44692323
has body: I have an app that I scaffolded out using Yeoman (yeoman.io w/ generator-webapp). I need to use the mailchimp api so I installed the official api client (npm install mailchimp-api). The mailchimp-api folder is now in the node_modules directory of my app. My problem is that I have no idea how to interact with it from my generator-webapp application. Do I need to import the module some how into my main.js file in order to access its functionality? If so how? Im new to Node but I have a lot of experience with JS, so I apologize if this question seems super obvious or basic. Update: I added these lines to my grunt.js file: var mcapi = require('mailchimp-api'); var mc = new mcapi.Mailchimp('xxx'); However, I am still unclear on how to interact with mc from the client side.
answer count: 0
has comment: http://stackoverflow.com/comment/44692531
has comment: http://stackoverflow.com/comment/44693304

http://stackoverflow.com/a/28534706
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28141723
has body: FYI for anyone who is viewing this, it was the microsoft hosted site routes that were broken. A few days later the routes were fixed and the problem was resolved. I think this is an antipattern of the future for js. Download and host your own dependencies or suffer from others.... Here is the reddit post I had opened of the same with the results days later: http://www.reddit.com/r/javascript/comments/2tn8z7/all_javascript_from_httpajaxaspnetcdncomajax/

http://stackoverflow.com/comment/44847971
has text: @Mike -- Certain Angular directives expect an Angular expression and some don't. Best to check the docs first, eventually you'll just memorize them :D
type: AnswerComment
comment on: http://stackoverflow.com/a/28243413
score: 0
type: Comment

http://stackoverflow.com/comment/44654847
score: 0
type: Comment
has text: Note that I'm talking about major script here right? Are you saying that jquery-1.9.3 can have a different buildnumber than another version of 1.9.3? I've never heard of any major scripts that version that way. I think they always change the revision at least. Oh and I know the mechanism is in place, but why send it if it does not need to be sent?
comment on: http://stackoverflow.com/a/28141583
type: AnswerComment

http://stackoverflow.com/a/28218285
score: 0
answers question: http://stackoverflow.com/q/28212727
has comment: http://stackoverflow.com/comment/44801703
has body: I'm not quite sure I understand what you're trying to do but if you think this does not answer your needs, please explain what you're trying to achieve functionnaly speaking so we can help. Anyway, if you plan to have the possibility to retrieve the information from children properties (like Pushpin > PushpinOption > Infobox), you will have several possibilities to achieve it but one possible would be to take benefit of the possibility of extension that came with Bing Maps Ajax V7 Control, here is an example that will illustrate how to keep concrete additional properties on the Pushpin object. Sample code See the sample code that will illustrate the extension capability usage, here: Bing Maps for Enterprise - Extension More information If you need any more information about the extension capabilities, see my post blog (in French) available here: http://blogs.developpeur.org/nicoboo/archive/2012/03/23/bing-maps-for-enterprise-profitez-des-possibilites-d-extension-du-controle-ajax-v7.aspx
type: Answer
has comment: http://stackoverflow.com/comment/44801646
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28212727

http://stackoverflow.com/comment/44777086
score: 0
type: Comment
type: AnswerComment
has text: @Kyle It seems you may also have spaces before your `<?php` tag, so you may be outputting before header. If spaces are present, remove them.
comment on: http://stackoverflow.com/a/28205683

http://stackoverflow.com/q/28143460
favorite count: 0
duplicate of: http://stackoverflow.com/q/22844840
tagged with: exponential
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/4126206
score: 3
has comment: http://stackoverflow.com/comment/44659035
tagged with: floating-point
has comment: http://stackoverflow.com/comment/44658607
has comment: http://stackoverflow.com/comment/44658582
type: Question
upvote count: 4
has body: So I want to give JS a number in exponential notation. Amazingly, I haven't found a reference on how to do this. Why doesn't this work? var tempdec = 8.85956e-8; I don't have to do var tempdec = parseFloat('8.95956e-8'); ...do I? ... answered below. The upshot: It does work. However, using var in the console returns undefined. But it works nonetheless.
linked to: http://stackoverflow.com/q/22844840
has title: How do I define a float in Javascript?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44658613
has comment: http://stackoverflow.com/comment/44659005
linked to: http://stackoverflow.com/q/14633968
answer count: 1
has comment: http://stackoverflow.com/comment/44658579
has answer: http://stackoverflow.com/a/28143491

http://stackoverflow.com/a/28122880
has body: change your html a bit then use the below css:use placeholder instead of data-placeholder i.e. without data attribute. input,div { border: 1px black solid; margin-top: 20px; } [contenteditable=true]:empty:before { content: attr(placeholder); } &lt;input placeholder="test"/&gt; &lt;div contenteditable='true' placeholder="test"&gt;&lt;/div&gt;
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28122665
type: Answer
answers question: http://stackoverflow.com/q/28122665
score: 2
downvote count: 0

http://stackoverflow.com/comment/44878419
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28259903
type: Comment
has text: jfriend00, I've just clicked the green checkmark next to your very useful answer, and I've also clicked on the upper triangle next to your answer. I have also just executed my file (by adhering to your advice that jQuery library link and the actual JavaScript should ideally be placed just before the closing body tag) on XAMPP, and it works!!! Thanks again so much.

http://stackoverflow.com/comment/44781873
score: 0
has text: The danger in using apply is you can't verify angular is not in a digest cycle when using it, unless you use $$phase, which is not supposed to be used as it's a 'private' property. Mishko has offered the $timeout as the best-practice way of doing a safe apply.
type: Comment
comment on: http://stackoverflow.com/a/28208120
type: AnswerComment

http://stackoverflow.com/comment/44757633
has text: I think you're essentially [asking for this](http://sosweetcreative.com/2613/font-face-and-base64-data-uri)?
comment on: http://stackoverflow.com/q/28195447
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/44774560
type: AnswerComment
comment on: http://stackoverflow.com/a/28204125
score: 0
type: Comment
has text: say I have parent1, parent2 and parent3 directives that use the child directive, how can I make the child independent from who's invoking the method? I cannot require from the child all the parents.

http://stackoverflow.com/a/28143867
answers question: http://stackoverflow.com/q/28143794
score: 0
accepted answer of: http://stackoverflow.com/q/28143794
type: Answer
has comment: http://stackoverflow.com/comment/44660835
has comment: http://stackoverflow.com/comment/44660799
has comment: http://stackoverflow.com/comment/44660749
has comment: http://stackoverflow.com/comment/44660710
has body: When using this. you are assigning public properties of the current object. "this" will point to the object you are intanciating when using the "new" keyword. When using "var" they like private variables of your instance.
type: AcceptedAnswer

http://stackoverflow.com/q/28131409
accepted answer: http://stackoverflow.com/a/28131432
has comment: http://stackoverflow.com/comment/44635633
has title: Adding elements on loop jQuery
score: 0
has body: I am trying to generate a row of 16 boxes on load of webpage. Here is my code: var box = $("&lt;div&gt;&lt;/div&gt;").addClass("box"); $(document).ready(function(){ for(var i = 0; i &lt; 16; i++) { $("#container").append(box); } }); I also tried this within the for loop's code block: if($("#container:contains(box)")) { $(box).append(box); } I kind of understand why this does not work. That var box is only referencing an element and is not a copy of an element? As you can likely tell, I'm new. I would really appreciate some pointers on how I can achieve this. Thanks.
type: AnsweredQuestion
tagged with: loops
type: Question
has answer: http://stackoverflow.com/a/28131478
possible better answer: http://stackoverflow.com/a/28131421
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28131421
has answer: http://stackoverflow.com/a/28131432
answer count: 3

http://stackoverflow.com/comment/44817747
score: 0
type: AnswerComment
has text: I think this is a limitation of the request module since it HAS to be asynchronous. I think I'll refactor my code to utilize multiple concurrent processes on a stored array so I can utilize multi-core performance but still be able to easily destroy processes as I go so nothing is left hanging.
type: Comment
comment on: http://stackoverflow.com/a/28221752

http://stackoverflow.com/a/28198115
answers question: http://stackoverflow.com/q/28197729
type: Answer
has comment: http://stackoverflow.com/comment/44860512
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44776221
type: AcceptedAnswer
downvote count: 0
has body: There are lot of syntax mistakes: Updated plunker http://plnkr.co/edit/vgM5PLyVgluOeikGvVSA?p=preview Changes made in JS:- angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log) { $scope.items = ['item1', 'item2', 'item3']; $scope.open = function (size) { var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: 'ModalInstanceCtrl', size: size, resolve: { items: function () { return $scope.items; } } }); modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { $log.info('Modal dismissed at: ' + new Date()); }); }; }); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl2', function ($scope, $modal, $log) { $scope.items2 = ['item12', 'item22', 'item32']; $scope.open = function (size) { var modalInstance2 = $modal.open({ templateUrl: 'myModalContent2.html', controller: 'ModalInstanceCtrl2', size: size, resolve: { items2: function () { return $scope.items2; } } }); modalInstance2.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { $log.info('Modal dismissed at: ' + new Date()); }); }; }); // Please note that $modalInstance represents a modal window (instance) dependency. // It is not the same as the $modal service used above. angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function ($scope, $modalInstance, items) { $scope.items = items; $scope.selected = { item: $scope.items[0] }; $scope.ok = function () { $modalInstance.close($scope.selected.item); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }); angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl2', function ($scope, $modalInstance, items2) { $scope.items2 = items2; $scope.selected = { item: $scope.items2[0] }; $scope.ok = function () { $modalInstance.close($scope.selected.item2); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; });
accepted answer of: http://stackoverflow.com/q/28197729

http://stackoverflow.com/q/28209311
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
has title: AngularJS application with EJB only
favorite count: 0
tagged with: rest
tagged with: angularjs
tagged with: model-view-controller
has body: Is it possible to build AngularJS application with only EJB directly without having to expose them as REST services? What I have seen on examples on the web is that in the end you have to use REST services to supply data to AngularJS. Hence you would have to expose your EJB methods as RESTful services to be able to make them work with AngularJS. Is there a way without doing this? Please suggest and provide some help resources if any. We are using EJB 3.1 and IBM WAS 8.5.
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: ejb-3.1
has answer: http://stackoverflow.com/a/28213541

substr
tags question: http://stackoverflow.com/q/28122750
tags question: http://stackoverflow.com/q/28225522
type: Tag
tag name: substr

http://stackoverflow.com/q/28165606
tagged with: jquery
linked to: http://stackoverflow.com/q/53856593
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/28165677
has answer: http://stackoverflow.com/a/28165797
has comment: http://stackoverflow.com/comment/44703206
has title: setInterval function increments values twice on restarting setinterval
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44701694
has comment: http://stackoverflow.com/comment/44701599
has comment: http://stackoverflow.com/comment/44701965
has comment: http://stackoverflow.com/comment/44701564
has answer: http://stackoverflow.com/a/28165677
type: Question
has body: There is a code that I am trying to run which creates a popup. Once the popup opens, a counter is initialized which increments every second and uses setInterval. However when I cancel the process(clearInterval along with it) and reopen the popup, the counter initializes but increments twice every second. You can find my jquery script below for refernece. Please let me know why am I observing this strange behaviour. Please forgive the the dirty code and if my jquery practices are wrong and feel free to point it out. I am considerably new to front-end development and hence it might be a trivial issue, but I can't seem to find any reasons online. Looking forward to any inputs. // Semicolon (;) to ensure closing of earlier scripting // Encapsulation // $ is assigned to jQuery ; (function($) { var counter2 = 0; var counter3 = 60; var counter4 = 60; var interval2; var timeNow; var canFlag = 0; // DOM Ready $(function() { var checker = ''; var popClicked = 0; var timeout = 0; // Binding a click event // From jQuery v.1.7.0 use .on() instead of .bind() $('#my-button').bind('click', function(e) { checker = $('#log').text(); popClicked = 1; if (checker==="somecondition") { //alert(checker); // Prevents the default action to be triggered. e.preventDefault(); // Triggering bPopup when click event is fired $('.element_to_pop_up').bPopup(); } else { alert('Oops.. error message'); } }); $('#popNext').click(function() { currTopic = randTopic(); $('#newTopic').html(currTopic); $('#pg1pop').hide(); $('#pg2pop').show(); var counter = 10; var counterFlag = 0; $('#pg2Ref').click(function() { currTopic = randTopic(); $('#newTopic').html(currTopic); counter = 10; }); $('.b-modal, .b-close').click(function() { canProcess(); $('#pg2pop').hide(); $('#timeout').hide(); $('#pg1pop').show(); }); $('#pg2Cont').click(function() { counter2 = 0; counter3 = 60; counter4 = 60; counterFlag = 1; $('#pg2pop').hide(); $('#pg3pop').show(); //alert("counter 1-4: "+counter+"-"+counter2+"-"+counter3+"-"+coun…
has comment: http://stackoverflow.com/comment/123509067
score: -2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28165797
answer count: 2
downvote count: 4
tagged with: setinterval

http://stackoverflow.com/q/28148463
favorite count: 0
has answer: http://stackoverflow.com/a/28160277
tagged with: contenteditable
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I've seen a lot of code snippets detailing how to get and set the caret position within a contenteditable div but I cannot get it to work in my case: I am using a WYSIWYG text editor (textAngular). I have included functionality for the user to insert a cross-reference at the cursor position. They click a button, which opens up a dialog box for them to make selections from, which in turn will insert a html node at the current cursor position. The location of the cursor may be within child nodes within the div such as p tags and/or other formatting tags. My issue is that the current cursor position is lost when the dialog gains focus. I have tried storing the caret position (node and offset) in memory before opening the dialog but whatever I try the caret position always returns to the start of the div. I've tried all the code snippets I can find on stackoverflow but none of them work. I assume I am missing something.
linked to: http://stackoverflow.com/q/4576694
score: 2
has answer: http://stackoverflow.com/a/46217284
upvote count: 3
has comment: http://stackoverflow.com/comment/44670661
tagged with: cursor
downvote count: 1
type: Question
tagged with: cursor-position
tagged with: javascript
has title: Recording and restoring the position of the caret within a contenteditable div using textangular
answer count: 2

http://stackoverflow.com/a/28231441
has comment: http://stackoverflow.com/comment/44841257
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44904664
type: Answer
has comment: http://stackoverflow.com/comment/44843595
has body: displayKey either expects the fieldname of the suggestion object to be displayed, or a function converts the suggestion object into a string. $('#typeahead').typeahead(null, { displayKey: function(suggestion){ return suggestion.name + " " + suggestion.email; }, source: bloodhound.ttAdapter() });
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28229691
accepted answer of: http://stackoverflow.com/q/28229691

filereader
tags question: http://stackoverflow.com/q/28233715
tag name: filereader
tags question: http://stackoverflow.com/q/28143421
tags question: http://stackoverflow.com/q/28228560
type: Tag
tags question: http://stackoverflow.com/q/28180547

http://stackoverflow.com/q/28196910
tagged with: javascript
score: 4
upvote count: 4
has title: Improving performance with Three.js
has body: I am currently writing my first Three.js / WebGL application and it runs very well on my PC (Chrome). Sadly, on many other PCs, the framerate often drops bellow 30 frames per second. Since the application actually isn't to complex, I wanted to ask for some tips related to the application to improve the performance. A version of the app can be found here: www.wrodewald.de/StackOverflowExample/ The application contains a dynamic (morphing) plane using 64² vertices. A matrix is used to store a static heightmap and a wavemap. The wavemap is updated every frame to recalculate itself, some filters are used to "even out" every vertex compared to their neightbors. So every frame the plane has to be updated (colors and vertex position) which could be a reason for the performance problem The second object (rhombus) shouldn't be a problem, static, moving around a bit but nothing special. There are three lights (ambient, directional, spherical), no shadows, a tilt shift shader and a vignette shader. Here are functions which are called per frame: var render = function() { requestAnimationFrame( render ); var time = clock.getDelta(); world.updateWorld(time); diamond.rotate(time); diamond.update(time); control.updateCamera(camera, time); composer.render(); stats.update(); } this is what world.updateWorld(time) does //in world.updateWorld(time) where // accmap: stores acceleration and wavemap stores position // this.mapSize stores the size of the plane in vertices (64) // UPDATE ACCELERATION MAP for(var iX = 1; iX &lt; (this.mapSize-1); iX++) { for(var iY = 1; iY &lt; (this.mapSize-1); iY++) { accmap[iX][iY] -= dT * (wavemap[iX][iY]) * Math.abs(wavemap[iX][iY]); } } // SMOOTH ACCELERATION MAP for(var iX = 1; iX &lt; (this.mapSize-1); iX++) { for(var iY = 1; iY &lt; (this.mapSize-1); iY++) { tempmap[iX][iY] = accmap[iX-1][iY-1] * 0.0625 + accmap[iX-1][iY ] * 0.125 + accmap[iX-1][iY+1] * 0.0625 + accmap[iX ][iY-1] * 0.125 + accmap[iX ][iY ] * 0.25 + accmap[iX ][iY+1] * 0.125 + accmap…
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28199091
favorite count: 0
tagged with: three.js
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28199091
tagged with: performance

http://stackoverflow.com/comment/44671578
type: QuestionComment
type: Comment
has text: @AliNaciErdem how is possible? And what is svg IMO?
comment on: http://stackoverflow.com/q/28149857
score: 0

http://stackoverflow.com/a/28212515
answers question: http://stackoverflow.com/q/28208165
type: Answer
score: 0
has body: You are returning value from callback function of for each method..which not correct..because u r expected return value from getclass method Try this $scope.getclass =function(k){ Var c=""; angular.foreach(arr,function(v){ //to do c=k; }); return c; };

http://stackoverflow.com/comment/49885660
comment on: http://stackoverflow.com/a/28264346
score: 0
type: AnswerComment
has text: sir, if you can please check my question and answer it, it's almost same as this question you answered http://stackoverflow.com/questions/30924340/adding-file-name-using-javascript
type: Comment

http://stackoverflow.com/comment/44903782
comment on: http://stackoverflow.com/q/28256671
score: 1
type: Comment
type: QuestionComment
has text: nobody got an idea ?

http://stackoverflow.com/q/28133977
linked to: http://stackoverflow.com/q/2523436
type: Question
linked to: http://stackoverflow.com/q/4343746
accepted answer: http://stackoverflow.com/a/28135840
has comment: http://stackoverflow.com/comment/44640363
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28134122
has title: How to Remove Duplicates From Array in Javascript?
has comment: http://stackoverflow.com/comment/44640356
answer count: 2
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28135840
has comment: http://stackoverflow.com/comment/44640495
has body: Here I have two multiline textboxes and enter some data in two textboxes like txt1 1,1,1,2,2,2,3 txt2 1,2,3,4,5, when i press Filter button it shows the data in thirdtextbox like txt3 4,5 (both the textboxes are having these numbers) My snippet is and my controls are Enter Numbers: <asp:TextBox ID="txt1" TextMode="MultiLine" runat="server"></asp:TextBox> Enter Numbers: <asp:TextBox ID="txt2" TextMode="MultiLine" runat="server"></asp:TextBox> <input type='button' value='Get Distinct Items' onclick='GetDistinctElements(<%= txt1.ClientID %>,<%= txt2.ClientID %>,<%= txt3.ClientID %>); return false;' /> <asp:TextBox ID="txt3" TextMode="MultiLine" runat="server"></asp:TextBox> when I tried this snippet, I didn`t get the expected output.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44640448
downvote count: 1
has answer: http://stackoverflow.com/a/28134122

http://stackoverflow.com/q/28193510
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28196136
tagged with: download
has body: I'm using this plugin to download file by jquery. The problem is that i enter in fail function also when i download correctly the file. This is my code: function openDownloadDialog(serialNumber) { //TODO gestire okButton per scaricare la chiave $.fileDownload("/async/paas/caaas/downloadCertificate/"+serialNumber) .done(function (url) { $("#modalDownloadFailedCertificate").modal("hide");}) .fail(function (responseHtml,url) { $("#modalDownloadFailedCertificate").modal("show"); }); } How can i resolve this problem? thanks in advance
type: AnsweredQuestion
has title: jQuery File Download Plugin go always in fail function
tagged with: file
has comment: http://stackoverflow.com/comment/44756122
accepted answer: http://stackoverflow.com/a/28196136
type: Question
tagged with: javascript

http://stackoverflow.com/q/28206773
type: Question
tagged with: apache
tagged with: javascript
has comment: http://stackoverflow.com/comment/44780182
has title: even after restarting apache/django static files served are older files even after they have been changed
tagged with: static
has comment: http://stackoverflow.com/comment/44779587
answer count: 0
has comment: http://stackoverflow.com/comment/44780190
type: UnansweredQuestion
tagged with: django
tagged with: css
has body: I have updated the css and js but still the files served by apache are older files. I have even checked on my sever. The files have been changed. There are no cache system present. I have also cleared my browser cache. Still the issue persists.
score: 0

http://stackoverflow.com/a/28176453
type: Answer
answers question: http://stackoverflow.com/q/28173274
has comment: http://stackoverflow.com/comment/44727094
accepted answer of: http://stackoverflow.com/q/28173274
upvote count: 3
score: 3
has body: So, after a lot of trying, I could do it. var myAnchorNodeValue = window.getSelection().anchorNode.nodeValue; var myAnchorOffset = window.getSelection().anchorOffset var myFocusOffset = window.getSelection().focusOffset var myFocusNodeLength = window.getSelection().focusNode.nodeValue.length; window.getSelection().anchorNode.nodeValue = myAnchorNodeValue.slice(0, myAnchorOffset) + "[IDENTIFY]" + myAnchorNodeValue.slice(myAnchorOffset); var myFocusNodeValue = window.getSelection().focusNode.nodeValue; if(window.getSelection().focusNode.nodeValue.length - myFocusNodeLength &gt; 0) { myFocusOffset += window.getSelection().focusNode.nodeValue.length - myFocusNodeLength; } window.getSelection().focusNode.nodeValue = myFocusNodeValue.slice(0, myFocusOffset) + "[/IDENTIFY]" + myFocusNodeValue.slice(myFocusOffset); LAST_SELECTION = window.getSelection().getRangeAt(0); myDocument = document.documentElement.innerHTML; That worked perfectly.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44836206
type: AnswerComment
comment on: http://stackoverflow.com/a/28237425
score: 0
type: Comment
has text: There is a paranthesis in my original code. I must have deleted it by mistake while typing the codes in here. I've edited my question.

http://stackoverflow.com/comment/44690882
has text: @skobaljic It's the same as I wrote above. The cells also generated by JS: document.createElement('td'); Whole table generated via JS. The names of the Days were created by document.createTextNode(), etc. There's no actual "manual" mark-up, if we can say so.
comment on: http://stackoverflow.com/q/28159142
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28239009
answers question: http://stackoverflow.com/q/28232747
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44942419
has comment: http://stackoverflow.com/comment/44944554
accepted answer of: http://stackoverflow.com/q/28232747
has body: It seems to me that the section index starts on 0. As it always does in javascript or jquery. Although it's not very clear in the docs... $.fn.moveTo(page_index) This method allows you to move to the specified page index programatically. Change the data-target attribute to one number less on each. Home Work About Contact If you still having troubles, I would recommend you to try fullPage.js which integrates a menu option and many other useful options and configurations.
score: 0

http://stackoverflow.com/comment/44870030
score: 0
type: Comment
type: QuestionComment
has text: When I try that it gives: [object HTMLBodyElement]
comment on: http://stackoverflow.com/q/28255781

http://stackoverflow.com/comment/44706182
comment on: http://stackoverflow.com/q/28167871
score: 0
type: Comment
type: QuestionComment
has text: @LarsKotthoff: I can't see how that could be the case - each bind occurs on exactly the same data and there is a single `<g>`, `<path>` and `<circle>` for each data item. I'm not using the result of that `data()` join anywhere, yet without it a whole segment goes missing.

http://stackoverflow.com/comment/44684246
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28156270
has text: try with `display: none;` in fade out animation instead `opacity: 0;`

http://stackoverflow.com/q/28173275
has comment: http://stackoverflow.com/comment/44718224
has comment: http://stackoverflow.com/comment/44716025
has comment: http://stackoverflow.com/comment/44715779
linked to: http://stackoverflow.com/q/14220321
answer count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
has title: Need to await AJAX call, localStorage item remains 'undefined'
has body: I'm creating a functionality that sets a time before a user is automatically logged out if he's been idle for that time. The user can choose this time itself, that's why I wrote the AJAX call. Sidenote: I'm a Javascript/Jquery/... beginner. function checkTimeBeforeIdle() { alert("BEFORE: " + localStorage.getItem("timeBeforeIdle")); if (localStorage.getItem("timeBeforeIdle") === null || localStorage.getItem("timeBeforeIdle") == "undefined") { localStorage.setItem("timeBeforeIdle", getTimeBeforeIdle()); alert("AFTER: " + localStorage.getItem("timeBeforeIdle")); } } function getTimeBeforeIdle() { $.ajax({ url: 'Idle/GetTimeBeforeIdle', type: 'GET', dataType: 'json', success: function (data) { // process the data coming back alert("DURING: " + data); return data; }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } }); } The alerts that I'm getting with this configuration are (in the same order): BEFORE: undefined AFTER: undefined DURING: 15 The behaviour I expected was: BEFORE: undefined DURING: 15 AFTER: 15 From my C# 'experience' I thought the method should be awaited of some sort? Is this right, and if so, how do I do it? Or what way should this functionality be implemented. I see that multiple, similar questions have already been asked but I don't really understand the answers there and how to use that withing my code. Maybe someone could explain the answer found here: How do I return the response from an asynchronous call? more concretely for me.
type: Question
has comment: http://stackoverflow.com/comment/44716899
has comment: http://stackoverflow.com/comment/44715957
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/a/28160155
has comment: http://stackoverflow.com/comment/44691729
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28159719
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44692581
has comment: http://stackoverflow.com/comment/44692387
has comment: http://stackoverflow.com/comment/44692097
type: Answer
has body: If you are using JSON.Net (and I assume you are since you are using MVC 5), you can transform your list into a List&lt;Dictionary&lt;string, string&gt;&gt; Each list entry should be a new dictionary with one entry in that dictionary. JSON.Net will replace the property name with your dictionary key value, giving you the structure that you need. public ActionResult Test() { tests = new List&lt;Test&gt; { new Test {Key = "vKey1", Value = "value1"}, new Test {Key = "vKey2", Value = "value2"} }; var tests2 = new List&lt;Dictionary&lt;string, string&gt;&gt;(); tests.ForEach(x =&gt; tests2.Add(new Dictionary&lt;string, string&gt; { { x.Key, x.Value } })); return Json(tests2, JsonRequestBehavior.AllowGet); } Produces the following JSON: [{"vKey1":"value1"},{"vKey2":"value2"}] EDIT: To reflect the desired solution: tests.ForEach(x =&gt; tests2.Add(x.Name, x.Value));
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28159719

http://stackoverflow.com/comment/44740122
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28185680
has text: HTML5 & jQuery is fine?

http://stackoverflow.com/q/28153429
score: 8
has comment: http://stackoverflow.com/comment/44685342
has body: I'm developing a XUL based Firefox extension. I'm trying to create an inline Web Worker using BLOB. The code used to work in Firefox 33 but after update to Firefox 35 I get an error. Here is a code sample: try { var blob = new Blob(["function f(){}"], {type: "application/javascript"}); var url = window.URL.createObjectURL(blob); //blob:null/371e34bd-1fbf-4f66-89cc-24d0c1c7bad5 return new Worker(url); } catch(e) { console.error(e); } And I get a following error: Failed to load script (nsresult = 0x805303f4) I'm aware that this error appears when Web Worker tries to load a script from a different domain but I cannot figure out why this is happening in my case. The url I get from createObjectURL() function appears to be invalid. It contains "null/" prefix. Does anybody have an explanation what is going on? What is the possible fix here?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44682340
type: Question
has title: Cannot create inline Web Worker in Firefox 35 addon
has answer: http://stackoverflow.com/a/29485653
has comment: http://stackoverflow.com/comment/44679962
has comment: http://stackoverflow.com/comment/44724918
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44714984
tagged with: web-worker
has comment: http://stackoverflow.com/comment/44678566
upvote count: 8
tagged with: firefox-addon
has comment: http://stackoverflow.com/comment/44747189
has comment: http://stackoverflow.com/comment/44696680
has comment: http://stackoverflow.com/comment/44678271

http://stackoverflow.com/q/28151683
tagged with: javascript
has body: I have this piece of code : container.unbind('keypress').bind('keypress',function (e) { var code = e.which, charac = String.fromCharCode(code), totalChar = $(this).text().replace(/\s+/g, ''), diff, previousChar = publisher.typeHistory.length &gt; 0 ? publisher.typeHistory[publisher.typeHistory.length-1]:'' previousCharCode = previousChar.charCodeAt(0); if(e.keyCode === undefined){ // backspace getCharacterDiff(); console.log(totalChar.length-1); if(totalChar.length-1 === 0){ publisher.typeHistory = []; } } console.log(previousChar); if(isCharacterKeyPress(code)){ if (charac.toUpperCase() != charac.toLowerCase() ) { // Is a char or space if(charac === charac.toUpperCase()){ // Is a char upper ? if(previousChar === ' '){ console.log('upper + previous == space ', publisher.typeHistory); }else { publisher.typeHistory = []; } push = true; } else if (charac === charac.toLowerCase()){ if(previousCharCode === 32){ publisher.typeHistory = []; } if(hasUpperCase(publisher.typeHistory.join(''))){ push = true; } else { push = false; } } else { push = false; } } else if (code === 32){ console.log('space'); console.log(previousCharCode); if (previousCharCode === 32){ push = false; publisher.typeHistory = []; } // else if(previousChar === 32) { // is the spacebar ? // console.log(previousChar); // } } else { // = it's a number / , / ., etc.. console.log('not chara or space'); push = false; publisher.typeHistory = []; } if (push) { publisher.typeHistory.push(charac); } } console.log(publisher.typeHistory); previousTotal = publisher.typeHistory.join(''); if (publisher.typeHistory.length &gt; 2) { exp = publisher.typeHistory.join(''); publisher.getResults(service,type,exp); } else { if(publisher.typeHistory.length === 0){ publisher.typeHistory = []; } publisher.hideResults(); } }); With this, I handle which keys are typed in elements that have contenteditable=true, then I send it to a method that makes a request to a PHP script. Here, container can be any element with contenteditable=…
score: 0
has comment: http://stackoverflow.com/comment/44674843
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44674711
accepted answer: http://stackoverflow.com/a/28155138
type: AnsweredQuestion
has title: JS backspace keypress event triggered sometimes, sometimes not
type: Question
has answer: http://stackoverflow.com/a/28155138

http://stackoverflow.com/comment/44753837
score: 0
type: QuestionComment
has text: @mplungjan probably by typing it in the address bar of his browser (I think).
comment on: http://stackoverflow.com/q/28193345
type: Comment

http://stackoverflow.com/a/52582894
type: Answer
has body: I ran into this problem when using a PerspectiveCamera to calculate the projected coordinates of Vector3s without using a Scene or WebGLRenderer. In my case, I simply had to call camera.getWorldPosition(), which updated the cameras world matrix and point.project(camera) started working as expected.
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28271957
has comment: http://stackoverflow.com/comment/139369623
downvote count: 0

http://stackoverflow.com/q/28242889
has title: Creating a series of show/hide screens in angularjs
downvote count: 0
accepted answer: http://stackoverflow.com/a/28243046
tagged with: javascript
answer count: 1
favorite count: 0
has body: I've been tasked with implementing a series of tutorial screens. The user either moves from one to the next, or opts out, in which case the tutorial itself goes away. There is an outer div that contains each 'step' -- Step 1, step 2, step 3, etc. If the user clicks the 'Continue' button then the subsequent step is shown. Here is the first step (numbered 0): Welcome to Our Store No, thanks Continue Close So clicking the 'Continue' button should take the user to the next step. I have in the controller: $scope.goToStep = 0; //or should this just be var goToStep? $scope.moveToNextScreen = function (screenNumber){ goToStep = screenNumber; } But when the page runs, if I enter any of the variables on the scope, such as goToStep, in the console, it shows an undefined ReferenceError. Why is that? Thanks for any help.
tagged with: angularjs
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28243046
type: Question

http://stackoverflow.com/comment/44865405
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28241816
type: Comment
has text: @sourRaspberri in short; no. The interval needs to be cleared with the `clearInterval` method.

http://stackoverflow.com/q/28205914
has answer: http://stackoverflow.com/a/28206167
type: AnsweredQuestion
tagged with: angular-ui-router
accepted answer: http://stackoverflow.com/a/28206020
possible better answer: http://stackoverflow.com/a/28206167
type: Question
has comment: http://stackoverflow.com/comment/44777496
tagged with: angularjs-routing
has comment: http://stackoverflow.com/comment/44777554
answer count: 2
has comment: http://stackoverflow.com/comment/44777532
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44777505
has comment: http://stackoverflow.com/comment/44777373
tagged with: angularjs
has title: AngularJS + Routing + Resolve
has comment: http://stackoverflow.com/comment/44777552
has body: I'm getting this error: Error: Error: [$injector:unpr] http://errors.angularjs.org/1.3.7/$injector/unpr?p0=HttpResponseProvider%20%3C-%20HttpResponse%20%3C-%20DealerLeads Injector Unknown provider Here's my router (ui.router): $stateProvider .state('main', { url: "/main", templateUrl: "views/main.html", data: { pageTitle: 'Main Page' } }) .state('leads', { url: "/leads", templateUrl: "views/leads.html", data: { pageTitle: 'Dealer Leads' }, controller: 'DealerLeads', resolve: DealerLeads.resolve }) Here's my Controller: function DealerLeads($scope, HttpResponse) { alert(JSON.stringify(HttpResponse)); } Here's my resolve: DealerLeads.resolve = { HttpResponse: function ($http) { ... } } The data is getting to the controller, I see it in the alert. However, after the controller is done, during the rendering of the view (I think), the issue seems to be happening. The final rendered view has two controllers: One main controller in the body tag, and the second controller 'DealerLeads' inside of that. I've tried removing the main controller, and the issue is still present. What am I doing wrong? Is there any more code that is necessary to understand/resolve the issue?
score: 2
has comment: http://stackoverflow.com/comment/44777578
has comment: http://stackoverflow.com/comment/44777521
upvote count: 2
has answer: http://stackoverflow.com/a/28206020
has comment: http://stackoverflow.com/comment/44777626

http://stackoverflow.com/comment/44828483
has text: Your code works: http://jsfiddle.net/133tmbsk/
comment on: http://stackoverflow.com/q/28233190
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/a/28134282
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28134244
has body: obj[0].col1 is a string, try checking the docs to see if chart values can be defined as strings, or only numbers. In this case, it seems like it might only accept numbers. In the meantime, using parseInt should work fine: value: parseInt(obj[0].col1)
answers question: http://stackoverflow.com/q/28134244
downvote count: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28279629
downvote count: 0
has comment: http://stackoverflow.com/comment/44913796
has comment: http://stackoverflow.com/comment/44915075
has body: use $(this).find('#SampleNumber1').length instead of $(this).find('SampleNumber1').length you are trying to find an element with ID so specify # before. Aswell you can use $('#Sample1').hide(); $('#Sample1').show(); instead of document.getElementById('Sample1').style.display = 'none'; document.getElementById('Sample1').style.display = 'block'; EDIT/UPDATE This code search for each tr with id starts with Sample. Then seach for each span inside this tr and check if one of all spans have content or not. $( 'tr[id^="Sample"]' ).each(function() { var empty = true; $( this ).find("span").each(function() { if ($( this ).is(':empty') === false) { empty = false; } }); if (empty === false) { $(this).show(); } else { $(this).hide(); } });
upvote count: 2
answers question: http://stackoverflow.com/q/28279393
has comment: http://stackoverflow.com/comment/44915001
has comment: http://stackoverflow.com/comment/44914425
type: Answer
has comment: http://stackoverflow.com/comment/44913447
has comment: http://stackoverflow.com/comment/44915638
score: 2

http://stackoverflow.com/comment/44661475
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28144740
score: 0
has text: The strange symbols is from a copy and paste from fontAwesome & some editing to make it easier so I get the class names instead of the weird characters - https://fortawesome.github.io/Font-Awesome/cheatsheet/

http://stackoverflow.com/a/28272305
accepted answer of: http://stackoverflow.com/q/28271925
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44907327
has comment: http://stackoverflow.com/comment/44901045
has body: Here you go HTML &lt;input type="checkbox" name="pref[]" value="red//fuji" data-type="red" /&gt;Fuji &lt;br/&gt; &lt;input type="checkbox" name="pref[]" value="red//pinklady" data-type="red" /&gt;Pink Lady &lt;br/&gt; &lt;input type="checkbox" name="pref[]" value="red//reddelicious" data-type="red" /&gt;Red Delicious &lt;br/&gt; &lt;input type="checkbox" name="pref[]" value="green//grannysmith" data-type="green" /&gt;Granny Smith &lt;br/&gt; &lt;input type="checkbox" name="pref[]" value="green//goldendelicious" data-type="green" /&gt;Golden Delicious &lt;br/&gt; JavaScript / jQuery $(function () { function disableCheckboxes(color) { $('input[type="checkbox"]').prop('disabled', true); $('*[data-type="' + color + '"]').prop('disabled', false); }; function enableCheckboxes() { $('input[type="checkbox"]').prop('disabled', false); } $('input[type="checkbox"]').on('click', function () { var $this = $(this); var color = $this.data('type'); var x = $('*[data-type="' + color + '"]').prop('checked'); if ($this.is(':checked')) { disableCheckboxes(color); } else if (!$('*[data-type="' + color + '"]').prop('checked')) { enableCheckboxes(); } }); }); Example: http://jsfiddle.net/xd9xz8vg/4/ Its a little messy, but it can be cleaned up with declaring some of the jQuery selectors as variables to increase performance. EDIT: Updated the answer as per comment.
answers question: http://stackoverflow.com/q/28271925
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44860539
comment on: http://stackoverflow.com/a/28249640
score: 0
type: AnswerComment
has text: @user4041461, use `:eq()` selector and change it's index. Try the updated answer.
type: Comment

http://stackoverflow.com/comment/50184997
type: AnswerComment
has text: We use an object tag and get our svg from a separate url. innerSVG doesn't seem to work for that for me. Does anyone have any ideas about that?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28130626

http://stackoverflow.com/comment/44851025
comment on: http://stackoverflow.com/a/28239567
type: AnswerComment
score: 0
type: Comment
has text: of course, I never intended you to do so. Thanks for the edit about the snippet.

http://stackoverflow.com/a/28125065
score: 1
has comment: http://stackoverflow.com/comment/44623771
has comment: http://stackoverflow.com/comment/44623708
has comment: http://stackoverflow.com/comment/44626478
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28124459
accepted answer of: http://stackoverflow.com/q/28124459
has body: Again it's a simple modification of the Highcharts attributes in particular this small snippet: bar: { dataLabels: { enabled: true, distance : -50, formatter: function() { var dlabel = this.series.name + '&lt;br/&gt;'; dlabel += Math.round(this.percentage*100)/100 + ' %'; return dlabel }, style: { color: 'white', }, }, }, I think this snippet is what you are after?
type: Answer
has comment: http://stackoverflow.com/comment/44623516
has comment: http://stackoverflow.com/comment/44624151
upvote count: 1

http://stackoverflow.com/q/28231267
has title: JavaScript condition always fails
tagged with: if-statement
has comment: http://stackoverflow.com/comment/44824711
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44824732
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44824765
has comment: http://stackoverflow.com/comment/44824783
has body: In the below code, the if statement always fails. New to JavaScript, couldn't figure out. I believe the code is self explanatory. What am I doing wrong? if (localStorage.user_name === null || localStorage.user_name === 'undefined') { registerUser(userName); } else { login(localStorage.user_name); // Gets executed always... Even if there is no user_name in localStorage. }
linked to: http://stackoverflow.com/q/12632463
has comment: http://stackoverflow.com/comment/44824770
has answer: http://stackoverflow.com/a/28231289
accepted answer: http://stackoverflow.com/a/28231289
tagged with: local-storage
type: AnsweredQuestion

http://stackoverflow.com/q/28212927
has comment: http://stackoverflow.com/comment/44789767
has comment: http://stackoverflow.com/comment/44789737
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44789609
has comment: http://stackoverflow.com/comment/44789680
has comment: http://stackoverflow.com/comment/44789590
type: Question
score: 0
answer count: 2
has title: Some Problems About Jquery Libraries
tagged with: javascript
has answer: http://stackoverflow.com/a/28213126
tagged with: jquery
has body: Im up with a question.. I have my main file, the index.php, and inside of index im importing jquery 2.0.3. The main problem is because i have other file in the server, it is called website.php, and inside i have imported jquery 1.8.3. So, if i take off the second librarie, the all site works correctly, but one plugin doesn't work, but if i take out the second librarie, the whole site works on but the other plugin dont! Sorry for bad english, but the problem is because of the jquery conflict.. I already made some research, and use the jQuery.noConflict(), but still doesn't work! Thanks in advance!
has comment: http://stackoverflow.com/comment/44789761
has answer: http://stackoverflow.com/a/28213023

http://stackoverflow.com/q/28143301
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44658347
has answer: http://stackoverflow.com/a/28143722
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44658515
tagged with: google-chrome
type: Question
tagged with: testing
has body: for example, if I were to have alert("hello world") during run 1, and then deleted it for run 2, the code would still during the run. this does not happen in IE, and I don't use firefox so I can't tell if it would happen there. is chrome for some reason caching my runs and not loading them in on each run? for reference my project is in .net
tagged with: javascript
has title: chrome, javascript is not updating between runs
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/comment/44634722
score: 1
has text: Concept is really backwards due to the way angular works. You don't slowly integrate angular into jQuery page without a lot of problems due to the way angular manages the DOM....after *document.ready*. Will have to use a lot of `$apply()` also
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28131003

overlay
tags question: http://stackoverflow.com/q/28145291
type: Tag
tag name: overlay
tags question: http://stackoverflow.com/q/28151991

http://stackoverflow.com/q/28122948
tagged with: javascript
tagged with: ajax
has title: How to I re-invoke the promise after the first call?
has body: How can I re-invoke the promise after the first call? I have this issue where .then is executed once only after the first click, you won't get this console.log("Success!", response); executed on any click after that. But I need it to recycle. Is it possible? usage: $( document ).ready(function() { get('http://api.icndb.com/jokes/random').then(function(response) { console.log("Success!", response); }, function(error) { console.error("Failed!", error); }); }); promise function: function get(url) { // Return a new promise. return new Promise(function(resolve, reject) { $(".promise").click(function(){ // do lots of other stuff here... // Do the usual XHR stuff var req = new XMLHttpRequest(); req.open('GET', url); req.onload = function() { // This is called even on 404 etc // so check the status if (req.status == 200) { // Resolve the promise with the response text resolve(req.response); } else { // Otherwise reject with the status text // which will hopefully be a meaningful error reject(Error(req.statusText)); } }; // Handle network errors req.onerror = function() { reject(Error("Network Error")); }; // Make the request req.send(); }); }); } html, Promise
score: 0
has comment: http://stackoverflow.com/comment/44653100
has answer: http://stackoverflow.com/a/28123584
has comment: http://stackoverflow.com/comment/44619758
accepted answer: http://stackoverflow.com/a/28124802
has comment: http://stackoverflow.com/comment/44641514
tagged with: promise
has comment: http://stackoverflow.com/comment/44679281
has answer: http://stackoverflow.com/a/28124802
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28123584
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44626687

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/28267604
type: Tag

http://stackoverflow.com/a/28125817
answers question: http://stackoverflow.com/q/28125768
downvote count: 0
type: Answer
has body: Use the name and values of the inputs instead of making up a new key name and then trying to stringify an array onto it. var query_string = "?"; for ( var i=0; i&lt;elems.length; i++ ) { query_string += encodeURIComponent(elems[i].name) + "=" + encodeURIComponent(elems[i].value) + "&amp;"; } xmlhttp.open("GET", "edit.php" + query_string, true);
upvote count: 2
score: 2

http://stackoverflow.com/comment/44969283
type: Comment
has text: I did. I'm able to do a basic compare on both arrays which is awesome by doing an _.isEqual(). I'm now trying to get the comparison to work if the objects are arranged differently in both arrays, for example arrayOne = [{obj1}, {obj2}, {obj3}] and arrayTwo = [{obj3}, {obj1}, {obj2}]. This is throwing a false when obviously it should be true so I'm working through it. I'm open to any suggestions. Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/28264428
score: 0

http://stackoverflow.com/comment/44716125
type: AnswerComment
type: Comment
has text: This seems to glitch for me. When resizing the follower flickers to the end but then goes back to its correct position. Using Chrome on Mac.
comment on: http://stackoverflow.com/a/28173417
score: 0

http://stackoverflow.com/comment/44853052
has text: Guess I've had too much Vodka ...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28245938
type: QuestionComment

http://stackoverflow.com/comment/44817105
type: AnswerComment
type: Comment
score: 0
has text: this way is smart, i just want to have a good at regular Expression :)
comment on: http://stackoverflow.com/a/28226943

canvas
tags question: http://stackoverflow.com/q/28235186
tags question: http://stackoverflow.com/q/28226725
tags question: http://stackoverflow.com/q/28205370
tags question: http://stackoverflow.com/q/28162778
tags question: http://stackoverflow.com/q/28133928
tags question: http://stackoverflow.com/q/28131557
tags question: http://stackoverflow.com/q/28191793
tags question: http://stackoverflow.com/q/28172527
tags question: http://stackoverflow.com/q/28224858
tags question: http://stackoverflow.com/q/28215208
tags question: http://stackoverflow.com/q/28195785
tags question: http://stackoverflow.com/q/28174569
tags question: http://stackoverflow.com/q/28189001
tags question: http://stackoverflow.com/q/28207232
tags question: http://stackoverflow.com/q/28190417
tags question: http://stackoverflow.com/q/28137272
tags question: http://stackoverflow.com/q/28158361
tags question: http://stackoverflow.com/q/28262111
tags question: http://stackoverflow.com/q/28141792
tags question: http://stackoverflow.com/q/28250375
tags question: http://stackoverflow.com/q/28197718
tags question: http://stackoverflow.com/q/28231715
tags question: http://stackoverflow.com/q/28162810
tags question: http://stackoverflow.com/q/28269220
tags question: http://stackoverflow.com/q/28256197
tags question: http://stackoverflow.com/q/28158162
tag name: canvas
tags question: http://stackoverflow.com/q/28157550
tags question: http://stackoverflow.com/q/28212454
tags question: http://stackoverflow.com/q/28185480
tags question: http://stackoverflow.com/q/28136912
tags question: http://stackoverflow.com/q/28265270
tags question: http://stackoverflow.com/q/28140113
tags question: http://stackoverflow.com/q/28236843
tags question: http://stackoverflow.com/q/28225690
tags question: http://stackoverflow.com/q/28228150
type: Tag
tags question: http://stackoverflow.com/q/28173982
tags question: http://stackoverflow.com/q/28180574
tags question: http://stackoverflow.com/q/28179885
tags question: http://stackoverflow.com/q/28153005
tags question: http://stackoverflow.com/q/28266161
tags question: http://stackoverflow.com/q/28148455
tags question: http://stackoverflow.com/q/28170506
tags question: http://stackoverflow.com/q/28279776
tags question: http://stackoverflow.com/q/28276107
tags question: http://stackoverflow.com/q/28185772
tags question: http://stackoverflow.com/q/28243640
tags question: http://stackoverflow.com/q/28205879
tags question: http://stackoverflow.com/q/28127097
tags question: http://stackoverflow.com/q/28197923
tags question: http://stackoverflow.com/q/28160785
tags question: http://stackoverflow.com/q/28182706
tags question: http://stackoverflow.com/q/28151991
tags question: http://stackoverflow.com/q/28142351
tags question: http://stackoverflow.com/q/28163362
tags question: http://stackoverflow.com/q/28159927
tags question: http://stackoverflow.com/q/28229249

http://stackoverflow.com/comment/44775395
type: AnswerComment
comment on: http://stackoverflow.com/a/28204773
has text: Well, they will notice when performance *decreases*. And they will care.
score: 0
type: Comment

http://stackoverflow.com/comment/44857785
comment on: http://stackoverflow.com/q/28248863
score: 0
type: Comment
type: QuestionComment
has text: "<cfset StructClear(SESSION)> <cflogout>"

http://stackoverflow.com/comment/44647719
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28138008
has text: In the plunker there are 2 links. Clicking on them execute a function in the controller which does change a value. The element itself has a ng-class attribute on that value. And indeed the alert does fire, but not when you click on any of the links for the first time. As from the second click the alert does show.
score: 0

http://stackoverflow.com/comment/44679265
comment on: http://stackoverflow.com/q/28153806
score: 0
has text: You can use regex for 'dd\mm\yyyy' format :)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28264187
has title: How do I call function edit.draw from Leaflet in my button?
answer count: 1
type: AnsweredQuestion
tagged with: leaflet
type: Question
has comment: http://stackoverflow.com/comment/44885771
has body: I have created a button labeled Edit in my popup that appears once the user clicks the marker, but I am having problems calling the edit.draw function from Leaflet Draw when the user clicks the button.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28279787
accepted answer: http://stackoverflow.com/a/28279787

http://stackoverflow.com/comment/44667422
type: Comment
comment on: http://stackoverflow.com/q/28147583
has text: read the angular checkbox docs. What does `no access in controller` mean?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44740708
type: Comment
has text: Yes, Crosswalk won't probably hurt performance-wise but keep in your mind that it is huge package compared to plain app.
comment on: http://stackoverflow.com/a/28180583
score: 0
type: AnswerComment

http://stackoverflow.com/q/28236805
has body: I have this controller that handles login: html &lt;input id="UserName" type="text" class="form-control" name="UserName" data-ng-model="vm.userName" placeholder="username or email"&gt; &lt;input id="Password" type="password" class="form-control" name="Password" placeholder="password" data-ng-model="vm.password"&gt; app.js var Call23 = angular.module("Call23", ["ngResource", "ngRoute", 'ui.bootstrap']). config(function ($routeProvider) { $routeProvider. when('/', { controller: LoginCtrl, templateUrl: 'login.html' }). otherwise({ redirectTo: '/' }); }); Call23.factory("page", function($rootScope){ var page={}; var user={}; page.setPage=function(title,bodyClass){ $rootScope.pageTitle = title; $rootScope.bodylayout=bodyClass; }; page.setUser=function(user){ $rootScope.user=user; } return page; }); var LoginController = function ($scope, $routeParams, $location, LoginFactory) { $scope.loginForm = { UserName: '', password: '', returnUrl: $routeParams.returnUrl, loginFailure: false, loginSucess: false }; $scope.login = function () { var result = LoginFactory($scope.loginForm.UserName, $scope.loginForm.password, $scope.loginForm.rememberMe); result.then(function (result) { if (result.success) { if ($scope.loginForm.returnUrl !== undefined) { $location.path('/'); } else { $location.path($scope.loginForm.returnUrl); } $scope.loginForm.loginSucess = true; } else { $scope.loginForm.loginFailure = true; } }); } } var LoginFactory = function ($http, $q) { return function (UserName, Password) var deferredObject = $q.defer(); $http.post( 'login.html', { Email: UserName, Password: Password, } ). success(function (data) { if (data == "True") { deferredObject.resolve({ success: true }); } else { deferredObject.resolve({ success: false }); } }). error(function () { deferredObject.resolve({ success: false }); }); return deferredObject.promise; } } LoginFactory.$inject = ['$http', '$q']; I get this error even before i try to login or build my project. Can you please help. Error: [$inject…
has answer: http://stackoverflow.com/a/28237737
type: Question
has title: Login using angularjs?
tagged with: javascript
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/28169526
answers question: http://stackoverflow.com/q/28168113
has comment: http://stackoverflow.com/comment/44731118
type: Answer
has body: Well, for one, in onsuccess, the db comes from the event, not the original object: db = event.target.result; Most likely you got this as an error in your console.
has comment: http://stackoverflow.com/comment/44723218
score: 0

http://stackoverflow.com/comment/45018396
has text: See https://developer.mozilla.org/en-US/docs/Web/API/Blob , https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications
type: Comment
comment on: http://stackoverflow.com/a/28257733
score: 0
type: AnswerComment

http://stackoverflow.com/q/28148849
has body: I would like to discuss between custom elements without events in a parent custom element. How could I do this, if it's possible ? This is my-custom-parent-element.htlm : this is my-custom-element-1 : this is my-custom-element-2 :
has comment: http://stackoverflow.com/comment/44707299
tagged with: polymer
score: 1
type: Question
has answer: http://stackoverflow.com/a/28175431
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: How to discuss between custom Polymer elements without events
has comment: http://stackoverflow.com/comment/44681227
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28218342
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/44800316
answer count: 1
downvote count: 0
favorite count: 0
has body: Taken from nanoajax (https://github.com/yanatan16/nanoajax). Why not just pass in this, what does the self execution function returning this do? !function(e, t) { function n() { if (t.XMLHttpRequest) return new t.XMLHttpRequest; try { return new t.ActiveXObject("MSXML2.XMLHTTP.3.0") } catch (e) {} } t.nanoajax = e, e.ajax = function(e, t, r) { r || (r = t, t = null); var u = n(); return u ? (u.onreadystatechange = function() { 4 == u.readyState &amp;&amp; r(u.status, u.responseText) }, t ? (u.open("POST", e, !0), u.setRequestHeader("X-Requested-With", "XMLHttpRequest"), u.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")) : u.open("GET", e, !0), void u.send(t)) : r(new Error("no request")) } }({}, function() { return this }());
has title: What does 'function(){ return this }()' do as an argument?
has answer: http://stackoverflow.com/a/28218551
accepted answer: http://stackoverflow.com/a/28218551
has comment: http://stackoverflow.com/comment/44800589
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/q/28260548
tagged with: javascript
tagged with: jquery
has title: Unable to increment javascript variable on click
has answer: http://stackoverflow.com/a/28260564
has answer: http://stackoverflow.com/a/28260566
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: math
has body: I am generating forms, and giving each generated form a prefix in the name field. I have done increments several times before, but something is causing the variable not to increment. This is essentially the code. // Start at 2 because form 1 is in document already var food_number = 2; var food_form = '&lt;input name="food_name_' + food_number + '"/&gt;'; $(document).ready(function() { $('#add_food_form').click( function(){ $('#food-forms-cnt').append(food_form); food_number = food_number + 1; }); }); I have tried the following variations on the increment line. food_number = food_number + 1; food_number++; ++food_number; As well as creating a separate variable i and using that to increment the variable food_number. The result for every form I create is this. &lt;input name="food_name_2"/&gt; I'm guessing that when the function is finished, the variable is not retaining new value. Is that correct? If so, how can I have the variable keep it's value. If that's not correct, what is happening.
type: Question
answer count: 2

http://stackoverflow.com/comment/44714295
comment on: http://stackoverflow.com/a/28172586
has text: @SimonAndréForsberg Not worth a downvote, it does work
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44755259
has text: Just a reminder: tool recommendation is off-topic for Stack Overflow. Take a look at JSHint
score: 1
comment on: http://stackoverflow.com/q/28194172
type: QuestionComment
type: Comment

http://stackoverflow.com/a/49520372
has body: The full ISO8601 format (IIRC) is expecting a capital letter "T" in between the date and time portions of that string, e.g. ""2014-11-22T00:00:00.0"" https://en.wikipedia.org/wiki/ISO_8601 (I'd therefore recommend always adding the T delimiter. E.g. the following code will parse to NaN in some browsers: var myAlmostISODate = "2014-11-22 00:00:00.0"; console.log("Date: " + Date.parse(myAlmostISODate)); //IE11: NaN //Firefox: 1416632400000 //Chrome: 1416632400000
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28265145
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28265145

http://stackoverflow.com/q/28162090
has body: I have the following AJAX PUT request that was given to me. I'd like to run it from a Python script. I'm new to everything AJAX/HTTP related, so I'm guessing. Here's the request: $.ajax({ url: &lt;insert base URL here&gt; + "/state", type: 'PUT', contentType: 'application/json', data: JSON.stringify({ state: "&lt;insert state here&gt;", state_modified_by: $.cookie("&lt;insert username here&gt;") }), complete: function(data) { document.location.reload(); } }) Here's my attempt at implementing the same request in Python using the requests library: import requests url = &lt;insert base URL here&gt; + "/state" data = json.dumps({"state" : "&lt;insert state here&gt;", "state_modified_by" : "&lt;insert username here&gt;"}) headers = {"Content-Type":"application/json"} response = requests.put(url, headers = headers, data = data) That gets me a "bad request" response from the URL. Things I'm definitely unsure about: - Is using the requests library even the best route? Is there an easier way to run jQuery type stuff from Python? - Is json.dumps equivalent enough to JSON.stringify? - What is "$.cookie" and how do I do something similar in Python? - How do I do the "completion event" that the AJAX request does using requests in Python? Any help is greatly appreciated - thanks very much!
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
tagged with: python
has title: Translating an AJAX put request into a Python request
upvote count: 1
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion

http://stackoverflow.com/comment/44913300
type: QuestionComment
comment on: http://stackoverflow.com/q/28274768
has text: @oysterhoys That's because of the way you are binding your handlers. See my answer.
score: 0
type: Comment

http://stackoverflow.com/q/28195610
has comment: http://stackoverflow.com/comment/44758032
has title: Why is this error appearing in chrome load resource: net::ERR_QUIC_PROTOCOL_ERROR
favorite count: 0
has answer: http://stackoverflow.com/a/49262117
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/76173393
has answer: http://stackoverflow.com/a/28408386
downvote count: 4
has body: This is the error I am seeing in my Chrome's console. load resource: net::ERR_QUIC_PROTOCOL_ERROR How can I fix it? I want to display a Google map
upvote count: 84
score: 80
tagged with: google-chrome
has answer: http://stackoverflow.com/a/31725418
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/29788621
linked to: http://stackoverflow.com/q/20569394
has answer: http://stackoverflow.com/a/29856146
tagged with: javascript

semaphore
type: Tag
tags question: http://stackoverflow.com/q/28174167
tag name: semaphore

http://stackoverflow.com/comment/134335030
type: AnswerComment
comment on: http://stackoverflow.com/a/28260746
has text: `[ \t]*` basically count all lines regardless it empty or not. Because of the "*", the line will still match if it has content.
type: Comment
score: 0

http://stackoverflow.com/comment/44884459
has text: possible reason might be you are changing focus to new window and may be that supportedi n ff and chrome but IE8 , just check in ff / chrome console to see if you get error like form is undefined or not ?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28263722

http://stackoverflow.com/q/28199100
score: 13
linked to: http://stackoverflow.com/q/105034
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28220928
has comment: http://stackoverflow.com/comment/44804615
linked to: http://stackoverflow.com/q/9550796
tagged with: javascript
tagged with: random
answer count: 3
possible better answer: http://stackoverflow.com/a/28199204
has comment: http://stackoverflow.com/comment/44766370
has answer: http://stackoverflow.com/a/28199204
accepted answer: http://stackoverflow.com/a/28220928
tagged with: entropy
favorite count: 0
has comment: http://stackoverflow.com/comment/44765110
has comment: http://stackoverflow.com/comment/44764681
has comment: http://stackoverflow.com/comment/44764597
linked to: http://stackoverflow.com/q/47624223
has body: The requirement is to send a unique id to database when user click on submit button. So I am using Javascript Math.random method. I just want to know what are the chances or possibility to get same number and what bit size of using Math.random.
has title: Probability of getting the same value using Math.random
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44764553
has answer: http://stackoverflow.com/a/28199157
has comment: http://stackoverflow.com/comment/44764887
upvote count: 14
tagged with: probability

http://stackoverflow.com/q/28221410
type: Question
has body: I was asked to findout the bugs in this function but I am not able to do... can you tell me whtats the bug in it... I dont see anything am i missing anythin... providing my code below... I thought return statement should have ; function average(a, b) { return a + b / 2; }
has title: js bug in the average function
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28221487
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44805918
favorite count: 0
accepted answer: http://stackoverflow.com/a/28221487
type: AnsweredQuestion
downvote count: 1

http://stackoverflow.com/comment/44871417
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28256499
has text: hi loanburger, im still not getting the items in the list, any suggestions ?

http://stackoverflow.com/comment/78691158
has text: Adding the empty front matter to the top of my js file causes the `Liquid Exception: SyntaxError: Unexpected token` warning to trigger.
score: 3
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28148188

http://stackoverflow.com/comment/44622502
has text: `You must use the $scope instead of $rootScope to use the broadcasted events` this is false. And if you are trying to reach everyone `$rootScope.$emit` and `$rootScope.$on` is better for performance. My first guess is what Thomas mentioned.
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28124442

events
tags question: http://stackoverflow.com/q/28210214
tags question: http://stackoverflow.com/q/28225452
tags question: http://stackoverflow.com/q/28222396
tags question: http://stackoverflow.com/q/28167017
tags question: http://stackoverflow.com/q/28278604
tags question: http://stackoverflow.com/q/28238157
tags question: http://stackoverflow.com/q/28260547
tags question: http://stackoverflow.com/q/28220550
tags question: http://stackoverflow.com/q/28268835
tags question: http://stackoverflow.com/q/28146276
tags question: http://stackoverflow.com/q/28214771
tags question: http://stackoverflow.com/q/28124405
tags question: http://stackoverflow.com/q/28258982
tags question: http://stackoverflow.com/q/28181459
tags question: http://stackoverflow.com/q/28243258
tags question: http://stackoverflow.com/q/28252933
tags question: http://stackoverflow.com/q/28178500
tags question: http://stackoverflow.com/q/28170605
tags question: http://stackoverflow.com/q/28254412
tag name: events
tags question: http://stackoverflow.com/q/28156555
tags question: http://stackoverflow.com/q/28200117
tags question: http://stackoverflow.com/q/28126635
tags question: http://stackoverflow.com/q/28154485
tags question: http://stackoverflow.com/q/28155137
tags question: http://stackoverflow.com/q/28254991
type: Tag
tags question: http://stackoverflow.com/q/28232179
tags question: http://stackoverflow.com/q/28175117

http://stackoverflow.com/comment/44863958
type: Comment
has text: @peter-seabrook, make sure u replaced/wrapped both of them, it should work. Alternatively you can place all the code in 1 function.
comment on: http://stackoverflow.com/a/28251617
type: AnswerComment
score: 0

http://stackoverflow.com/a/28235775
has body: html &lt;input type="text" name="txt" onkeypress="Search" /&gt; javascript &lt;script&gt; function Search(e){ if(e.keyCode === 13){// enter key value is 13 **// Your ajax request write here , and in server side you can **check corresponding results in database and return if data is present and take it as ajax replay**** } return false; } &lt;/script&gt;
score: 1
answers question: http://stackoverflow.com/q/28235586
accepted answer of: http://stackoverflow.com/q/28235586
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/28194196
type: Answer
upvote count: 2
has body: Since the AJAX request is executed asynchronously, wrapping your code in try ... catch will not catch the exception. The exception happens after your code has finished executing. You should handle the .fail case on the object returned by $.get to avoid seeing that error reported on the console: var jqxhr = $.get("&lt;c:out value="${baseURL}"/&gt;/js/getCounts", function() { vardata = data; }) .done(function() { alert( "second success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); }); As a side note, you should put the complete body of your function inside the call back in $.get. Otherwise, you'll always be running your code with the old dataset, not the new one. This problem doesn't show up in your code in the first execution because vardata is probably undefined and in Javascript land, undefined != null is false.
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28194119
answers question: http://stackoverflow.com/q/28194119

http://stackoverflow.com/a/43152739
downvote count: 0
has body: I dont know if you solve this error for this question was raised 2 years ago. I happened to get the error just like you, and I guess the error might be Cannot read property 'insertBefore' of null. Adding wrap layer div inside the ng-repeat to prevent the angular element been messed and sort it by operate with the div just added list like the following should prevent this error: {{user.name}} remove user
type: Answer
upvote count: 5
answers question: http://stackoverflow.com/q/28232974
score: 5

http://stackoverflow.com/q/28273013
has title: Angular selected for multiple select
has answer: http://stackoverflow.com/a/28273202
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
type: Question
possible better answer: http://stackoverflow.com/a/28273202
score: 1
answer count: 2
has body: I'm working on this fiddle HERE this is my controller angular.module('demoApp', []).controller('DemoController', function($scope) { $scope.options = [ { label: 'one', value: 'a' }, { label: 'two', value: 'b' }, { label: 'three', value: 'c' }, { label: 'four', value: 'd' } ]; $scope.selected = [{ 'sel': 'a' },{ 'sel': 'b' },{ 'sel': 'c' } ] ; }); the $scope.options is the option for my select dom and the $scope.selected is the selected item in my select dom this is my index.html selected must be : {{data.sel}} what I had is this what I need is on first load the selected must be selected like this could anyone help me?
upvote count: 1
has answer: http://stackoverflow.com/a/28273211
accepted answer: http://stackoverflow.com/a/28273211
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/44640448
type: QuestionComment
comment on: http://stackoverflow.com/q/28133977
has text: *"I didn`t get the expected output."* - You could be a bit clearer about what the expected output actually is. And did you get some other output instead, or an error in your browser's dev console?
score: 0
type: Comment

http://stackoverflow.com/comment/44721333
has text: The username needs to be in quotes.
type: Comment
score: 3
comment on: http://stackoverflow.com/q/28176068
type: QuestionComment

http://stackoverflow.com/a/28179832
has body: You didn't prepared your json string good enough, so you have: {"sommer":[{"event_name":"testevent","DATE_FORMAT (beginn, '%d.%m.%Y')":"28.01.2015","DATE_FORMAT (ende, '%d.%m.%Y')":"30.01.2015"}]} that's mean that your property name is "DATE_FORMAT (ende, '%d.%m.%Y')" but in your js code you are trying to get: item.beginn that has no sense. So my suggestion is to change your json string (I guess somewhere on php side) to: {"sommer":[{"event_name":"testevent","beginn":"28.01.2015","ende":"30.01.2015"}]} Probably you can do that right in sql query, if I see the way you do this: mysql_query("SELECT event_name, DATE_FORMAT(beginn,'%d.%m.%Y') as beginn, DATE_FORMAT(ende,'%d.%m.%Y') as ende FROM party WHERE ende &gt;= CURDATE()ORDER BY beginn ASC"); and I think you will be able to fix your js much easier.
answers question: http://stackoverflow.com/q/28176225
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28176225
upvote count: 2
type: Answer
score: 2

adsense
tags question: http://stackoverflow.com/q/28211769
tag name: adsense
tags question: http://stackoverflow.com/q/28279076
type: Tag

http://stackoverflow.com/q/28273791
has comment: http://stackoverflow.com/comment/44902868
has comment: http://stackoverflow.com/comment/44902842
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How to make a link open on the second click, not the first?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44903447
downvote count: 3
score: -3
duplicate of: http://stackoverflow.com/q/4562012
has comment: http://stackoverflow.com/comment/44902719
linked to: http://stackoverflow.com/q/4562012
has body: I have a popunder advert, and would like for it to be opened when the page is clicked a second time, not the first time. Is this possible? The popunder: Thanks
has answer: http://stackoverflow.com/a/28274110
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44740550
comment on: http://stackoverflow.com/a/28184555
score: 0
type: Comment
has text: @Ethaan Yes, but if I hit page refresh the content will revert to `'text'`.
type: AnswerComment

http://stackoverflow.com/comment/44864650
has text: Have you looked at AngularFire? That is Firebase's own binding for AngularJS and it solves many of the mapping problems, such as the one you seem to have: mapping Firebase's auto-generated keys to array indices (which AngularJS needs).
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28247683
type: QuestionComment

http://stackoverflow.com/comment/44831362
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28234626
has text: @Spokey no I am not using any plugin Replaceoption() is a Jquery extention function
score: 0

http://stackoverflow.com/comment/44848425
comment on: http://stackoverflow.com/q/28241318
type: Comment
type: QuestionComment
has text: Oh, I've done that. I had the outer tags due to that was how the js code was written to accept, and could not work with tags. Now that I have it fixed, I have it set up as a instead of a
score: 0

http://stackoverflow.com/comment/44700330
type: Comment
type: QuestionComment
has text: No I dont know how to pass lat laon from java class to javascript,My java code i have mentioned above which will connect to db & fetch records
score: 0
comment on: http://stackoverflow.com/q/28164843

http://stackoverflow.com/a/28130127
has comment: http://stackoverflow.com/comment/44633344
has comment: http://stackoverflow.com/comment/44633394
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44633553
upvote count: 2
has body: if not valid delete the object Don't. Better, test the email address to be valid before trying to create the user. or return nothing You can't really. Returning nothing from a constructor is effectively quite impossible, except you throw an exception. Use an extra factory function instead: function isValidEmail(str) { // http://davidcel.is/blog/2012/09/06/stop-validating-email-addresses-with-regex/ return /.+@.+\..+/.test(str); } function User(email) { // possible, but better don't do this: // if (!isValidEmail(email)) throw new Error("Tried to create User with invalid email") this.email = email; } User.prototype.checkValid = function () { return isValidEmail(this.email); }; User.create = function(email) { if (isValidEmail(email)) return new User(email); else return null; }; var user1 = User.create("bob123@aol.com") if (user1) this.checkValid() // true
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28129865
has comment: http://stackoverflow.com/comment/44633450
answers question: http://stackoverflow.com/q/28129865
has comment: http://stackoverflow.com/comment/44633308

http://stackoverflow.com/comment/44737837
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28184249
has text: So I tried the function in stackoverflow and yes it works as expected, which means my problem is that I am trying to use jQuery on a site that doesn't actually load the jQuery library. How do I load it then?

http://stackoverflow.com/comment/44866498
type: Comment
comment on: http://stackoverflow.com/a/28253438
has text: Where did you find getElementsByTagName("a[href*='myWord']")? I'm not aware that getElementsByTagName has any such capability.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44768003
comment on: http://stackoverflow.com/a/28198939
score: 0
type: AnswerComment
type: Comment
has text: Thank you. I've been editing and testing piece by piece since I found the script tag error and was very close to the answer. Looks simple now. I am sorry I didn't get it myself, I'm new to JS, I prefer PHP.

http://stackoverflow.com/comment/44669153
type: Comment
has text: @LostInCyberSpace: Strings are immutable in JavaScript, and so your `rev` cannot work as you've asked. The fact that the spec appears to make them immutable by fiat (not specifying any way to change them) rather than an explicit "strings are immutable" statement doesn't matter one way or the other; they're immutable either way, and I very much doubt that will ever change. You can only implement `rev` as above, *returning* a new string, just as all the other `String` methods do.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28148255

http://stackoverflow.com/a/28138896
type: Answer
has comment: http://stackoverflow.com/comment/44652529
has comment: http://stackoverflow.com/comment/44660383
has body: Attach a click event handler to anchor element and toggle the active class on its closest 'li' element: $(".navigation a[data-toggle='tab']").click(function(e){ $(this).closest('li').toggleClass('active') }); NOTE: you can improve the performance of code by specifying id's to anchors as attribute based search is not that much proficient.
score: 0
answers question: http://stackoverflow.com/q/28138707

http://stackoverflow.com/q/28255957
tagged with: scope
has answer: http://stackoverflow.com/a/28256048
accepted answer: http://stackoverflow.com/a/28256048
favorite count: 0
possible better answer: http://stackoverflow.com/a/28256166
has answer: http://stackoverflow.com/a/28256101
type: AnsweredQuestion
has body: Stylistically, I prefer this structure: var Filter = function( category, value ){ this.category = category; this.value = value; // product is a JSON object Filter.prototype.checkProduct = function( product ){ // run some checks return is_match; } }; To this structure: var Filter = function( category, value ){ this.category = category; this.value = value; };// var Filter = function(){...} Filter.prototype.checkProduct = function( product ){ // run some checks return is_match; } Functionally, are there any drawbacks to structuring my code this way? Will adding a prototypical method to a prototype object inside the constructor function's body (i.e. before the constructor function's expression statement closes) cause unexpected scoping issues? I've used the first structure before with success, but I want to make sure I'm not setting myself for a debugging headache, or causing a fellow developer grief and aggravation due to bad coding practices.
has comment: http://stackoverflow.com/comment/44870377
has answer: http://stackoverflow.com/a/28256166
has comment: http://stackoverflow.com/comment/44870287
tagged with: methods
has answer: http://stackoverflow.com/a/28256152
linked to: http://stackoverflow.com/q/7115594
type: Question
has comment: http://stackoverflow.com/comment/44870221
has comment: http://stackoverflow.com/comment/118512794
score: 5
has answer: http://stackoverflow.com/a/28256026
has comment: http://stackoverflow.com/comment/44870218
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/44870212
tagged with: javascript
answer count: 6
has title: Assigning prototype methods *inside* the constructor function - why not?
has comment: http://stackoverflow.com/comment/44870629
has answer: http://stackoverflow.com/a/35966445
tagged with: prototype

http://stackoverflow.com/comment/44893189
score: 0
type: Comment
has text: that's just a fake name. I can't make a mistake in this
comment on: http://stackoverflow.com/a/28268249
type: AnswerComment

http://stackoverflow.com/comment/44766378
has text: It seems the same issue as [this one](http://stackoverflow.com/questions/28089080/rate-limiting-parse-com-background-jobs/28093694#28093694). Use `Parse.Object.saveAll` without burst too much request.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28199924

http://stackoverflow.com/a/68504866
upvote count: 4
answers question: http://stackoverflow.com/q/28222048
has body: Using modern JS: document.querySelectorAll('.className').forEach(elem =&gt; console.log(elem.getAttribute('attribute-you-want')));
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/q/28250268
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Javascript forms Value disappear
has comment: http://stackoverflow.com/comment/44860204
has comment: http://stackoverflow.com/comment/44860188
type: AnsweredQuestion
has body: First the code: I know that this is a useless and very poor code but I want to know that why does the values that I enter in the input box disappear right after I click the "Submit" button. Similarly, the result in the third input box appears only for a moment and then disappears. Why is this happening?
tagged with: dom
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28250410
accepted answer: http://stackoverflow.com/a/28250410
score: 0
has comment: http://stackoverflow.com/comment/44860253

http://stackoverflow.com/a/28245692
score: 0
type: AcceptedAnswer
has body: You are setting the values on sr instead of the object. Give this a shot: function ConvertFormToJSON(target_form) { var form = $(target_form); var arr = []; form.each(function() { var obj = {}; var sr = $(this).serializeArray(); $.each(sr, function() { obj[this.name] = this.value; }); arr.push(obj); }); return JSON.stringify(arr); } ConvertFormToJSON('.lang_block');
type: Answer
has comment: http://stackoverflow.com/comment/44852510
answers question: http://stackoverflow.com/q/28245571
accepted answer of: http://stackoverflow.com/q/28245571

http://stackoverflow.com/a/28275635
score: 3
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44907190
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44908593
accepted answer of: http://stackoverflow.com/q/28274417
has comment: http://stackoverflow.com/comment/44907287
has body: Fixed you fiddle. Possibly, problem is in immediate function. Also fixed ng-app and response processing HTML Sport {{sport}} JS angular .module("Sports", []) .controller("MainController", ["$scope", "$http", function($scope, $http) { $http.get("https://www.googleapis.com/books/v1/volumes?q=isbn:0747532699") .success(function (response) { console.log(response); $scope.sport = response.items; }); }]); Update Plunker version for AngularJS v1.3.x
answers question: http://stackoverflow.com/q/28274417

http://stackoverflow.com/a/28256101
score: 0
answers question: http://stackoverflow.com/q/28255957
has comment: http://stackoverflow.com/comment/44870479
has body: In first example Filter prototype is not filled with functions until Filter is invoked at least once. What if somebody tries to inherit Filter prototypically? Using either nodejs' function ExtendedFilter() {}; util.inherit(ExtendedFilter, Filter); or Object.create: function ExtendedFilter() {}; ExtendedFilter.prototype = Object.create(Filter.prototype); always ends up with empty prototype in prototype chain if forgot or didn't know to invoke Filter first.
type: Answer
has comment: http://stackoverflow.com/comment/44872774
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44870682
has comment: http://stackoverflow.com/comment/44870567

http://stackoverflow.com/a/28169895
score: 0
type: Answer
has body: You are applying the stop propagation to the parent , apply it to the child as it prevents "event bubbling" not "Event capturing"
answers question: http://stackoverflow.com/q/28169758

http://stackoverflow.com/a/28265285
has comment: http://stackoverflow.com/comment/44920966
score: 2
has comment: http://stackoverflow.com/comment/44889328
has comment: http://stackoverflow.com/comment/44887188
has comment: http://stackoverflow.com/comment/44904852
has comment: http://stackoverflow.com/comment/44889289
answers question: http://stackoverflow.com/q/28265253
has comment: http://stackoverflow.com/comment/44888188
accepted answer of: http://stackoverflow.com/q/28265253
type: AcceptedAnswer
downvote count: 0
has body: Now that you have added a jsFiddle, I know what you're talking about. I previously suggested a method that uses jQuery's .add() function because you tagged your question with jQuery; however, you are using Raphael and not jQuery, so this method didn't work for you. Please change that tag. The best way to shorten your procedure is creating an array containing the variables and iterate through it: var array = [x, y, z]; for(var i in array) array[i].mouseover(doStuff); Old answer: jQuery uses .click(). .onClick() doesn't exist. There are two ways to solve your problem: First, you could store the event handler in a variable and pass it to the .click() function: var eventHandler = function() {alert("test");}; x.click(eventHandler); y.click(eventHandler); z.click(eventHandler); Or you could add the variables and invoke .click(function) on the new set: x.add(y).add(z).click(function() {alert("test");});
upvote count: 2
type: Answer

http://stackoverflow.com/comment/44843111
score: 0
has text: @Qualcuno - Since all webSocket connections start as an HTTP request and are then "upgraded" to the webSocket protocol, it wouldn't surprise me if turning the `upgrade` option off makes it so that it never turns into a webSocket connection. To confirm that, one would have to study the engine.io source code as the documentation does not really explain. I don't know exactly without further study of the source code. This is a [good reference](https://developer.mozilla.org/en-US/docs/WebSockets/Writing_WebSocket_servers) if you want to see how a webSocket connection is started.
comment on: http://stackoverflow.com/a/28240802
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28210527
has comment: http://stackoverflow.com/comment/44785527
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44785540
has answer: http://stackoverflow.com/a/28646666
has title: IE not showing whole text from topojson - just 2-3 words
accepted answer: http://stackoverflow.com/a/28646666
tagged with: internet-explorer
type: Question
tagged with: browser
score: 0
has body: I have big browser issue. In my project I need all browser working, but somehow the IE is just showing 2 and a half word. Look at this jsfiddle.net/kwoxer/5uc17jwr/3/ In Firefox and Chrome it's working. So it's a IE issue. I have the latest IE 11. Can someone tell me why it just happens to IE and also for what reason. As you can see the code is printing text on lines. 1. idea Could it be because the direction is negative? So the IE is just able to sure text going from left to right? But that's stupid =/ and why working in Firefox and Chrome? Well I don't know why the third one is not completely displayed and the following are also not displayed. Some huge IE bug I think. If someone has an idea, let me please know. But from here I think I won't support IE anymore in my project and just continue =) Btw: also tested with other lines and text, it is the same, always the third word, even tho the third one is NOT negative... 2. idea Bringing the defs as first element bringing also no change.
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: text

http://stackoverflow.com/a/28195625
answers question: http://stackoverflow.com/q/28195536
has body: You could set it up inside the function so that it calls itself after the interval. function anim(elem,style,unit,from,to,time) { if( !elem) return; var start = new Date().getTime(), timer = setInterval(function() { var step = Math.min(1,(new Date().getTime()-start)/time); elem.style[style] = (from+step*(to-from))+unit; if( step == 1) clearInterval(timer); },25); elem.style[style] = from+unit; setInterval(function(){ anim(elem,style,unit,from,to,time); }, time); }
score: 0
type: Answer

http://stackoverflow.com/comment/44809537
type: AnswerComment
has text: typical date problem :D
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28223302

http://stackoverflow.com/a/28246049
has comment: http://stackoverflow.com/comment/44863001
upvote count: 1
has comment: http://stackoverflow.com/comment/44854022
type: Answer
has body: Just call /me/friends. It will contain a summary with total_count. You can read more about it at https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends
score: 1
has comment: http://stackoverflow.com/comment/44854959
downvote count: 0
answers question: http://stackoverflow.com/q/28244642
has comment: http://stackoverflow.com/comment/44868898

http://stackoverflow.com/comment/44706244
type: QuestionComment
comment on: http://stackoverflow.com/q/28168151
score: 0
type: Comment
has text: even after placing '.' it is still not working :(

http://stackoverflow.com/comment/44664418
type: QuestionComment
has text: have you tried to register the onchange event on the checkboxes? Maybe this could help you...
comment on: http://stackoverflow.com/q/28146363
score: 0
type: Comment

http://stackoverflow.com/comment/44733524
has text: JS doesn't actually have access to the generated URL, but you can use some tools to build a queryString from a form, jQuery has it built-in. you might need a replace() call on that to strip empties. you can also remove the name of any empty input onsubmit(), and it should be removed from the key=value pairings.
comment on: http://stackoverflow.com/q/28182062
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44664002
comment on: http://stackoverflow.com/q/28146008
has text: your selector seems wrong. add a class 'manager' to select tag. I can see there is only one class to select so far 'managerchosen-select-deselect'.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44899174
score: 0
type: AnswerComment
has text: Since I didn't run it locally, I made a typo in storyService. Try deploy to heroku again.
type: Comment
comment on: http://stackoverflow.com/a/28260864

http://stackoverflow.com/comment/57434300
has text: @happy.cze yes I found this also! Otherwise you end up with 2 modal back drops when you close then re-open the modal. Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/33063095
score: 0
type: Comment

http://stackoverflow.com/q/28160066
has answer: http://stackoverflow.com/a/28160168
accepted answer: http://stackoverflow.com/a/28160168
type: Question
upvote count: 2
downvote count: 2
has body: var myArray = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; for (var i = 1; i &lt; 21; i++){ if (i%3 === 0 &amp;&amp; i%5 === 0){ console.log("FizzBuzz") } else if (i%3 === 0){ console.log("Fizz") } else if (i%5 === 0){ console.log("Buzz") } else { console.log(i) }} Hello! This code is one of the solutions on codecademy. I was wondering how the FOR loop knows to access the 'myArray' array to find the value of 'i'. I never mention 'myArray' in the FOR loop, yet it knows. I'm confused because what if I had wanted the FOR loop to access another array? What is the logic of the FOR loops? Thanks so much everyone.
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/28160125
has title: Javascript logic - How does the FOR loop know which array to access automatically
possible better answer: http://stackoverflow.com/a/28160088
has comment: http://stackoverflow.com/comment/44691578
has answer: http://stackoverflow.com/a/28160088
has answer: http://stackoverflow.com/a/28160098
has comment: http://stackoverflow.com/comment/44691947
answer count: 5
has comment: http://stackoverflow.com/comment/44691540
has comment: http://stackoverflow.com/comment/44693311
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28160339

codeigniter
tags question: http://stackoverflow.com/q/28243732
tags question: http://stackoverflow.com/q/28171995
type: Tag
tags question: http://stackoverflow.com/q/28185892
tags question: http://stackoverflow.com/q/28132303
tags question: http://stackoverflow.com/q/28128083
tag name: codeigniter
tags question: http://stackoverflow.com/q/28168690
tags question: http://stackoverflow.com/q/28155534
tags question: http://stackoverflow.com/q/28124484

http://stackoverflow.com/comment/44904759
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28274967
has text: *"step 4: should print 1,2,3"* - Why? Also, does the loop have an end?
type: Comment

http://stackoverflow.com/a/28246117
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28162686
type: Answer
has comment: http://stackoverflow.com/comment/45034073
has comment: http://stackoverflow.com/comment/45035235
score: 17
has comment: http://stackoverflow.com/comment/45313536
has comment: http://stackoverflow.com/comment/54185409
upvote count: 17
has body: See fast browserify builds with watchify. Note that the only thing passed to browserify is the main entry point, and watchify's config. The transforms are added to the watchify wrapper. code from article pasted verbatim var gulp = require('gulp'); var gutil = require('gulp-util'); var sourcemaps = require('gulp-sourcemaps'); var source = require('vinyl-source-stream'); var buffer = require('vinyl-buffer'); var watchify = require('watchify'); var browserify = require('browserify'); var bundler = watchify(browserify('./src/index.js', watchify.args)); // add any other browserify options or transforms here bundler.transform('brfs'); gulp.task('js', bundle); // so you can run `gulp js` to build the file bundler.on('update', bundle); // on any dep update, runs the bundler function bundle() { return bundler.bundle() // log errors if they happen .on('error', gutil.log.bind(gutil, 'Browserify Error')) .pipe(source('bundle.js')) // optional, remove if you dont want sourcemaps .pipe(buffer()) .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file .pipe(sourcemaps.write('./')) // writes .map file // .pipe(gulp.dest('./dist')); }
accepted answer of: http://stackoverflow.com/q/28162686

http://stackoverflow.com/comment/44815107
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28225925
has text: Good point. Thanks for forcing me to ask better. Editing now...

http://stackoverflow.com/comment/44732327
comment on: http://stackoverflow.com/a/28180578
type: AnswerComment
score: 0
has text: Yep, those are the options.
type: Comment

http://stackoverflow.com/a/28173684
score: 1
has body: In that case it is not angular thing. Please try: console.log(SchedulingModel.weekdays) //undefined // but this will work var TimesOfTheMonth = ''; var Weekdays = ""; var a = new SchedulingModel(); console.log(a.weekdays); //works ok
upvote count: 1
answers question: http://stackoverflow.com/q/28173413
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44820276
score: 0
type: AnswerComment
has text: @Uebyn I wonder if the general approach is sound. If you're offering your application under a SaaS model, or simply offering it up to your users internally at your place of work, it would seem to me that login should be part of a web *site*, not the web *app*. That's what we do. That way, the app isn't responsible for authentication.
type: Comment
comment on: http://stackoverflow.com/a/28228190

http://stackoverflow.com/comment/44839749
has text: @MarkL: Do you want all of them to point to the same language of different ones?
type: Comment
comment on: http://stackoverflow.com/a/28239322
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44922871
score: 0
type: Comment
has text: After playing around with the merges folder a bit. I have found out that the back button problem only affects windows phone 8.1. The back button navigation works fine on windows phone 8. However the rotate screen problem is still present on both windows phone 8 and 8.1.
type: QuestionComment
comment on: http://stackoverflow.com/q/28240622

http://stackoverflow.com/comment/45084220
type: AnswerComment
type: Comment
has text: P.S. just to avoid confusion, I always test on Mobile Safari in iOS.
comment on: http://stackoverflow.com/a/28242273
score: 0

http://stackoverflow.com/q/28199257
tagged with: javascript
score: 4
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28199344
upvote count: 4
possible better answer: http://stackoverflow.com/a/28199909
has body: I have been looking for examples of multiple conditions in ng-class but I can't find using the same terminology. Here is an example of what I want to achieve. ng-class="isSelected ? 'side_menu_link_active' : 'side_menu_link_disabled' , pageSelected =='lectures' ? 'link_active' : 'link_disabled'" Does anyone knows the correct syntax for this? thanks.
has answer: http://stackoverflow.com/a/28199909
downvote count: 0
tagged with: ng-class
type: Question
has comment: http://stackoverflow.com/comment/44765066
type: AnsweredQuestion
has title: ng-Class - multiple conditions and classes
answer count: 2
accepted answer: http://stackoverflow.com/a/28199344

http://stackoverflow.com/a/28253794
has comment: http://stackoverflow.com/comment/44870384
upvote count: 1
has body: First make sure that you are calling your code inside the document ready callback, so: $(document).ready(function () { $('#picture').on('click',function() { takePicture(); } }); You are not showing your camera options, here is some code that works for me. function onSuccess(imageURI) { // This will show the photo in an &lt;img&gt; element with id="photo" jQuery('#photo').attr('src', imageURI).show(); // Do more stuff here } var folder = true; // set to false to take with camera, true to select from library navigator.camera.getPicture(onSuccess, onFail, { quality: 25, // 25% // takes a photo that will fit precisely within an iPhone 6 Plus screen targetWidth: 1080, targetHeight: 960, destinationType: Camera.DestinationType.FILE_URI, sourceType: folder ? Camera.PictureSourceType.PHOTOLIBRARY : Camera.PictureSourceType.CAMERA });
has comment: http://stackoverflow.com/comment/44876009
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28248684
type: Answer

http://stackoverflow.com/comment/44763685
type: QuestionComment
comment on: http://stackoverflow.com/q/28198490
score: 0
has text: The formatting of the site may be refering to the tags themselves. In such a case, each single tag can be a valid answer for formatting the HTML page. the tag, as an example, is formatting a text, like the tag and so on. Not sure if that's a valid answer, but it seems to logically be the closest answer to the question, right? In any case @charlietfl's comment is a way better solution. If he (the teacher) doesn't want to answer, give him/her two apples.
type: Comment

google-chrome
tags question: http://stackoverflow.com/q/28178668
tags question: http://stackoverflow.com/q/28171365
tags question: http://stackoverflow.com/q/28215380
tags question: http://stackoverflow.com/q/28201351
tags question: http://stackoverflow.com/q/28135499
tags question: http://stackoverflow.com/q/28128861
tags question: http://stackoverflow.com/q/28162031
tags question: http://stackoverflow.com/q/28168698
tags question: http://stackoverflow.com/q/28201205
tags question: http://stackoverflow.com/q/28195610
tags question: http://stackoverflow.com/q/28198851
tags question: http://stackoverflow.com/q/28141139
tags question: http://stackoverflow.com/q/28132068
tags question: http://stackoverflow.com/q/28262796
tags question: http://stackoverflow.com/q/28165900
tags question: http://stackoverflow.com/q/28159927
tags question: http://stackoverflow.com/q/28191102
tags question: http://stackoverflow.com/q/28279332
tags question: http://stackoverflow.com/q/28132966
tags question: http://stackoverflow.com/q/28201164
tags question: http://stackoverflow.com/q/28186349
tags question: http://stackoverflow.com/q/28177632
tags question: http://stackoverflow.com/q/28274264
tags question: http://stackoverflow.com/q/28248686
tags question: http://stackoverflow.com/q/28245931
tags question: http://stackoverflow.com/q/28149730
tags question: http://stackoverflow.com/q/28209552
tags question: http://stackoverflow.com/q/28264871
tags question: http://stackoverflow.com/q/28277340
tags question: http://stackoverflow.com/q/28261544
tags question: http://stackoverflow.com/q/28128024
tags question: http://stackoverflow.com/q/28232742
tags question: http://stackoverflow.com/q/28254895
tags question: http://stackoverflow.com/q/28222548
tags question: http://stackoverflow.com/q/28215017
tags question: http://stackoverflow.com/q/28154220
tags question: http://stackoverflow.com/q/28224923
tags question: http://stackoverflow.com/q/28207606
tags question: http://stackoverflow.com/q/28257914
tags question: http://stackoverflow.com/q/28277312
tags question: http://stackoverflow.com/q/28250348
tags question: http://stackoverflow.com/q/28275841
tags question: http://stackoverflow.com/q/28149327
tags question: http://stackoverflow.com/q/28221520
tags question: http://stackoverflow.com/q/28255781
tags question: http://stackoverflow.com/q/28166076
tags question: http://stackoverflow.com/q/28235891
tags question: http://stackoverflow.com/q/28175372
tags question: http://stackoverflow.com/q/28234381
tags question: http://stackoverflow.com/q/28213298
tags question: http://stackoverflow.com/q/28218991
tags question: http://stackoverflow.com/q/28253273
tags question: http://stackoverflow.com/q/28190802
tags question: http://stackoverflow.com/q/28217204
tags question: http://stackoverflow.com/q/28242827
tags question: http://stackoverflow.com/q/28153982
type: Tag
tags question: http://stackoverflow.com/q/28236836
tags question: http://stackoverflow.com/q/28211174
tag name: google-chrome
tags question: http://stackoverflow.com/q/28134731
tags question: http://stackoverflow.com/q/28188703
tags question: http://stackoverflow.com/q/28168951
tags question: http://stackoverflow.com/q/28251133
tags question: http://stackoverflow.com/q/28137557
tags question: http://stackoverflow.com/q/28262934
tags question: http://stackoverflow.com/q/28235034
tags question: http://stackoverflow.com/q/28182011
tags question: http://stackoverflow.com/q/28159690
tags question: http://stackoverflow.com/q/28127553
tags question: http://stackoverflow.com/q/28143301
tags question: http://stackoverflow.com/q/28215678
tags question: http://stackoverflow.com/q/28189046
tags question: http://stackoverflow.com/q/28179904
tags question: http://stackoverflow.com/q/28277701
tags question: http://stackoverflow.com/q/28135489
tags question: http://stackoverflow.com/q/28199770
tags question: http://stackoverflow.com/q/28171489
tags question: http://stackoverflow.com/q/28130650
tags question: http://stackoverflow.com/q/28181004

http://stackoverflow.com/comment/44891626
type: AnswerComment
comment on: http://stackoverflow.com/a/28259252
type: Comment
score: 1
has text: Nope, callsite means "location in your code where the function gets called".

http://stackoverflow.com/a/28213393
score: 0
answers question: http://stackoverflow.com/q/28212366
type: Answer
has body: Try $total = $dom->getElementById('total').innerHTML;

http://stackoverflow.com/a/28265503
accepted answer of: http://stackoverflow.com/q/28249909
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: First off, it's important to understand that Todo.update is an async function which delivers its results to a callback function rather than returning it. But the Mongoose update function also takes its parameters in a different way than the shell. So your code should look something like this instead: Todo.update({}, {$set: {tags: []}}, {upsert: false, multi: true}, function(err, numberAffected, rawResponse) { console.log('Number of docs modified: ' + numberAffected); }); The rawResponse parameter to the callback contains the full response from Mongo, but that's really only useful when using upsert.
has comment: http://stackoverflow.com/comment/60520756
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28249909

http://stackoverflow.com/comment/44638772
type: QuestionComment
comment on: http://stackoverflow.com/q/28133053
has text: let's me give you an example, lets say, when your alarm rings --like when you click the button. You are going to start your car and drive to the store. Then your friends come over suddenly -- like you return false there, you stop your engine and will not go to the store anymore, just like that, when you return false, your click event will not be processed anymore. So you either return true or remove the return completely
score: 0
type: Comment

http://stackoverflow.com/comment/44831167
comment on: http://stackoverflow.com/a/28217003
has text: Thanks for you effort, But there's still the same problem , It's not applied on the select loaded via ajax ...
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44899671
has text: Brilliant, worked like a charm, thanks very much for that :). As I said thought it needed to be in an array but didn't know how to do it.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28272003
type: Comment

http://stackoverflow.com/comment/44687298
comment on: http://stackoverflow.com/q/28157827
type: Comment
type: QuestionComment
has text: Furthermore, you cannot ensure that the public key actually reaches the client. An attacker may insert his own public key and play the man-in-the-middle. The attacker can also manipulate the page in such a way that login data is directly sent to the attacker. You have to have some trust in the browser and that is why you need to use TLS/SSL.
score: 2

http://stackoverflow.com/comment/44911983
has text: Always try to add a brief explanation of what you do.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28277722
type: Comment

http://stackoverflow.com/a/28249590
upvote count: 3
has body: The following object isn't in JSON format, but still it's a javaScript object. console.log(typeof text); // it says text is an object So you can access the properties of that object. In your case try, console.log(text.isNavPaneDisabled);
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28249545
score: 3
answers question: http://stackoverflow.com/q/28249545

http://stackoverflow.com/comment/44929073
type: Comment
has text: It has to do with `$_POST['acceptpost']`. I don't see it anywhere in your form. Write `if(isset($_POST['postnames'])) {`instead.
comment on: http://stackoverflow.com/a/28266859
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44722718
type: QuestionComment
score: 0
has text: I'm experiencing this issue in Chrome and IE 11.
comment on: http://stackoverflow.com/q/28173122
type: Comment

http://stackoverflow.com/q/28217032
tagged with: input
has comment: http://stackoverflow.com/comment/44798143
downvote count: 0
answer count: 0
type: UnansweredQuestion
has title: Javascript native code function gives me "foo is not a function" error
has body: I'm trying to emulate keyboard key presses in the Ekioh SVG browser. It only supports the deprecated initKeyboardEvent event constructor. Here is my code for creating the event: evt = document.createEvent('KeyboardEvent'); console.log(evt.initKeyboardEvent.toString()); // output: // evt.initKeyboardEvent:function initKeyboardEvent() { // [native code] // } evt.initKeyboardEvent("keypress", true, true, window, 0, keyCode, false, "", 0); // output: // TypeError: evt.initKeyboardEvent is not a function at file:/foo.js:302 How come it gets printed as a function but I can't call it?
has comment: http://stackoverflow.com/comment/44798158
linked to: http://stackoverflow.com/q/11857524
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44798163
upvote count: 1
has comment: http://stackoverflow.com/comment/44797481
tagged with: javascript
has comment: http://stackoverflow.com/comment/44797763
favorite count: 0

http://stackoverflow.com/comment/44853320
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28231569
type: QuestionComment
has text: I opened an issue with the nw.js project https://github.com/nwjs/nw.js/issues/3034

http://stackoverflow.com/a/37771394
has body: When using bluebird, you can use .bind method to share variables in promise chain: somethingAsync().bind({}) .spread(function (aValue, bValue) { this.aValue = aValue; this.bValue = bValue; return somethingElseAsync(aValue, bValue); }) .then(function (cValue) { return this.aValue + this.bValue + cValue; }); please check this link for further information: http://bluebirdjs.com/docs/api/promise.bind.html
answers question: http://stackoverflow.com/q/28250680
has comment: http://stackoverflow.com/comment/63014686
type: Answer
upvote count: 4
score: 1
downvote count: 3

http://stackoverflow.com/q/28175274
type: Question
has comment: http://stackoverflow.com/comment/44719886
answer count: 2
tagged with: jquery-deferred
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28175491
has answer: http://stackoverflow.com/a/28248025
has comment: http://stackoverflow.com/comment/44719732
has title: pass variable into deferred done
type: UnansweredQuestion
has body: I'm trying to pass a variable into a done callback, but haven't had any luck. var getDataForCompany = function(company_id) { $.ajax({ type: "post", url: url, data:{ company_id: company_id } }).done(function(returnedData, textStatus, jqXHR) { anotherFn(company_id); //need to access company_id here, but it is undefined }); }; I tried wrapping the entire AJAX request in an IIFE to try to make a closure to capture my company_id, but var getDataForCompany = function(company_id) { ($.ajax({ type: "post", url: url, data:{ company_id: company_id } }).done(function(returnedData, textStatus, jqXHR) { anotherFn(company_id); //need to access company_id here, but it is undefined })(company_id); }; also failed to work. Is this not the correct method?
upvote count: 1
has comment: http://stackoverflow.com/comment/95289988
score: 1
has comment: http://stackoverflow.com/comment/44721826
has comment: http://stackoverflow.com/comment/44719695
has comment: http://stackoverflow.com/comment/44725253

http://stackoverflow.com/comment/44879719
type: QuestionComment
comment on: http://stackoverflow.com/q/28259019
has text: the very first example friend shows the code being fixed at the bottom :) i went ahead and added the finished example for you to see what I was looking for
type: Comment
score: 0

http://stackoverflow.com/q/28208492
has comment: http://stackoverflow.com/comment/44781844
has comment: http://stackoverflow.com/comment/44782058
has answer: http://stackoverflow.com/a/28208657
tagged with: javascript
has comment: http://stackoverflow.com/comment/44782491
answer count: 3
has body: This is the controller. &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; @RequestMapping("/getDropDownAjax") public void forA(HttpServletRequest req,HttpServletResponse resp){ System.out.println("through ajax"); String aString=service.getA(); try { resp.getWriter().write(aString); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } This controller requests the service layer and it returns: [pg,ug] This is the ajax part function callAjax(){ $.ajax({ type:"GET", url:"getDropDownAjax.htm", success:function(data) { alert("success"); console.log(data); }, error:function(){ alert("failed"); }, }); } Now, I need to have pg seperately and ug seperately, so that I can add it to a select box. Thank you
has comment: http://stackoverflow.com/comment/44781781
possible better answer: http://stackoverflow.com/a/28208543
has answer: http://stackoverflow.com/a/28208543
accepted answer: http://stackoverflow.com/a/28208657
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28209170
score: 0
tagged with: http://stackoverflow.com/tag/json
has title: I am new to jQuery and JSON. I need help in formatting the string so that I can iterate over it
type: Question
has comment: http://stackoverflow.com/comment/44781770

kaazing
tags question: http://stackoverflow.com/q/28194313
tag name: kaazing
type: Tag

http://stackoverflow.com/comment/44874930
comment on: http://stackoverflow.com/q/28258483
type: Comment
type: QuestionComment
has text: Your AJAX call doesn't actually send anything to the server.
score: 0

http://stackoverflow.com/comment/44770772
score: 1
has text: @Fenistil strings don't have a push method. :)
comment on: http://stackoverflow.com/q/28202249
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28266731
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28267887
has body: I have a few tables on my webpage where I use the tablesorter extension to allow sorting. Everything works fine except for one table. This particular table contains a numeric value, but also a div element. The problem is, that since there is the div, the tablesorter treats it as text and for example "1000" is sorted as lower than "999", because it only recognizes the initial 1 and 9. I have read the documentation and tried to implement a custom parser based on it - http://tablesorter.com/docs/example-parsers.html Unfortunately it doesnt work. Basically what I was trying to achieve - the cell always contains a number followed by "...... " etc. so I was trying to filter out the value in front of the initial "&lt;" symbol. But for some reason it just ignores the parser. It is difficult to explain properly, so I have created a jsfiddle. Please ignore the rest of the design, images etc. it looks differently on my page, but the issue is there. Look at for example the column "Total", there are numbers larger than 1000 but it is sorted as lower than numbers above 100 (it is obviously treated as text). The sorting is initialized by clicking on the table headers. Any help appreciated. http://jsfiddle.net/8v8ycb09/ Parser code: $.tablesorter.addParser({ // set a unique id id: 'main', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // format your data for normalization return s.substr(0, s.indexOf('&lt;')); }, // set type, either numeric or text type: 'numeric' });
has title: Tablesorter parser to ignore div element
type: AnsweredQuestion
tagged with: tablesorter
has answer: http://stackoverflow.com/a/28267935
type: Question
possible better answer: http://stackoverflow.com/a/28267935
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28267887
score: 0
answer count: 2

http://stackoverflow.com/a/28263453
answers question: http://stackoverflow.com/q/28263221
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44884826
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28263221
has body: Just add this at the begining of your function: var textareas=document.getElementsByTagName('textarea'); textareas[0].textContent=textareas[0].value; these instructions will update the textarea content
score: 1

http://stackoverflow.com/a/28234035
type: Answer
answers question: http://stackoverflow.com/q/28233899
has body: looks like your data parameter of $.ajax() method is invalid. It's named userid, not getUserID, right. Also investigate Network tab in Chrome dev tools (F12) and see what actually server responds for this AJAX request. Also type "POST" looks suspicious, when you are able to get response with GET request
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44835239
upvote count: 1
has comment: http://stackoverflow.com/comment/44913335

http://stackoverflow.com/comment/44829662
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28233715
has text: @Nano sorry i couldnt get you!?
score: 0

http://stackoverflow.com/comment/44846331
type: QuestionComment
comment on: http://stackoverflow.com/q/28242770
has text: Also, dont forget to clear counter to be 0 when you ClearInterval
score: 0
type: Comment

http://stackoverflow.com/a/28272917
has comment: http://stackoverflow.com/comment/44900939
type: AcceptedAnswer
score: 0
type: Answer
has body: According to your JSON data structure fields configuration should be columns: [{ field: "TransactionId", title: "TransactionID", width: "30px" }, { field: "Log", title: "Audit Logs", width: "110px" }] in this case you don't need schema configuration as you don't have root JSON element. The schema schema: { data: "d" } implies that data has the following format: {d: [{"TransactionId": "185492010250010630", "Log": "Administrator Super has updated jobdescmanagement on 1/28/2015 4:24:03 PM"}]} however this is not your case.
accepted answer of: http://stackoverflow.com/q/28272743
answers question: http://stackoverflow.com/q/28272743

http://stackoverflow.com/comment/44770489
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28201488
has text: an array consisting of 3 values: 1, 2, and 3. Is that not right?

http://stackoverflow.com/a/28132627
has body: Use jQuery, it is much easier. function styleOne() { $(".block-square").css("background-color","yellow"); }
answers question: http://stackoverflow.com/q/28132582
score: 0
type: Answer

http://stackoverflow.com/comment/44737992
score: 1
type: Comment
type: QuestionComment
has text: Are you able to change the height of the `div` you're using as the chart? Right now it's limited to 400px so it can't give you the padding you want.
comment on: http://stackoverflow.com/q/28184263

http://stackoverflow.com/comment/44799521
comment on: http://stackoverflow.com/q/28217794
score: 0
has text: And where do you use `_gat`?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44890993
type: QuestionComment
score: 10
comment on: http://stackoverflow.com/q/28267443
has text: Well, you could actually, `if (arguments.length > 1) throw Error;`
type: Comment

http://stackoverflow.com/q/28134163
has body: I have one controller and two views. ClustersContorller angular.module('app.controllers').controller('ClustersController', [ '$scope', 'ClustersService', function($scope, ClustersService) { ClustersService.getAll().success(function(data) { $scope.clusters = data; }); $scope.$on('cluster:added', function(event, data) { ClustersService.createNew(data).then( function(res) { $scope.clusters.push(res.data); }, function(res) { console.log( 'Unable to create a cluster!' ); } ); }); } ]); Now one view is working great when I send the HTTP request and update the scope variable by pushing to $scope.clusters: <h2 ng-show="clusters.length < 1">You have no clusters :( {{ cluster.name }} {{ cluster.description }} But the other view that is bound with this controller does not update scope.clusters in the bindings: {{cluster.name}} Just to be clear the first view is bound by the $routeProvider and the second one is a part of a template included directly into the app main html file by ng-include=" 'templates/partials/header.html' " Please feel free to ask me if something is confusing...
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28134723
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28134723
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: AngularJS: Scope in multiple views not updating
tagged with: data-binding
tagged with: angularjs

http://stackoverflow.com/comment/44702145
has text: You need to provide the HTML in your question
score: 1
comment on: http://stackoverflow.com/q/28165898
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28293115
has body: This will be Better answer of this question.. I initially debug by help of Manoj. Thanks again. HTML &lt;input type="text" id="selector"/&gt; &lt;input type="checkbox" id="myCheckbox"/&gt; SCRIPT $('#selector').change(function () { $('#myCheckbox').prop('checked', true); // Checks it alert($('#selector').val()); });
answers question: http://stackoverflow.com/q/28215212
upvote count: 1
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/44804247
comment on: http://stackoverflow.com/a/28220437
score: 0
type: AnswerComment
has text: is it a question? Inside anonymous function, 'num' is the 'num' closest to the function code, which is the `num` parameter of `addFunction`.
type: Comment

http://stackoverflow.com/comment/44812568
type: Comment
comment on: http://stackoverflow.com/a/28221752
has text: @ShawnStrickland let me know if that helps, otherwise I'll comment on gist
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44673805
comment on: http://stackoverflow.com/a/28151164
type: AnswerComment
score: 0
has text: True, inserting is simple. if you can point where am i adding it twice other than the pos
type: Comment

http://stackoverflow.com/q/28274417
tagged with: javascript
has comment: http://stackoverflow.com/comment/44904632
has answer: http://stackoverflow.com/a/28275439
has comment: http://stackoverflow.com/comment/44905424
downvote count: 0
possible better answer: http://stackoverflow.com/a/28274606
favorite count: 0
has answer: http://stackoverflow.com/a/28274606
has comment: http://stackoverflow.com/comment/44904567
has comment: http://stackoverflow.com/comment/44904702
tagged with: angularjs
has answer: http://stackoverflow.com/a/28275635
has comment: http://stackoverflow.com/comment/44904023
answer count: 4
accepted answer: http://stackoverflow.com/a/28275635
tagged with: model-view-controller
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/33274772
has body: (function () { var app = angular.module("Sports", []); var MainController = function($scope, $http) { var onUser = function (response) { obj = JSON.parse(response); $scope.sport = angular.fromJson(obj); }; $http.get("/api/SportApi/Get").success(function (response) { obj = JSON.parse(response); $scope.sport = angular.fromJson(obj); }); }; app.controller("MainController", ["$scope", "$http", MainController]); }()); So yeah, this script is not working, getting the error it can not find the "main controller as function" whats the problem? EDIT: the error cause is in this function: function consoleLog(type) { var console = $window.console || {}, logFn = console[type] || console.log || noop, hasApply = false; // Note: reading logFn.apply throws an error in IE11 in IE8 document mode. // The reason behind this is that console.log has type "object" in IE8... try { hasApply = !!logFn.apply; } catch (e) {} if (hasApply) { return function() { var args = []; forEach(arguments, function(arg) { args.push(formatError(arg)); }); return logFn.apply(console, args); //throws exception }; }
has comment: http://stackoverflow.com/comment/44904693
has comment: http://stackoverflow.com/comment/44905151
type: Question
score: 5
has comment: http://stackoverflow.com/comment/44904796
has title: angularJS 1.4.0 Argument 'MainController' is not a function, got undefined
upvote count: 5

http://stackoverflow.com/comment/44854141
type: QuestionComment
has text: Consider looking at d3.js, a visualization library made for these kind of problems
comment on: http://stackoverflow.com/q/28246742
score: 0
type: Comment

http://stackoverflow.com/a/28190047
type: Answer
downvote count: 0
score: 1
has body: To understand ready(), you need to know about DOMContentLoaded event. The DOMContentLoaded event is fired when the document has been completely downloaded and parsed, all the external scripts and internal scripts are downloaded and executed and DOM is ready to start manipulating. This event will not wait for stylesheets, images, and subframes to finish loading. There's a load event which can be used to detect a fully-loaded page. As you can see here DomContentLoaded event is supported by almost all browsers except below &lt; IE9. There're events like readystatechange which can be used to emulate DOMContentLoaded in IE8 and in IE7, we need to call doScroll() and see if throws an exception, it will not throw any exception once DOM is loaded. Instead of you worrying about these cross-browser differences, ready() in jQuery abstracts the functionality to pass callback to invoke on DOMContentLoaded event. DOMContentLoaded event started at FF and later adopted by all main stream browsers like Chrome, Opera and IE but standardised in HTML5. This event will fire only in case of documents where as load will be triggered on successful loading of any resource like &lt;script&gt; &lt;img&gt;. Now know that we know that there's a gap between DOMContentLoaded and load events, many people use this event's callback to do some javascript initilization while other resources are being loaded. You can even see these events with tools like DeveloperTools in Chrome Example 2 and Example 1 are both same in terms of their functionality-used to pass a callback for DOMContentLoaded, except that in 2nd one, you're passing jQuery as argument but reading it as $, so all the functions inside that function expression can work with $ and you can still have some other library outside using $ as global object with its own functions, that way conflict between two libraries using same $ as global object is resolved. Example 1 &amp; 4 are same but with minor difference of using $ or jQuery as global obj…
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28183005
accepted answer of: http://stackoverflow.com/q/28183005

http://stackoverflow.com/q/28249608
upvote count: 1
has title: How to Persist State Between Animations in CSS3?
type: Question
has body: I was hoping css3 animations, especially when I mark it as "forwards" would actually change my element's transforms. But it doesn't. See: http://jsfiddle.net/foreyez/3b3f6oyx/ ---USE CHROME BROWSER--- HTML: Go Down Go Right CSS: @-webkit-keyframes animdownkf { 0% { } 100% { transform: translateY(100px); } } @-webkit-keyframes animrightkf { 0% { } 100% { transform: translateX(100px); } } #box { width:50px; height:50px; background:black; } button { height:100px; width:100px; } .animdown { -webkit-animation:1s animdownkf forwards; } .animright { -webkit-animation:1s animrightkf forwards; } JAVASCRIPT: function down() { $('#box').removeClass('animright'); $('#box').addClass('animdown'); } function right() { $('#box').removeClass('animdown'); $('#box').addClass('animright'); } What I'd like it to do is persist state, so if I clicked on "go down" it would go down, and then if I clicked on "go right" it would go right FROM THE LOCATION it is currently at. But it doesn't seem to do this. I know css3 transitions allows to do this but I specifically want css3 animations because I need to use keyframes. I just want my 100% to change the actual element's style. Is there a way to do this?
has comment: http://stackoverflow.com/comment/45937189
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28779042
type: UnansweredQuestion
tagged with: animation
tagged with: css
score: 1

http://stackoverflow.com/comment/44856611
type: Comment
score: 1
has text: Check if you have two jquery files included in same page.
comment on: http://stackoverflow.com/q/28248113
type: QuestionComment

http://stackoverflow.com/a/28282380
accepted answer of: http://stackoverflow.com/q/28280037
has body: If you dig into Angular's code base, you'll notice that the utility functions defined in angular.js are used quite frequently. While certain function definitions in angular's set of utility functions do seem rather redundant, there are a few benefits in having them defined this way: Some of the utility functions do have subtle behavioral differences when compared to their native counterparts. For instance, just looking at the documentation for Angular's angular.forEach: Unlike ES262's Array.prototype.forEach, Providing 'undefined' or 'null' values for obj will not throw a TypeError, but rather just return the value provided. var values = {name: 'misko', gender: 'male'}; var log = []; angular.forEach(values, function(value, key) { this.push(key + ': ' + value); }, log); expect(log).toEqual(['name: misko', 'gender: male']); * Type-verification calls such as angular.isDate can be replaced by their defining expression toString.call(value) === '[object Date]' without too much fuss, but having a single function call like angular.isDate presents a more fluent interface to other parts of the code base. i.e. the expression if (angular.isDate(value)) { /* do work */ } is easier to read and understand than its counterpart if (toString.call(value) === '[object Date]') { /* do work */ } Centralizing the implementation of their utility functions also allows Angular to easily test these functions, to ensure that they behave as expected across different browser implementations. Other parts of the Angular code base can then call this set of tested utility functions, knowing that, in theory, each call should behave in a predictable way. I'm sure there are many other reasons that I haven't thought of, but you can always dive into the code base yourself to get a better, more complete answer :)
type: Answer
answers question: http://stackoverflow.com/q/28280037
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4

http://stackoverflow.com/q/28239452
score: 12
has body: I am trying to write a unit test with Jest and Jasmine-pit for the below code and am totally stumped with it. The code is an ajax call which retrieves some data from resource and saves it in the variable. init = function() { var deferred = Q.defer(); $.ajax({ type: 'GET', datatype: 'json', url: window.location.origin + name, success: function (data) { userId = data.userId; apiKey = data.apiKey; deferred.resolve(); } }); return deferred.promise; },
answer count: 2
has title: How to write a unit test with Jest for code with Promise
has comment: http://stackoverflow.com/comment/63039295
tagged with: jasmine
favorite count: 0
upvote count: 12
type: UnansweredQuestion
tagged with: jestjs
downvote count: 0
tagged with: unit-testing
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/37751451
has answer: http://stackoverflow.com/a/29615252

http://stackoverflow.com/q/28194052
accepted answer: http://stackoverflow.com/a/28196377
tagged with: datatable
has answer: http://stackoverflow.com/a/28194838
tagged with: jsf
upvote count: 2
has title: get rowIndex in rowEdit ajax event
answer count: 2
possible better answer: http://stackoverflow.com/a/28194838
tagged with: primefaces
tagged with: javascript
type: AnsweredQuestion
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28196377
tagged with: jquery
favorite count: 0
has body: I have an editable dataTable (row edit mode). When I edit row and click tick to confirm new value, I would like to validate some columns (some of them are required) using jqxvalidator. So, when a tick is clicked, validateRule(#{rowIndex}); function should validate the row which was just edited, but rowIndex value passed to this function is undefined. Is there any other way to get row index and pass it to JavaScript function? Some of my xhtml code: &lt;p:dataTable id="tblRule" var="item" value="#{bean.ruleList}" binding="#{bean.dtRules}" editable="true" editMode="row" rowIndexVar="rowIndex" widgetVar="tblRuleWidget"&gt; &lt;p:ajax event="rowEdit" listener="#{bean.doEdit}" update="tblRule" onstart="validateRule(#{rowIndex}); " /&gt; &lt;p:ajax event="rowEditCancel" onstart="hideValidatorMsg();" /&gt; &lt;p:column&gt; &lt;p:rowEditor /&gt; &lt;/p:column&gt; &lt;p:column id="colRuleId" headerText="Id" &gt; &lt;h:outputText value="#{item.id}" /&gt; &lt;/p:column&gt; &lt;p:column id="colRuleCode" headerText="Code"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{item.code}" /&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText id="inRuleCode" value="#{item.code}" onblur="hideValidatorMsg(); validateRule(#{rowIndex});" /&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; JavaScript: function validateRule(rowIdx) { var namespace = 'view' + $('[id$=hidNamespace]').val(); $('#' + namespace + '\\:form1').jqxValidator({ animation : 'none', scroll : false, arrow : false, rules : [ { input : '#' + namespace + '\\:form1\\:tabView\\:tblRule\\:' + rowIdx + '\\:inRuleCode', message : 'Required field!', action : 'blur', position : 'top', rule : 'required' } ] }); if ($('#' + namespace + '\\:form1').jqxValidator('validateInput', '#' + namespace + '\\:form1\\:tabView\\:tblRule\\:' + rowIdx + '\\:inRuleCode') === false) { return false; } else { return true; } }
type: Question

http://stackoverflow.com/q/28134299
type: Question
has comment: http://stackoverflow.com/comment/44640929
has comment: http://stackoverflow.com/comment/44667320
tagged with: highcharts
downvote count: 0
tagged with: javascript
has title: Limited xAxis between min and max datetime in HighChart
tagged with: jquery
upvote count: 1
has body: I use Spline HighChart With This Style. My Data For Example Is Between 2013 AND 2015 And XAxis Of Chart Is Between This DateTime, But I Want To Be Between 2014 AND 2015. I Want The XAis Exactly Between t1 AND t2 AND I don't Want To Show Data Out Of This Range function liveLineChart(container, series, loadFunction, StartDate) { var chart; $('#' + container).highcharts({ chart: { zoomType: 'x', resetZoomButton: { position: { x: 0, y: -30 } }, type: 'spline', animation: Highcharts.svg, // don't animate in old IE marginRight: 10, events: { load: function () { loadFunction(this.series); } } }, title: { text: 'Alarms ' }, xAxis: { type: 'datetime', tickPixelInterval: 150, //min: StartDate }, yAxis: { title: { text: 'Value' }, plotLines: [{ value: 0, width: 1, color: '#808080' }], min: 0, max: 100 }, credits: { enabled: false }, plotOptions: { series: { turboThreshold: 0 }, spline: { marker: { enabled: false } } }, tooltip: { //enabled: false, formatter: function () { return Highcharts.dateFormat('%Y/%m/%d&lt;br/&gt;%H:%M:%S', this.x) + '&lt;br/&gt;' + Highcharts.numberFormat(this.y, 2); }, style: { fontSize: '8.5px' } }, exporting: { enabled: true }, series: series }); } I want To this Xaxis of Live Chart be limited with specific min And Max DateTime. But This Char couldn't Work properly
favorite count: 0
has comment: http://stackoverflow.com/comment/44640919
answer count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/a/28166233
type: Answer
has body: The problem is your for loop is checking for "while greater than rowCount" so it never fires even once! That should have been: for(var i = 1; &lt;= rowCount; i++) or better yet use 0-based indexing: for(var i = 0; &lt; rowCount; i++) As you just want to iterate the rows and get the first 3 TDs, forget all the nth-child selectors and do it this much simpler way: var $rows = $('.destination tr'); $rows.each(function(){ var $tds = $(this).find('td'); var continent = $td.eq(0).text(); var country = $td.eq(1).text(); var city = $td.eq(2).text(); // Do something with the values });
answers question: http://stackoverflow.com/q/28165898
score: 0

http://stackoverflow.com/q/28254670
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/3653301
favorite count: 0
has answer: http://stackoverflow.com/a/28254707
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
linked to: http://stackoverflow.com/q/28349522
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28254725
has title: Include html code within a Jquery function
downvote count: 0
score: 1
has body: I have the following JQUery function $('button.forward').click(function() { }); where once the button forward - below is the code for the button - is clicked, a modal should appear as such &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" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&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-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
type: Question
has answer: http://stackoverflow.com/a/28254716
tagged with: javascript
has comment: http://stackoverflow.com/comment/44867907
tagged with: jquery
answer count: 3

http://stackoverflow.com/comment/61020122
has text: I was never able to test this idea to confirm that it works (my job changed), but the underlying principle is brilliant.
comment on: http://stackoverflow.com/a/28128213
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44680279
type: QuestionComment
has text: FYI: You will not get an email address for every Facebook user (f.e. for those that registered for FB using their mobile.)
type: Comment
comment on: http://stackoverflow.com/q/28153852
score: 0

http://stackoverflow.com/q/28135955
score: 1
favorite count: 0
tagged with: ruby
type: Question
has title: What is a good way for Ruby integration tests to test javascript that does not change the DOM?
has comment: http://stackoverflow.com/comment/44644154
has body: I am developing a Spree (Ruby on Rails) extension that adds a javascript tag to the page. This javascript has no visual or apparant effects for the user; it is a piwik tracking script. I want to write some integration tests for this. What is a good way to test javascript that does not change the DOM? Problem: No visual or other DOM changes. Normally, javascript will be tested in the page with code like expect(page).to have_selector 'select.ajax-filled option#detroid' for when a piece of javascript is expected to add a "detroid" option to a select. Yet, in this case, the JS does not change the DOM visually. A possible factor to ease this testing, is the fact the setup of the tracking-code is simple and predictable. My test does not need to see if running the externally included javascript piwik.js is actually ran correctly. My integration tests are good enough when they test that correct _paq.push(['someparam'], 'somevalue') is called. I am not interested in covering all possible ways that some setSiteId can be made available; merely that my code has called or calls _paq.push() with the proper params. But, if testing the effect of the call is easier, I'd gladly pick that. Example: In this example, I would be interested in: setSiteID set correctly. setTrackerUrl has the correct url and protocol. trackPageView defined. etc. Sidenote: not looking for unit-tests, but integration tests. The unit-test side is pretty well covered. This is merely about expecting the correct _paq.push() calls when my extension gets certain configuration options, is integrated in a certain way or used in certain scenarios. So, what testing strategy to take? What should I test against? Regular Expressions? Parsing the JS with a JS parser? Running the JS with a runtime? Some mocking or stubbing trick that I overlooked?
upvote count: 1
tagged with: integration-testing
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44643989
tagged with: javascript
type: UnansweredQuestion
answer count: 0
downvote count: 0

http://stackoverflow.com/a/28166505
has body: I suggest you to use jquery validator plugin for all frontend based validation http://jqueryvalidation.org/
score: -1
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28164373

http://stackoverflow.com/comment/44776165
type: Comment
has text: Sorry, newbie here. my bad. I was putting it right above the plugins:[ syntax from above.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28204372

http://stackoverflow.com/q/28277312
has title: Chrome Extensions - Saving Settings
has comment: http://stackoverflow.com/comment/44909737
has comment: http://stackoverflow.com/comment/44908951
score: 16
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28289785
type: Question
has comment: http://stackoverflow.com/comment/100924710
tagged with: javascript
tagged with: google-chrome-extension
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44908999
accepted answer: http://stackoverflow.com/a/28289785
favorite count: 0
has comment: http://stackoverflow.com/comment/44909536
has comment: http://stackoverflow.com/comment/44910194
linked to: http://stackoverflow.com/q/14531102
has body: I'm building my first Chrome extension. It's a very simple thing I'm trying to do at this point so I can try and gain an understanding of how it works and build off of that. Anyway what I am trying to do right now is I have a extension button that opens up a page with a TEXTAREA. I want the user to be able to enter text into this textarea box and save this to be called later (this setting also needs to be available to be called again the next time Chrome is opened, whatever they enter into this textbox I want to keep that value permanently unless they save over it). My TEXTAREA id=test1 Here's my JavaScript function saveSettings() { var storage = chrome.storage.sync; // Get signature value from text box var txtValue = test1.value; // Save using Chrome storage API storage.set(txtValue, function() { console.log("Saved"); }); } function insertText(text) { document.getElementById("test1").value= text; } For testing purposes I have a addEventListener for inserting a set text value to make sure the insert function works. I have a button for a hard coded set of text, then another button to try to insert the "saved" text which should be the var txtValue. The insert function that WORKS document.addEventListener('DOMContentLoaded', function() { var temp = document.getElementById('template'); temp.addEventListener('click', function() { insertText('Hard Coded Text'); message('Template Inserted'); }); }); The insert function that does NOT work that is trying to insert the value typed into and saved into the TEXTAREA field. document.addEventListener('DOMContentLoaded', function() { var link = document.getElementById('insert'); link.addEventListener('click', function() { insertText(txtValue); message('Saved Text Inserted'); }); }); I'm not sure what I'm doing wrong. I've looked at a bunch of different examples and most of them are similar to what I've done using storage.sync but I can't seem to get it to work. Any thoughts would be greatly appreciated. Thank you!
has comment: http://stackoverflow.com/comment/44909504
upvote count: 16
type: AnsweredQuestion

http://stackoverflow.com/q/28249695
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28249753
has body: I am trying to code a little game and therefore trying to move an object in a certain area. To get somewhat of a border I am trying to add up positions. However I will simplify this for you and this is what does not work: (in JS) parseInt( $('#w'+w ).css( 'top' ) + $('#w'+w ).css( 'height' ) ) this should just add up the top position with the height of this element. When I print this out it will tell me it is 100. But when I print height and top without adding them up its height = 500 and top = 100 ( This is how it is in the css code ). If i swap height and top and add this up the result is 500, so the first element. I got similar calculations, which fit. Any suggestions what went wrong in my code?
tagged with: addition
accepted answer: http://stackoverflow.com/a/28249741
type: Question
has title: add up positions from css in javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/28249741
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28249753
tagged with: css

http://stackoverflow.com/q/28218395
has answer: http://stackoverflow.com/a/28218748
type: Question
has comment: http://stackoverflow.com/comment/44800162
has answer: http://stackoverflow.com/a/28218769
answer count: 2
has comment: http://stackoverflow.com/comment/44800264
upvote count: 1
has comment: http://stackoverflow.com/comment/44800677
tagged with: javascript
has comment: http://stackoverflow.com/comment/44800452
tagged with: defineproperty
favorite count: 0
has comment: http://stackoverflow.com/comment/44800686
has comment: http://stackoverflow.com/comment/44800472
possible better answer: http://stackoverflow.com/a/28218769
has body: How do I remove the property p from the object's prototype? var Test = function() {}; Object.defineProperty(Test.prototype, 'p', { get: function () { return 5; } }); Object.defineProperty(Test.prototype, 'p', { get: function () { return 10; } }); This produces TypeError: Cannot redefine property: p. Is there a way I can remove the property and re-add it? Or is it possible to set the configurable attribute after the property was created?
downvote count: 0
has comment: http://stackoverflow.com/comment/44800699
accepted answer: http://stackoverflow.com/a/28218748
has comment: http://stackoverflow.com/comment/44800209
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44800564
has title: How do I redefine a property from a prototype?
score: 1

http://stackoverflow.com/q/28177794
answer count: 2
tagged with: javascript
has body: I am developing a node.js application. I am using the webworker-threads package to spin off some CPU blocking tasks. However, uncaught errors in my thread code do not get sent to the console. Instead, the thread just fails silently. The simplest case illustrates this: var Threads = require('webworker-threads'); this.testThread = new Threads.Worker( function() { console.log("This is the test thread. The next line should throw an error."); undefinedFunction(); } ); Since my actual application is calling an separate js file as the thread, I am also not seeing any syntax errors reported. Is there some undocumented error event I should be catching? Is there perhaps something wrong with my environment?
upvote count: 3
tagged with: web-worker
has title: How do I get errors to the console from node-webworker-threads?
possible better answer: http://stackoverflow.com/a/61852001
has answer: http://stackoverflow.com/a/61852001
tagged with: node.js
favorite count: 0
downvote count: 0
accepted answer: http://stackoverflow.com/a/29966748
tagged with: multithreading
tagged with: error-handling
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29966748
has comment: http://stackoverflow.com/comment/45179098
type: Question

http://stackoverflow.com/q/28206012
type: UnansweredQuestion
has title: talking to PouchDB Basics
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28207097
tagged with: pouchdb
score: 0
answer count: 1
has body: maybe it's an absolutely stupid question, but I have a Pouchdb Database that looks like this: var fragDB = { _id: new Date().toISOString(), question: quest, right: right, wrong1: wrong1, wrong2: wrong2, wrong3: wrong3, source1: source1, source2: source2, tags: tagarr } db.put(fragDB); Now I want to retrieve the tags from the last document as an Array. I tried something like this, but this obviously didn't work. var alltags = function(){ db.allDocs({include_docs: true, limit: 1, descending: true}, function(err, response){ if (err) { console.log(err); console.log("loading Standard Tags"); return ["..."]; } if (response){ console.log(response.tags); return response.tags; } }); }; What am I missing?

http://stackoverflow.com/comment/44643324
comment on: http://stackoverflow.com/q/28135674
score: 1
has text: You've loaded jQuery twice !
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28239370
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28240519
favorite count: 0
possible better answer: http://stackoverflow.com/a/28240519
has answer: http://stackoverflow.com/a/28239398
type: AnsweredQuestion
has title: Javascript attach an onclick event to all link with href variable
tagged with: onclick
score: 1
upvote count: 1
has body: I am attempting to add an onclick function to all my links with the class of "external-link". So I've successfully done it and did a test where anytime I click on one it alerts "it works" but how do return the href of that link into the function? I'd like to throw in that variable where it says "http://www.example.com". I tried elements[i].href but it says it's undefined. var elements = document.getElementsByClassName('external-link'); for(var i = 0, len = elements.length; i &lt; len; i++) { elements[i].onclick = function () { trackOutboundLink(‘http://www.example.com’); return false; } }
type: Question
accepted answer: http://stackoverflow.com/a/28239398
downvote count: 0

http://stackoverflow.com/q/28135404
has comment: http://stackoverflow.com/comment/44819508
has answer: http://stackoverflow.com/a/28311680
score: 0
has comment: http://stackoverflow.com/comment/44832006
has comment: http://stackoverflow.com/comment/44642929
has comment: http://stackoverflow.com/comment/44831952
has comment: http://stackoverflow.com/comment/44659858
answer count: 1
has comment: http://stackoverflow.com/comment/44708951
has body: My plugin almost works fine in Safari for Mac, but sometimes it is blocked by Safari(see at Safari - Preferences - Security - Manage website setttings). so my first question is how can I let my plugin be a "Allow Always" plugin in Safari without user's operation? And when plugin is blocked, Safari will display a placeholder instead of the Internet plugin content. look here so the second question is when Safari block my plugin(maybe user choosed), how to know it by JS?
tagged with: plugins
has comment: http://stackoverflow.com/comment/44906218
tagged with: safari
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44668145
has comment: http://stackoverflow.com/comment/44745280
has comment: http://stackoverflow.com/comment/44709213
type: Question
accepted answer: http://stackoverflow.com/a/28311680
has comment: http://stackoverflow.com/comment/44745670
has title: why plugin blocked by Safari?
tagged with: javascript
tagged with: block

http://stackoverflow.com/q/28177629
has answer: http://stackoverflow.com/a/28178177
has body: I have this string: "var config={general:{instance:'livedemo'}};" And I want to create an object based on that string, the thing is that using the normal JS eval function everything works great, but using $eval I get "ReferenceError: config is not defined" and angular only let me use $eval on the controller. someone with an idea of how I can do it? Thanks
tagged with: angularjs
linked to: http://stackoverflow.com/q/15671471
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28178326
type: Question
tagged with: javascript
has title: How to use $eval to pass string to obj - Angular
possible better answer: http://stackoverflow.com/a/28178177
score: 0
accepted answer: http://stackoverflow.com/a/28178326
answer count: 2

http://stackoverflow.com/comment/44803642
has text: Where do you set the variables `est`, `prodcd`, `startDate`, etc.?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28220098
score: 0

http://stackoverflow.com/comment/44890660
type: QuestionComment
score: 1
has text: Can you post the css for these elements too
comment on: http://stackoverflow.com/q/28267256
type: Comment

http://stackoverflow.com/q/28276564
linked to: http://stackoverflow.com/q/14373625
has body: I want to create a button on my website that would close the current browser tab. Searching on stack overflow I got a solution but it isn't working. This JavaScript code is: function close_window(){ if (confirm("Are you sure to close window?")) { close(); } } HTML code is: &lt;button onclick="close_window();"&gt; Close! &lt;/button&gt; So, How can I do this using jQuery or JavaScript for all browser?
has title: Javascript - how to close current browser tab clicking on a button?
score: 5
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 5
duplicate of: http://stackoverflow.com/q/14373625
has answer: http://stackoverflow.com/a/28276740
downvote count: 0
tagged with: onclick
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/28201525
type: UnansweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
has body: I have two inputs (checkboxes) inside my popover. The problem is, that I can't get the data out of them because the popovers apperas in the DOM when I click a button, at the time I click it again it gets removed. I guess the problem is that javascript already initialized from the beginning and so my script doesn't recognize the inputs. So you can say, in general I want to achieve two inputs in a popover, which gets displayed on button click. The data of the inputs(checked or not checked) should be processed in either AngularJS or jQuery. I'm using bootstrap, jQuery and AngularJS for my project. I would appreciate every answer.
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Bootstrap Popover shouldn't get destroyed every time
has answer: http://stackoverflow.com/a/28204245
tagged with: angularjs
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/61271539
type: Comment
has text: best solution here
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/32574746

http://stackoverflow.com/comment/44849699
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28244473
has text: If the position property values are both the same, use a higher z-index for. It's not, apply position property value of absolute with a higher z-index.

http://stackoverflow.com/comment/44867842
type: AnswerComment
comment on: http://stackoverflow.com/a/28251952
type: Comment
has text: I tried...tried....and nothing... :/ Actually it look like: http://licznikii.cba.pl/dopostu/index2.php . Everything works good until I refresh page. I don't know what i'm doing....my JS skills....
score: 0

http://stackoverflow.com/comment/44851540
score: 0
comment on: http://stackoverflow.com/q/28245199
type: Comment
type: QuestionComment
has text: Can you show some HTML so we can see what you're trying to loop through?

http://stackoverflow.com/comment/54833588
score: 0
comment on: http://stackoverflow.com/q/28228178
type: QuestionComment
type: Comment
has text: I'm having exactly the same problem and I still have no idea how to solve it. Anybody had more chance ?

http://stackoverflow.com/comment/44855554
type: Comment
comment on: http://stackoverflow.com/a/28247404
has text: Put your code into a jsfiddle. I cant fix it better from that.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28178558
has comment: http://stackoverflow.com/comment/44733984
tagged with: wordpress
type: Question
tagged with: flash
has body: I am developing a Wordpress site for a manufacturing company. The company would like to have a Video Spokesperson on some of the pages. Specifically we are testing it here: http://beautifulimage.net/test-magazine The scripts that they provide are here: http://tweople.com/client/embed/1401121859b Unfortunately, the video will only play once (with one iteration of the script) or not at all. For the iteration that will play it, you can refresh the cookies and it will play again. 1) I started by following the documentation that was provided. I expressly followed every direction implicitly without consistent success (it worked occasionally on http) ... I verified that the script/video works on 3 other sites (not secured sites), which further confirms that their product does work, but that there is a conflict. This conflict maybe with scripts that we are using on our site or with cross domain calls, but it is definitely not working the way that it should be. 2) Upon realizing that the script doesn't work on our site. I went through extensive troubleshooting. Here are major trouble shooting errors I went through: creating a cross domain xml file (recommended by adobe) for registering flash videos that can be cross domain using 3rd partyflash player trying the video as an html5 video alone (no transparency. the background was white) going through the initiation/video player script to see if I need to hard code links support withtwepeople email deactivating all WP plugins that could be causing conflicts and testing all previous debugging measures I asked mediatemple (hosting company) if there was anything in the hosting account that could be causing the error. note: The javascript console was calling out cross domain errors when we were occasionally getting it to work on http. When I forced https the video spokesperson stopped working completely. I currently have multiple scripts inside of the file (lines 406, one commented out). The company has been attempting to support th…
tagged with: javascript
tagged with: html5-video
score: 0
has comment: http://stackoverflow.com/comment/44730705
has comment: http://stackoverflow.com/comment/44734641
tagged with: cross-domain
answer count: 0
has title: Flash Video Spokesperson in Wordpress => Tweople
type: UnansweredQuestion

http://stackoverflow.com/q/28225571
type: Question
has answer: http://stackoverflow.com/a/28225622
has comment: http://stackoverflow.com/comment/44814406
upvote count: 2
answer count: 2
has title: What is the difference between "defined" and defined in javascript?
has body: When writing this in javascript, I have seen it written in two different ways: if (typeof x === "undefined") { // execute code here } if (typeof x === undefined) { // execute code here } my question here is: what is the difference between "undefined" and undefined. One is enclosed in quotes and the other is not. Can anybody clarify this for me? Thanks!
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28225621
favorite count: 0
possible better answer: http://stackoverflow.com/a/28225622
has answer: http://stackoverflow.com/a/28225621
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44814401

http://stackoverflow.com/comment/44819641
type: Comment
comment on: http://stackoverflow.com/a/28228108
score: 1
type: AnswerComment
has text: Yes, don't pay much attention to details. Socket connection lasts long and is cheaper than normal communication. So, wouldn't cause browser crashes as you think.

http://stackoverflow.com/comment/44690325
type: Comment
has text: @Johnny That extra comma (oddly, only in the final object) is the invalid portion of the JSON.
comment on: http://stackoverflow.com/q/28159283
score: 0
type: QuestionComment

http://stackoverflow.com/q/28157601
has answer: http://stackoverflow.com/a/28809768
has title: Node.js Deployd 404 error on dpd.get & 400 error on dpd.put when using id parameter
has answer: http://stackoverflow.com/a/28157893
tagged with: http-status-code-404
has body: Basically what the title says - I've been getting a 404 Not Found on all ids that I enter for "id": dpd.items.get("id", function(results, error) { console.log(results); }); And a 400 Bad Request on any value of "id": dpd.items.put("id",{category:value},function(results, error){ console.log("Record updated"); }); All the id values exist in the Deployd dashboard, and I am able to make get requests using any category parameters OTHER than ID. Feels like I've tried everything at this point, please help!
tagged with: node.js
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28157893
accepted answer: http://stackoverflow.com/a/28809768
tagged with: deployd
type: Question
answer count: 2
tagged with: http-status-code-400
tagged with: javascript
score: 0

http://stackoverflow.com/a/28208894
upvote count: 1
answers question: http://stackoverflow.com/q/28188367
accepted answer of: http://stackoverflow.com/q/28188367
has body: The problem you are getting is &lt;!-- ngRepeat: t in type --&gt; this is because your type didn't contains any value, when it is inside typeb directive Your directive shouldn't be use scope.variable on view. Scope variable will be directly accessible by their name like {{type}} or &lt;typeb type='type'&gt;&lt;/typeb&gt; Change your link code to below. Directive link link: function(scope, element, attrs) { if (angular.isArray(scope.type)) { element.append("&lt;typeb type='type'&gt;&lt;/typeb&gt;") } else if (angular.isObject(scope.type)) { element.append("OBJECT") } else { element.append("&lt;div&gt;{{type}}&lt;/div&gt;") } $compile(element.contents())(scope) } Thanks.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/28274223
has comment: http://stackoverflow.com/comment/44904438
has body: You shouldn't call files directly, Yii doesn't work this way. It is MVC framework with controllers and actions and it uses routes, also for AJAX request. So you should add an action to AjaxController and call createUrl to get it's URL. PHP class AjaxController extends CController { public funcion actionDoThing() { // Get request object $request = Yii::app()-&gt;request; // Check if request is acceptable if ($request-&gt;isPost &amp;&amp; $request-&gt;isAjaxRequest) { echo CJSON::encode(array('hello'=&gt;'world')); } // else // { // throw new CHttpException(403); // } } } JS $(document).on('click','div.lessonDiv', function() { $.ajax({ type: "POST", url: &lt;?php echo $this-&gt;createUrl('ajax/doThing'); ?&gt;, success: function(data, textStatus, jqXHR) { console.log(data); } }); }); I'd recommend to read Yii guide more closely. It is also available in Russian
has comment: http://stackoverflow.com/comment/44904857
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44904556
has comment: http://stackoverflow.com/comment/44905430
score: 2
answers question: http://stackoverflow.com/q/28273952
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28273952

http://stackoverflow.com/comment/44677649
has text: Ok, I found a function in [this](http://stackoverflow.com/questions/2525368/loop-through-text-nodes-inside-a-div) question and I tried using it in [Fiddle](http://jsfiddle.net/5k0ge28c/9/). Variables are correct, but it seems never find a textnode, so it never changes the content. Can you help me?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28148432

http://stackoverflow.com/a/28195238
has comment: http://stackoverflow.com/comment/44759480
answers question: http://stackoverflow.com/q/28194243
score: 0
has comment: http://stackoverflow.com/comment/44759247
has body: Your question is legit but code a little bit abstract. I'm going to give it a go anyway. You say you're having trouble returning values from the exportAll.return method. However, I'm not seeing where you ever actually return the values. exportAll.return = function(start, partner, array){ console.log('start number: ' + start); console.log('question: ' + start + ' + '+ partner); console.log('correct answer: ' + (start + partner).toString()); console.log(array); //something like this this.start = start; this.partner = partner; this.array = array; return this; } Hopefully this gets you on the right track. However, if you can clarify a little further, I might can help some more.
type: Answer
has comment: http://stackoverflow.com/comment/44759536

http://stackoverflow.com/q/28275075
tagged with: python
has title: Data processing JSONP on Python 2.7?
score: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: jsonp
tagged with: javascript
tagged with: python-2.7
answer count: 1
has comment: http://stackoverflow.com/comment/44904965
has comment: http://stackoverflow.com/comment/44906624
type: UnansweredQuestion
has body: I am getting this data from provider, for example, http://domain.com/abc.js I = { t: '2015/02/02 16:01', c: '207.05', v: '484.74', n: '324.37' }; How exactly should I extract "v" value on python 2.7? I heard this is JSONP and not a real JSON, which seems not a lot of people have experience on this.
has answer: http://stackoverflow.com/a/28276699

http://stackoverflow.com/comment/44769377
has text: I need to fetch files based on parameters and assign content to div element either by row click of table or by submitting input box data.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28196742
type: Comment

http://stackoverflow.com/q/28149141
accepted answer: http://stackoverflow.com/a/28149164
has title: Refused to display in a frame , because it set 'X-Frame-Options' to 'SAMEORIGIN'
favorite count: 0
type: Question
tagged with: iframe
answer count: 1
has body: I am developing a website that include a simple iframe I have this error message in the console: Refused to display 'http://fr.allsaints.com/women/shop-accessories/allsaints-rally-keyfob/?colour=42&category=700' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. How can I do to display it?
downvote count: 3
upvote count: 4
has answer: http://stackoverflow.com/a/28149164
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1

http://stackoverflow.com/comment/44677672
type: AnswerComment
comment on: http://stackoverflow.com/a/28152264
score: 0
type: Comment
has text: The point of this was to help people who had the same question as me, because I had this question and seached for the answer and couldn't find any so I put this here for people on the same situation... Just trying to help ;)

http://stackoverflow.com/q/28179871
has comment: http://stackoverflow.com/comment/44734942
tagged with: properties
has body: Can an object's property be assigned with a statement? Consider the following bit of code: var obj = { canvas: document.getElementById('mainCanvas').getContext('2d'); } The way I understand that this doesn't work is because you're not actually 'assigning' the statement to the canvas property of obj. Instead I've done something like this: var obj = { initCanvas: function() { this.canvas = document.getElementById('mainCanvas').getContext('2d'); } } This works, but it seems sloppy to me. Is there a better way to define this or is using this method the preferred way to implement what I'm talking about?
has comment: http://stackoverflow.com/comment/44735562
upvote count: 1
has comment: http://stackoverflow.com/comment/44728885
tagged with: object
has title: How to assign a statement to an object property
has comment: http://stackoverflow.com/comment/44728865
has comment: http://stackoverflow.com/comment/44729880
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44729605
has comment: http://stackoverflow.com/comment/44728857
has comment: http://stackoverflow.com/comment/44728844
has comment: http://stackoverflow.com/comment/44729723
has comment: http://stackoverflow.com/comment/44729088
has comment: http://stackoverflow.com/comment/44729304
answer count: 0
downvote count: 0
score: 1
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
type: Question

http://stackoverflow.com/comment/44753239
type: Comment
type: QuestionComment
has text: Why exactly did my question get downvoted? I will take any suggestions on how else to delete a sheet and replace it with a template...
score: 0
comment on: http://stackoverflow.com/q/28185218

http://stackoverflow.com/q/28167051
has comment: http://stackoverflow.com/comment/44704355
tagged with: php
type: UnansweredQuestion
has title: javascript confirm dialog box before X pressed
score: -4
upvote count: 1
has comment: http://stackoverflow.com/comment/44704339
has body: I need some javascript to ask the user if they want to leave the page. The code I have works whenever the page closes (not only when then user presses X). Any ideas? This is what I have: $(window).bind('beforeunload', function(e) { if (confirm) { return "Are you sure?"; } });
has comment: http://stackoverflow.com/comment/44704989
has answer: http://stackoverflow.com/a/28167174
downvote count: 5
has comment: http://stackoverflow.com/comment/44704464
type: Question
has comment: http://stackoverflow.com/comment/44704556
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44704322

http://stackoverflow.com/comment/44710930
comment on: http://stackoverflow.com/a/28170524
score: 0
type: AnswerComment
type: Comment
has text: I beat **them** by 2 minutes ;) (as of writing this, I posted 16 minutes _ago_, that's earlier than their 14 minutes _ago_). I mean thanks for the upvote, but if we're gonna get technical :P

http://stackoverflow.com/a/28192639
score: -1
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28192490
has body: First of all you can not use $_GET["view"] directly into javascript. Take one variable like below : &lt;script &gt; var view = &lt;?php echo $_GET["view"]; ?&gt;; ........... if(view =="home-page") { document.getElementById("result").innerHTML=xmlhttp.responseText; xmlhttp.open("GET","home-page-new.php?q="+str,true); xmlhttp.send(); } if(view =="product-page") { document.getElementById("result").innerHTML=xmlhttp.responseText; xmlhttp.open("GET","product-page-new.php?q="+str,true); xmlhttp.send(); } ................ &lt;/script&gt;

http://stackoverflow.com/comment/44830130
type: Comment
comment on: http://stackoverflow.com/a/28233379
has text: Perhaps I didn't understand your problem correctly. You are running javascript in URL A, and opening a new window using that javascript (URL B). When URL B loaded, you want to scroll the window which holds URL B, to a specific point? Am I right?
type: AnswerComment
score: 0

http://stackoverflow.com/q/28158021
has answer: http://stackoverflow.com/a/28158131
has answer: http://stackoverflow.com/a/28158125
has title: Clicking textarea hides label value
has answer: http://stackoverflow.com/a/28158263
accepted answer: http://stackoverflow.com/a/28158081
type: Question
has comment: http://stackoverflow.com/comment/44687545
tagged with: javascript
answer count: 6
has body: Is there a way to delete the label when I click into the textarea? http://jsfiddle.net/1smvym84/4/ HTML: Place this inside the textarea JQUERY: $(document).ready(function(){ $('.textarea').text($('.gfield_label').text()); $('.gfield_label').remove(); }); Many thanks for any help :-)
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/28158107
has answer: http://stackoverflow.com/a/28158081
has comment: http://stackoverflow.com/comment/44687399
has answer: http://stackoverflow.com/a/28158107
has answer: http://stackoverflow.com/a/28158181
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/77932733
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44687426

http://stackoverflow.com/comment/44904066
has text: Thank you for your replay. That was exactly what I needed. So many thanks for your attention.
comment on: http://stackoverflow.com/a/28274000
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28278953
has answer: http://stackoverflow.com/a/28279447
favorite count: 0
type: Question
tagged with: handlebars.js
has title: Accessing parent scope from partial in handlebars.js
tagged with: templates
upvote count: 2
has comment: http://stackoverflow.com/comment/44950879
accepted answer: http://stackoverflow.com/a/28279447
has comment: http://stackoverflow.com/comment/44912815
answer count: 1
tagged with: javascript
has body: How to access #each parent scope from partial? Main template: (out of each = {{index}})&lt;br&gt; {{#each someItem}} (in each, but not on partial = {{../index}}) {{&gt;part}} {{/each}} Partial: &lt;div class="part"&gt; (in partial: {{itemName}} - {{../index}}) &lt;/div&gt; Here is the Fiddle with problem: http://jsfiddle.net/0o8jpxjh/
type: AnsweredQuestion
score: 2
downvote count: 0

http://stackoverflow.com/comment/44781768
comment on: http://stackoverflow.com/q/28208378
type: Comment
type: QuestionComment
score: 0
has text: @meena have you tried `$('.marks').each(function(i, item) { .... });` Where `item` hold all input fields.

http://stackoverflow.com/comment/44649627
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28138918
has text: theres plenty of examples out there.
score: 0

http://stackoverflow.com/q/28275044
favorite count: 0
type: UnansweredQuestion
tagged with: google-app-engine
tagged with: xmlhttprequest
answer count: 0
has comment: http://stackoverflow.com/comment/45241549
score: 1
tagged with: java
tagged with: authentication
upvote count: 1
has title: google app engine java basic authentication
has body: I have started to write a webApp in Eclipse where ECMAScript6 on the client (testing mostly on chrome on Win7) communicates with the server side written in Java7 on Jetty+GAEplugin via xmlHttpRequest (1 get request, user edits data, 1 post requests ). if it gets more I will move to webSockets). The client code does not know anything about logins and provides neither user name nor password because as I understand, the browser and the user handle that. On the server side I response with 401 if basic authentication is missing. But when testing, the browser does not ask the user for any password and does not send a second request (FF the same effect). No errors. Chrome development console claims that my response.addHeader("WWW-Authenticate","Basic realm=\"bus driver\""); did not reach it. A subset of my targeted user baser does not have a google account nor FB nor twitter. So OpenId nor OAuth are of no use for that subset. OAuth doc says: " The user signs in using her Google account, .." . Any way I try to search, directs me to ways to store user data, but I have problems with the communication between browser and servlet. I have read that I should edit web.xml, but I cannot see how to plug my home-built authentication into that. Web.xml would be okay for me because there will be about 3 pages sharing the same (*3roles=9pages). My software should be up to date. Oracle claims that I should stop using Java 7, but I cannot get local GAE to run on Java 8 ... Just testing on FF and looking for stupid errors I may have made last night. FF claims: InvalidStateError: An aatempt was made to use an object that is not, or is no longer, usable. Hmm seems that there is at least something wrong with my XMLhttpRequest (it worked in chrome at least without authentication). I could test GET with authentication but without ECMAscript... Still my main question remains, where is the example with old school authentication on the new kid, the cloud? Logcat is empty. I have seen the logs gett…
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45127812
tagged with: javascript
has comment: http://stackoverflow.com/comment/44949373

http://stackoverflow.com/comment/44653509
type: QuestionComment
comment on: http://stackoverflow.com/q/28140797
score: 0
has text: How exactly do you animate the `display` style ?
type: Comment

http://stackoverflow.com/comment/44908981
type: QuestionComment
type: Comment
has text: Where is `select` and `option`?
comment on: http://stackoverflow.com/q/28277347
score: 0

http://stackoverflow.com/a/28204842
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/44775608
has body: You could, in the HTML 5 doctype, simply associate those form-elements with a specific form, using the form attribute: &lt;td&gt;&lt;input form="formElementID" type="checkbox" name="{{ md5_name }}" class="box"/&gt;&lt;/td&gt; This attribute: Indicates the form that is the owner of the element1 References: MDN: HTML Attribute reference. Bibliography: HTML forms reference.
score: 3
answers question: http://stackoverflow.com/q/28204600
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28204600

http://stackoverflow.com/q/28144648
has title: ng-required not working in directive
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28147043
has comment: http://stackoverflow.com/comment/44661357
has comment: http://stackoverflow.com/comment/44661455
score: 2
has body: I have created a directive for a dual list box in forms (similar to Bootstrap Dual Listbox). The directive is made up of 2 list boxes; values (left) and options (right). I would like to make the directive work with angular form validation. If the values are empty then form.$invalid is true. I've tried doing this by passing a custom required attribute to the directive. I am having trouble applying the "required" attribute to the first select box within the directive. Example in jsfiddle Within the directive template the following expression is not working at all: ng-required="dlRequired == true" In the example the save button is enabled when with only the text box being valid. Where am I going wrong?
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44661303
has comment: http://stackoverflow.com/comment/44661195
answer count: 1
accepted answer: http://stackoverflow.com/a/28147043
favorite count: 0
tagged with: angularjs
upvote count: 2
linked to: http://stackoverflow.com/q/6048710
has comment: http://stackoverflow.com/comment/44661377
tagged with: angularjs-directive

http://stackoverflow.com/comment/44896985
type: QuestionComment
comment on: http://stackoverflow.com/q/28270710
score: 0
has text: This is the key access thing i have to set in the link ` ` right ? Anyway like i said i'm able to display a simple map without geocode
type: Comment

http://stackoverflow.com/q/28201351
tagged with: google-chrome
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44768923
has comment: http://stackoverflow.com/comment/44768980
score: 1
has comment: http://stackoverflow.com/comment/44769130
tagged with: google-chrome-devtools
type: Question
has comment: http://stackoverflow.com/comment/44770279
has comment: http://stackoverflow.com/comment/44769846
accepted answer: http://stackoverflow.com/a/28202196
has comment: http://stackoverflow.com/comment/44769373
has comment: http://stackoverflow.com/comment/44769786
has comment: http://stackoverflow.com/comment/44789887
has body: When using the Mouse click option under the sources of the Event Listener Breakpoints option on the right, the debugger skips the following function code: &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function test() { return true; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" onclick="return test();" value="test"&gt; &lt;/body&gt; &lt;/html&gt; The problem is not that it doesn't run. It's that I can't debug it until I push the input button twice to be able to step into (F11) the function. Otherwise I'm not able to debug what's inside the code. It's pretty frustrating because it happens every time I refresh the page. Is this a bug or is it meant to be like this? I'm on: Chrome Ubuntu Version 40.0.2214.93 (64-bit) P.S. For those that asked/will ask, I'm working on maintaining a legacy application and unfortunately, it has many inline functions. There's no point in taking the time of putting all these into files when my company is building new software to replace it. Since resources are spent building out the new code, I'll have to do minor debugging of the legacy application this way.
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44770328
tagged with: inline-code
tagged with: javascript
has comment: http://stackoverflow.com/comment/44769772
has title: Chrome debugger skips inline JavaScript code on first click
has comment: http://stackoverflow.com/comment/44768992
has comment: http://stackoverflow.com/comment/44769897
favorite count: 0
has comment: http://stackoverflow.com/comment/44769930
has answer: http://stackoverflow.com/a/28202196
upvote count: 1

http://stackoverflow.com/q/28129602
tagged with: amplifyjs
answer count: 1
tagged with: meteor
has body: I've created a simple site where visitors can vote on a particular subject. It consists of a single question and three choices: Yes No I’m Undecided Submit and view results I'm using the Session Amplify package to store form values in localStorage as well as the DB, which is working perfectly. var vote = $('[name="vote"]:checked').val(); Meteor.call("addVote", vote, function(error, voteId) { SessionAmplify.set('vote', vote); }); After the visitor has logged their vote they're shown the global results of the vote as a bar cart. They can only see the results after they vote, though. What I need to do is remember the user's vote when they visit the site again so they can bypass the vote and go straight to the results, all without forcing them to create an account or log in. I'm already storing their response in localStorage that are accessible by simply running SessionAmplify.get('vote'). How can I use these stored values to pre-populate the form and show them the results?
has title: Remembering user's form input without logging in
tagged with: local-storage
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28129669
type: Question
accepted answer: http://stackoverflow.com/a/28129669
tagged with: javascript
score: 0

http://stackoverflow.com/q/28124442
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44622562
has comment: http://stackoverflow.com/comment/44622473
has comment: http://stackoverflow.com/comment/44622367
type: Question
has comment: http://stackoverflow.com/comment/44622502
has comment: http://stackoverflow.com/comment/44622360
has comment: http://stackoverflow.com/comment/44622499
has comment: http://stackoverflow.com/comment/44622488
has answer: http://stackoverflow.com/a/28125064
score: 0
answer count: 2
has title: AngularJS: Events broadcasted/emitted on rootScope occur multiple times
has comment: http://stackoverflow.com/comment/44622661
linked to: http://stackoverflow.com/q/19553598
tagged with: javascript
has answer: http://stackoverflow.com/a/29568153
has body: My Angular application is fairly big already and I am using the rootScope to communicate between directives and controllers. Directive 1 scope.$root.$broadcast('some:event'); Controller 1 $rootScope.$on('some:event', function() { I get called multiple times :( }); $scope.$on('some:event', function() { I am not getting called at all :( }); For some reason, my listeners get called multiple times (2x to be exact). I have the feeling that somewhere, I built in a second rootScope or something. I am currently debugging my app, but it is like finding the needle in the haystack. This thread tries to solve a similar problem: AngularJs broadcast repeating execution too many times. It suggests to use $scope only which does not work for me in my particular case. The broadcasted events never reach the listeners. My question would be if someone has an idea why this could happen? Maybe I am doing a silly mistake I am not aware of. Catching an event twice I only sent once does sound wrong. Thanks in advance

http://stackoverflow.com/q/28251699
has comment: http://stackoverflow.com/comment/44864535
has comment: http://stackoverflow.com/comment/44882151
answer count: 0
has body: Help. I can't send email using xampp. I don't know what to do. I've searched all over the net but I can't figure out what's wrong with my code. It seems like they are the same but mine doesn't work. Please take a look at my codes, maybe I just miss something or not based on my understanding. I'm new on sending mails using php. It's my first time to do this. Any help will be much appreciated. Thanks in advance! Mailhandler.php <?php $owner_email = $_POST["owner_email"]; $headers = 'From:' . $_POST["email"]; $subject = 'A message from your site visitor ' . $_POST["name"]; $messageBody = ""; if($_POST['name']!='nope'){ $messageBody .= ' Visitor: ' . $_POST["name"] . ' ' . "\n"; $messageBody .= ' ' . "\n"; } if($_POST['email']!='nope'){ $messageBody .= ' Email Address: ' . $_POST['email'] . ' ' . "\n"; $messageBody .= ' ' . "\n"; }else{ $headers = ''; } if($_POST['state']!='nope'){ $messageBody .= ' State: ' . $_POST['state'] . ' ' . "\n"; $messageBody .= ' ' . "\n"; } if($_POST['phone']!='nope'){ $messageBody .= ' Phone Number: ' . $_POST['phone'] . ' ' . "\n"; $messageBody .= ' ' . "\n"; } if($_POST['fax']!='nope'){ $messageBody .= ' Fax Number: ' . $_POST['fax'] . ' ' . "\n"; $messageBody .= ' ' . "\n"; } if($_POST['message']!='nope'){ $messageBody .= ' Message: ' . $_POST['message'] . ' ' . "\n"; } if($_POST["stripHTML"] == 'true'){ $messageBody = strip_tags($messageBody); } try{ if(!mail($owner_email, $subject, $messageBody, $headers)){ throw new Exception('mail failed'); }else{ echo 'mail sent'; } }catch(Exception $e){ echo $e->getMessage() ."\n"; }?> This is the forms.js: ;(function($){ $.fn.forms=function(o){ return this.each(function(){ var th=$(this) ,_=th.data('forms')||{ errorCl:'error', emptyCl:'empty', invalidCl:'invalid', notRequiredCl:'notRequired', successCl:'success', successShow:'4000', mailHandlerURL:'bat/MailHandler.php', ownerEmail:'my@email.com', stripHTML:true, smtpMailServer:'localhost', targets:'input,textarea', controls:'a[data-type=reset],a[d…
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/44862695
tagged with: javascript
tagged with: phpmailer
linked to: http://stackoverflow.com/q/24644436
score: 0
duplicate of: http://stackoverflow.com/q/24644436
tagged with: mailer
has title: Mailhandler.php need help forms.js
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/q/28191236
downvote count: 0
has comment: http://stackoverflow.com/comment/44750851
accepted answer: http://stackoverflow.com/a/35288507
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/44859303
has answer: http://stackoverflow.com/a/35288507
upvote count: 2
has title: CouchDB on windows says No 'Access-Control-Allow-Origin' header is present on the requested resource
has body: I am trying to use CouchDB as a back-end for my application. I tried to install couchDB on my windows OS machine. It works fine. When i tried to run this example after creating the db on "Projects", the console displays an error. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access. The response had HTTP status code 405. I tried to do fix it by this suggestion, how to add cors in couchDB, but i don't find [cors] section I manually created [cors] section, that too did not work. UPDATE: I am using the latest version 1.6.1
answer count: 1
has comment: http://stackoverflow.com/comment/44863931
tagged with: couchdb
favorite count: 0
has comment: http://stackoverflow.com/comment/44750824
has comment: http://stackoverflow.com/comment/44753731
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44752238
tagged with: http://stackoverflow.com/tag/html
score: 2
linked to: http://stackoverflow.com/q/20897033

http://stackoverflow.com/comment/44891484
type: Comment
has text: My mistake I failed to move the "productID" to the parent positon, it was one level up. Thanks for your help!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28257559

http://stackoverflow.com/a/28226735
answers question: http://stackoverflow.com/q/28226168
has body: Note that the $_SESSION object is stored on the server, and the JS runs on client side. So the strategy would be: Run a function that makes an AJAX call (see $.ajax() or $.get()) from the client-side, using JS (see setInterval()) On the server side, with PHP, check if $_SESSION['LoggedIn'] is present Return the outcome to the client Parse outcome with JS, and then determine whether user should be redirected As follow is a very distilled version of the above logic. For your JS, I have chosen to use jQuery for its ease in making cross-browser compatible AJAX calls: $(function() { var check = function() { // Make AJAX call var call = $.get('/path/to/php/file'); // Check returned promise call .done(function(data){ if(!data.loggedIn) window.location.href='http://www.google.com'; }); } var interval = setInterval(check, 5000); }); For your PHP: &lt;?php // Start session session_start(); // Array to return $return = []; // Check whether the session variable "LoggedIn" is present or not if(!isset($_SESSION['LoggedIn']) || (trim($_SESSION['LoggedIn']) == '')) { $return['loggedIn'] = false; } else { $return['loggedIn'] = true; } // Echo response in JSON format and close session echo json_encode($return); session_write_close(); ?&gt;
type: Answer
score: 0

http://stackoverflow.com/q/28251206
upvote count: 0
has answer: http://stackoverflow.com/a/28251643
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44862115
accepted answer: http://stackoverflow.com/a/28251643
tagged with: http://stackoverflow.com/tag/html
has title: HTML Table element using JS - Apparent Issue
answer count: 1
favorite count: 0
has body: Cheers, everybody! I'm generating an HTML table dynamically using JS, and placing it into a 'div' element in another page. It's sort of OK, a few amendments, but I get the table output, better than i would expect. Nevertheless, the problem is that my destination page where the 'div' element is placed, doesn't get updated, it stays blank like there was nothing there when in fact there should be, since i'm setting it, and otherwise where does the table come from in the page, right? Seems awkward to me. I see a table, but there's no correspondent html code for it in the page. Specially because i need to take a look in detail to fix the issues in my table layout. Now, I'm pretty sure this is a very naive question, beginner's, and if I only knew it enough, I would understand what's going on, but at the moment, it's totally impossible for me to stop to take a deeper look at this, lots of stuff. I really could use some contribution, like a fast and elucidative answer, sort of what do i do to view the table html, where is it 'hiding'? Preferentially. But as much important as it, a few 'read this' or 'read that', if you don't mind, because at this stage, You know, bump into an obstacle every two steps. Anyway,thanks in advance! I would appreciate any help!
has comment: http://stackoverflow.com/comment/44862022
type: AnsweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/44861817
type: Question

http://stackoverflow.com/q/28227771
accepted answer: http://stackoverflow.com/a/28227816
score: 2
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28239002
favorite count: 0
has body: Before you mark this as already asked, just read on! So I have been searching the web (including StackOverflow) for a way to replace all tabs in an element (more specifically an xmp element) with four spaces. The purpose of this is to show code. If you visit http://synergytechhosting.com/codeshower.html, you will see my code. The first "totally test code" has one tab before it. The second has four spaces. The four spaces look much more reasonable than the tab. I need it to make all tabs into four spaces so that if someone decides to space with tabs, it will fix it for them rather than making the user do it themselves. Another problem is that the XMP counts the first line of the code as blank and moves everything down. This can only be solved by doing this: &lt;xmp&gt;&lt;div&gt; Rather than the normal: &lt;xmp&gt; &lt;div&gt; Basically I need this script to replace tabs with 4 spaces each and remove the first "enter" in the whole thing. I am already using this to fix the tabs but it doesn't seem to work. $('xmp').html(function() { return this.innerHTML.replace(/\t/g, ' '); }); I just really need this to work and have driven my self insane trying to fix this. I'm pretty sure that this is a really dumb mistake. I expect that because I am a jQuery noob. Is there a better way than using XMP? I'm open to anything and any help at all is super appreciated. Best Regards, Emanuel
has title: How to replace tabs with four spaces jQuery
answer count: 4
type: AnsweredQuestion
tagged with: tabs
has answer: http://stackoverflow.com/a/51909752
upvote count: 2
has answer: http://stackoverflow.com/a/28227816
tagged with: spaces
type: Question
has answer: http://stackoverflow.com/a/28227991
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28227991
tagged with: replace

http://stackoverflow.com/comment/44658579
comment on: http://stackoverflow.com/q/28143460
score: 0
type: Comment
type: QuestionComment
has text: Remember to end the line in a semicolon.

http://stackoverflow.com/a/28168556
has body: You are manipulating the scope outside the scope of angular. To resolve your issue, using a $apply could be a bad option. Instead, use $resource : 'use strict'; app.controller('directoryController', ['$scope', '$resource', 'Page', function ($scope, '$resource', Page) { Page.setTitle('Employee Directory'); $resource('http://localhost:8080/SGIntranetService/api/employee/') .query() .then(function (data) { $scope.employees = data; }); }]);
type: Answer
answers question: http://stackoverflow.com/q/28168456
has comment: http://stackoverflow.com/comment/44706939
has comment: http://stackoverflow.com/comment/44706869
has comment: http://stackoverflow.com/comment/44707007
score: 0

http://stackoverflow.com/comment/44711099
score: 0
type: AnswerComment
type: Comment
has text: This is what I was looking for! Awesome! Have some +1. ;)
comment on: http://stackoverflow.com/a/28170542

http://stackoverflow.com/q/28239184
downvote count: 2
type: Question
has title: jQuery Dynamic Selector
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
has body: I have multiple select box on my page with id's drop_01, drop_02 and so on along with a common class. I am writing a jQuery that whenever a select box is changed, I get the number of selected options for that select box. Following is the jQuery but its not working. Can anyone tell me what am i doing wrong. var x = "drop_" + idnum; // (idnum contains the numeric index like 01,02 etc). var length = $(' "#" + x option:selected').length; But when i give the hard coded id like below, it works fine. var length = $('#drop_02 option:selected').length; Please help.
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28239231

http://stackoverflow.com/q/28126294
favorite count: 0
tagged with: web-standards
has comment: http://stackoverflow.com/comment/60832572
has body: I'm new to JavaScript. And I'm now using w3schools.com as my major resource of references of the language (including HTML and CSS). What I just found is that the map() method of Array object is not listed on the site, check the reference page here . After some research, I found that this method is defined in ECMAScript 5 and it's already widely supported on the modern browsers. But why it's not listed on w3schools.com. Is there a good reason not using that? Or it just shows the incompleteness of w3schools.com and I should not using that for study?
has answer: http://stackoverflow.com/a/28126399
has title: Why map() method is not listed on w3schools.com
has comment: http://stackoverflow.com/comment/44625670
has comment: http://stackoverflow.com/comment/44625788
type: AnsweredQuestion
score: -3
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28126399
has comment: http://stackoverflow.com/comment/44625694
downvote count: 4
has comment: http://stackoverflow.com/comment/44625767
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44809726
type: AnswerComment
score: 0
type: Comment
has text: Woops! Wrong fiddle. Here's the right one: [jsfiddle.net/L0ckqyfm/1/](http://jsfiddle.net/L0ckqyfm/1/). @jfabfab: do you see the problem with my code?
comment on: http://stackoverflow.com/a/28183686

http://stackoverflow.com/comment/44654668
type: QuestionComment
has text: @rjdown Seems like it is, though it doesn't help me all that much.
comment on: http://stackoverflow.com/q/28141311
score: 0
type: Comment

http://stackoverflow.com/q/28222276
has answer: http://stackoverflow.com/a/28222366
linked to: http://stackoverflow.com/q/1568091
has title: What are getters and setters for in ECMAScript 6 classes?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61379178
accepted answer: http://stackoverflow.com/a/28222388
has body: I am confused as to what the point of getters and setters are in ECMAScript 6 classes. What is the purpose? Below is an example I am referring to: class Employee { constructor(name) { this._name = name; } doWork() { return `${this._name} is working`; } get name() { return this._name.toUpperCase(); } set name(newName){ if(newName){ this._name = newName; } } }
possible better answer: http://stackoverflow.com/a/28222366
tagged with: setter
tagged with: javascript
tagged with: getter
tagged with: class
type: Question
tagged with: ecmascript-6
score: 113
has comment: http://stackoverflow.com/comment/63898386
linked to: http://stackoverflow.com/q/32114468
upvote count: 113
downvote count: 0
has comment: http://stackoverflow.com/comment/44807711
favorite count: 0
has comment: http://stackoverflow.com/comment/77051031
answer count: 4
has answer: http://stackoverflow.com/a/28222388
has answer: http://stackoverflow.com/a/48117094

http://stackoverflow.com/comment/44819508
type: Comment
comment on: http://stackoverflow.com/q/28135404
has text: Maybe you misunderstand what I mean in my question. When the plugin is blocked, I wish JS to know and then show some tips to user, like "please click here to allow the plugin to run". Thanks for you patient !
score: 0
type: QuestionComment

http://stackoverflow.com/a/28179363
has comment: http://stackoverflow.com/comment/44728017
answers question: http://stackoverflow.com/q/28178799
has body: Take all the following code which will be identical for both ajax calls and make a separate function i..e function ajaxCall (){ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("result").innerHTML=xmlhttp.responseText; } } } Then when you call ajaxCall you simply add relevant SEND: function whatEver(){ if (main-content.html is loaded) { ajaxCall(); xmlhttp.open("GET","main-content-city.php?q="+str,true); xmlhttp.send(); } else if (child-content is loaded) { ajaxCall(); xmlhttp.open("GET","child-content-city.php?q="+str,true); xmlhttp.send(); } }
score: 0
type: Answer

http://stackoverflow.com/comment/70115263
type: Comment
comment on: http://stackoverflow.com/a/38559152
score: 1
type: AnswerComment
has text: Nice work gathering all that data in one place! Thanks! If all work was as thorough as this life would come with a manual :)

http://stackoverflow.com/comment/44901872
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28252347
has text: I get it now.. validate() itself will register a form submit handler on our form. On submit, it will do all the validations and finally it will invoke submitHandler function where we can choose to do either an Ajax call or a simple form submit. Thanks Sparky :-)

http://stackoverflow.com/q/28170141
favorite count: 0
has answer: http://stackoverflow.com/a/28170297
has comment: http://stackoverflow.com/comment/44709994
has comment: http://stackoverflow.com/comment/44709947
has comment: http://stackoverflow.com/comment/44709878
tagged with: regex
possible better answer: http://stackoverflow.com/a/28170297
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44709727
has answer: http://stackoverflow.com/a/28170260
accepted answer: http://stackoverflow.com/a/28170260
type: Question
has body: i want to test two strings using single regular expression (OR using single patter). var reg_expr = (/(\d{1,2}?h$)|(\d{1,2}h(?=\s+))/gi) str1 = "5h" str2 = "7h" if (reg_expr.test(str1) == true &amp;&amp; reg_expr.test(str2) == true) { console.log("Matched.........") } but gives reg_expr.test(str1) --&gt; true and reg_expr.test(str2) --&gt; false
has comment: http://stackoverflow.com/comment/44709749
tagged with: javascript
has title: test() function in regex
answer count: 2
upvote count: 1

http://stackoverflow.com/q/28211060
answer count: 3
upvote count: 0
accepted answer: http://stackoverflow.com/a/28211103
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28211152
favorite count: 0
has answer: http://stackoverflow.com/a/28211152
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28111943
downvote count: 1
has answer: http://stackoverflow.com/a/28211274
type: Question
has title: How to set cursor position in particular input text in html and javascript
has body: I am trying set the cursor to the selected input box , if the user is selected in the second input text box without entering the value in the first input box than the cursor should go to the first input box. &lt;html&gt; &lt;script&gt; $( "#cic_name" ).focus(function() { var luname=$("#site").val(); if(luname.length&gt;0){ } else{ alert("please select TG value"); } }); &lt;/script&gt; &lt;body&gt; ENTER TG: &lt;input type="text" id="site" name="sitename" placeholder="TG Name"&gt; ENTER CIC: &lt;input type="text" id="cic_name" name="cic" placeholder="CiC Name"&gt; &lt;/body&gt; &lt;/html&gt; How to set the cursor position in the selected input box i.e..(id= site) if the user din't enter any thing in the first input box. I am wondering if there any cursor events are there.. I din't get. Thanks
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28211103

http://stackoverflow.com/q/28199293
type: Question
tagged with: windows-rt
has answer: http://stackoverflow.com/a/28199589
has comment: http://stackoverflow.com/comment/44764922
tagged with: internet-explorer
tagged with: javascript
has answer: http://stackoverflow.com/a/28199644
answer count: 2
has comment: http://stackoverflow.com/comment/44765539
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28199589
has comment: http://stackoverflow.com/comment/44839399
possible better answer: http://stackoverflow.com/a/28199644
has comment: http://stackoverflow.com/comment/44770363
has comment: http://stackoverflow.com/comment/44765225
has body: I have issue with IE on Windows RT devices(tablets). I have menu and submenus under it. If menu section has submenu then it has class "multi-level" and "inner-link". On proper desktop devices submenus are displayed when "hover","active", "selected", which on other browser on the same Windows RT device are trated as click on menu option to display submenu. However IE is not that friendly on that. So I did this solution, which prevents default action on menu option click(that on click in IE lands to first page of submenu selections) and then added onclick CSS "display !important" to display submenu, which are under tag with classes "list" and "lvl-2". However this solution works partialy, it prevents default on click for IE+touch, but does not add CSS to needed elements on the same click. My code: $(function ieTouch() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); var ifTouch = ua.indexOf("Touch"); if ((msie != 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))&amp;&amp; ifTouch != -1) { // If Internet Explorer and touchscreen $(".multi-level .inner-link").click(function (e) { e.preventDefault ? e.preventDefault() : event.returnValue = false; $(e.currentTarget).find("ul.list.lvl-2").css("display", "block", "important"); }); } }); Thank in forward for any help.
tagged with: css
type: AnsweredQuestion
has title: JQuery add CSS on click function not working
has comment: http://stackoverflow.com/comment/44765402
score: 0
has comment: http://stackoverflow.com/comment/44765421

http://stackoverflow.com/q/28225252
has body: I'm trying to send a request via AJAX with a user selected stop number to a Bus Stop Arrival time API url that returns a *.json file to me that I need to be able to utilize in my code. When I run the program it hits the 'Error' in my getJSON function. When I look at fiddler or even in debug via browsers I can see that it's returning the array I want to use. In, I.E. or Firefox, I can look at the Response/Response Body and see the array in there. Not sure where or why I can't get it working so I'm turning to you all, the experts. Please let me know what else I can try and provide. Using this library: // Returns the next 4 bus arrival times function getTimes(stopNumber) { var busArrivalAPI = "http://cfsrv1/api/index.cfm/rtcTimes/"+ stopNumber; function getJSON() { $.ajax({ type: 'GET', url: busArrivalAPI, dataType: "jsonp", contentType: "application/json; charset=utf-8", success: function(data) { busArrival = $.parseJSON(data); // This will remove old values so table will only load current Times var results = document.getElementById("results"); var rowCount = results.rows.length; for (var x=rowCount-1; x>0; x--) { results.deleteRow(x); } // This will populate the result table with the correct bus routes/times/direction data.forEach(function(busArrival) { var tr = document.createElement('tr'); var route = document.createElement('td'); route.appendChild(document.createTextNode(busArrival.ROUTE)); var arrival = document.createElement('td'); arrival.appendChild(document.createTextNode(busArrival.ARRIVAL)); var direction = document.createElement('td'); direction.appendChild(document.createTextNode(busArrival.DIR)); tr.appendChild(route); tr.appendChild(arrival); tr.appendChild(direction); document.getElementById('results').appendChild(tr); }); }, error: function() { alert(jqXHR, textStatus, errorThrown); } }); } getJSON(); } Raw Data from Fiddler Web Debugger (I'm only in need of the ROUTE, ARRIVAL, and DIR): GET http://cfsrv1/api/index.cfm/rtcTimes/2935? callback=jQuery11…
type: Question
has comment: http://stackoverflow.com/comment/44813719
tagged with: javascript
has comment: http://stackoverflow.com/comment/44813845
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44815204
has comment: http://stackoverflow.com/comment/44815132
has title: Cannot get JSON file from Server using AJAX
favorite count: 0
tagged with: ajax
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44817018
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44813800

http://stackoverflow.com/comment/44784901
type: QuestionComment
comment on: http://stackoverflow.com/q/28207854
has text: the javascript print funtion I used is : window.print.
score: 0
type: Comment

http://stackoverflow.com/comment/44878280
type: Comment
type: QuestionComment
has text: Its not working for me friend, when i open 2 and 3 then the rest get pushed with a weird blue background and then just stay there
score: 0
comment on: http://stackoverflow.com/q/28259019

http://stackoverflow.com/comment/44906578
type: Comment
comment on: http://stackoverflow.com/a/28275454
score: 0
type: AnswerComment
has text: Hi Peter. All it does is give me the number 1 as the $ref_no variable and nothing for $approval

http://stackoverflow.com/q/28205573
tagged with: javascript
has title: Popup update in php
linked to: http://stackoverflow.com/q/60174
has body: Am hi guys currently am having problem updating my myqsl database I have a popup window the updates it there is no error but its not updating what the problem. here is the popup window php code: &lt;?php session_start(); include("selectDB.php"); myconnection(); if(isset($_POST['submit'])) { $myquery="update member set contactno='".$_POST['contactno']."',email='".$_POST['email']."',religion='".$_POST['religion']."',deptid='".$_POST['deptid']."',where memberid='".$_POST['mid']."'"; mysql_query($myquery); echo "Record has been saved."; }else{ $myquery="select * from member where memberid='".$_SESSION['memberid']."'"; $results=mysql_query($myquery); $rs=mysql_fetch_array($results); ?&gt; &lt;form action="editacct.php" method="post" align="left"&gt; &lt;input type="text" name="mid" size="30" value="&lt;?php echo $rs['memberid'];?&gt;" hidden /&gt;&lt;br /&gt; Contact Number:&lt;br /&gt; &lt;input type="text" name="contactno" size="30" value="&lt;?php echo $rs['contactno'];?&gt;" /&gt;&lt;br /&gt; E-mail Adress:&lt;br /&gt; &lt;input type="text" name="email" size="30" value="&lt;?php echo $rs['email'];?&gt;"/&gt;&lt;br /&gt; Religion:&lt;br /&gt; &lt;input type="text" name="religion" size="30" value="&lt;?php echo $rs['religion'];?&gt;"/&gt;&lt;br /&gt; Address:&lt;br /&gt; &lt;input type="text" name="address" size="30" value="&lt;?php echo $rs['address'];?&gt;"/&gt;&lt;br /&gt; Department:&lt;br /&gt;&lt;select name="deptid" value="&lt;?php echo $rs['deptid'];?&gt;"&gt;&lt;br /&gt; &lt;option value=""&gt;Select&lt;/option&gt; &lt;option value="CAH001"&gt;Development Communication&lt;/option&gt; &lt;option value="CAH002"&gt;English&lt;/option&gt; &lt;option value="CAH003"&gt;Filipino&lt;/option&gt; &lt;option value="CAH004"&gt;Fine Arts&lt;/option&gt; &lt;option value="CAH005"&gt;History and Social Sciences&lt;/option&gt; &lt;option value="CAH006"&gt;Music&lt;/option&gt; &lt;option value="CAH007"&gt;P.E&lt;/option&gt; &lt;option value="CAH008"&gt;Psychology&lt;/option&gt;…
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28205683
type: UnansweredQuestion
score: -3
tagged with: php
upvote count: 0
tagged with: popup
downvote count: 3
type: Question

http://stackoverflow.com/q/28160415
answer count: 2
has comment: http://stackoverflow.com/comment/44725811
tagged with: shopify
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34442476
favorite count: 0
accepted answer: http://stackoverflow.com/a/29043617
has answer: http://stackoverflow.com/a/34442476
has title: Shopify + Mixpanel Integration
has answer: http://stackoverflow.com/a/29043617
type: AnsweredQuestion
tagged with: mixpanel
has body: I am using Shopify as my store page for selling items, with Mixpanel integrated to track users through the entire purchasing process. With 4 different events: Product Viewed, Added to Cart, Began Checkout and Order Completed. In the live view all of these come up accordingly, but my problem is it seems Mixpanel is assigning a completely different distinct_id when the user completes the checkout. Therefore in the Funnels section, I am not shown the completion rate as the users are lost along the way due to the different id. I have the following code in the Additional content &amp; scripts section (along with the start Mixpanel code): &lt;script type="text/javascript"&gt; mixpanel.track("Checkout", { "Checkout Total": "" }); mixpanel.identify({{ customer.id }}); mixpanel.people.set({ "$name": "{{ customer.first_name }} {{ customer.last_name }}", "$email": "{{ customer.email }}", "last_updated": new Date() }); mixpanel.people.track_charge(); &lt;/script&gt; Users are not signing up and i'm using the 'customer.id' throughout the other necessary code snippets in the Shopify theme. Does anyone know how to fix this issue so I can see the full user journey in Funnels with the completion rate?
score: 7
upvote count: 7
type: Question

http://stackoverflow.com/a/35895878
downvote count: 0
upvote count: 8
has body: For anyone interested, this is how I did it... Before the buttons property, add cssClass: 'popup-vertical-buttons' so that it looks something like this: $ionicPopup.show({ tite: 'Some Title', cssClass: 'popup-vertical-buttons', buttons: [ ... ] }); Then in your CSS add these two lines: .popup-vertical-buttons .popup-buttons { display: block; } .popup-vertical-buttons .popup-buttons .button{ display:block; min-width: 100% !important; }
answers question: http://stackoverflow.com/q/28123985
score: 8
type: Answer

http://stackoverflow.com/comment/44849660
score: 5
comment on: http://stackoverflow.com/q/28244494
type: Comment
type: QuestionComment
has text: Depends on how the server is configured.

http://stackoverflow.com/a/28242814
answers question: http://stackoverflow.com/q/28227286
has body: The answer depends on your authentication strategy i.e. are you using session identifiers, access tokens, etc. In either case I suggest that you break out the credential exchange (aka login) from the authentication. function usernamePasswordExchange(req,res,next){ var username = req.body.username; var password = req.body.password; callToAuthService(username,password,function(err,user){ if(err){ next(err); // bad password, user doesn’t exist, etc }else{ /* this part depends on your application. do you use sessions or access tokens? you need to send the user something that they can use for authentication on subsequent requests */ res.end(/* send something */); } }); } function authenticate(req,res,next){ /* read the cookie, access token, etc. verify that it is legit and then find the user that it’s associated with */ validateRequestAndGetUser(req,function(err,user){ if(err){ next(err); // session expired, tampered, revoked }else{ req.user = user; next(); } }); } app.post('/login',usernamePasswordExchange); app.get('/protected-resource',authenticate,function(req,res,next){ /* If we are here we know the user is authenticated and we can know who the user is by referencing req.user */ }); Disclaimer: I work at Stormpath and we spend a lot of time writing authentication code :) I just wrote our newest library, stormpath-sdk-express, which has a concrete implementation of my suggestions
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/44900174
has text: Yep, that helped - it's indeed a duplicate. Thanks a lot.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28272418
score: 0

http://stackoverflow.com/q/28210730
has comment: http://stackoverflow.com/comment/44785901
accepted answer: http://stackoverflow.com/a/28211259
has comment: http://stackoverflow.com/comment/44786613
has comment: http://stackoverflow.com/comment/44786219
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44786548
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44786467
has comment: http://stackoverflow.com/comment/44785911
has body: I have to execute a callback function after all the asynchronous functions finishes execution. For that I have created an array, containing asynchronous functions: var funcs = []; var requests = []; In which I have pushed some ajax functions. This is my solution which is not working: for(i = 0; i &lt; functions.length; i++){ var f = functions[i](); //calling each ajax functions requests.push(f); } $.when.apply(null, requests).done(function(){ console.log("Hello"); }); Now functions are executing asynchronously, but the callback functions gets called before the functions execution finishes. One of the example of ajax function I pushed : functions.push(function () { return $.ajax({ url: "some url", success: function(){ console.log("Finished execution"); } });
has comment: http://stackoverflow.com/comment/44786929
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/44786707
has title: $.when.apply.done not executing asynchronous functions
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/28211259
tagged with: .when
type: Question

http://stackoverflow.com/comment/44642266
score: 2
comment on: http://stackoverflow.com/q/28135074
has text: Or C) [None of the above](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var) :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44795131
type: Comment
has text: What i'm trying to say about domready is that you are defining a factory after the fire of this event. The factory i'm speaking of is "Auth". That factory should be defined elsewhere and consumed after domready.
comment on: http://stackoverflow.com/a/28214413
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44887615
type: QuestionComment
has text: kindly see this link and try to share it is not fetching the proper image
score: 0
comment on: http://stackoverflow.com/q/28265412
type: Comment

http://stackoverflow.com/comment/44860237
comment on: http://stackoverflow.com/a/28250291
score: 0
has text: The question was not tagged with jquery, and jquery is hardly useful here as compared with plain JavaScript.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44722370
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28176089
score: 0
has text: Almost anything can be done, providing you know the technologies you're working with, well enough to consider the logic of implementation.. This question on the other hand, shows you have not considered logic

http://stackoverflow.com/comment/44625800
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28126185
has text: didn't work and I got this in the page '); } var wid = $(window).width(); if(wid>970) { includeJS(); } });
score: 0

http://stackoverflow.com/q/28188703
tagged with: android
upvote count: 4
has title: JavaScript visibilitchange Event not fire on mobile Chrome
type: UnansweredQuestion
tagged with: google-chrome
linked to: http://stackoverflow.com/q/8571227
has body: Is it possible to know when Chrome loads a page from cache? There is a strange behavior when you start Chrome on Android: Chrome starts to load the page, but not from server, and there is no event fired in JavaScript for that loading.
score: 4
type: Question
tagged with: mobile
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29680852
tagged with: javascript
favorite count: 0

titanium
type: Tag
tags question: http://stackoverflow.com/q/28262247
tags question: http://stackoverflow.com/q/28204004
tag name: titanium
tags question: http://stackoverflow.com/q/28172452
tags question: http://stackoverflow.com/q/28228129
tags question: http://stackoverflow.com/q/28131515

http://stackoverflow.com/comment/44636574
type: QuestionComment
has text: @CBroe You are exactly right. Thanks for pointing me in the right direction! I was too focused on making sure each element had its events attached. Event delegation makes everything a LOT simpler, and jQuery supports it (http://api.jquery.com/delegate/). If you want, put that in an Answer and I will give you the credit you deserve! Thanks!
comment on: http://stackoverflow.com/q/28131912
score: 0
type: Comment

http://stackoverflow.com/comment/44891302
score: 0
type: Comment
has text: `^` is the XOR operator.
type: QuestionComment
comment on: http://stackoverflow.com/q/28267580

http://stackoverflow.com/comment/44809152
has text: try this: btn.onclick = function(){}
score: 0
comment on: http://stackoverflow.com/q/28223008
type: Comment
type: QuestionComment

instantiation
type: Tag
tags question: http://stackoverflow.com/q/28243775
tag name: instantiation

http://stackoverflow.com/q/28213548
linked to: http://stackoverflow.com/q/150208
type: Question
tagged with: javascript
has title: ReferenceError: WebBrowser is not defined
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am trying the most upvoted solution for html to rtf that is by using the browser. But even the simple start (everything stripped away) &lt;script type="text/javascript"&gt; var webBrowser = new WebBrowser(); &lt;/script&gt; gives: ReferenceError: WebBrowser is not defined What am I missing?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44790849
tagged with: rtf
has answer: http://stackoverflow.com/a/28213828
has comment: http://stackoverflow.com/comment/44790782

http://stackoverflow.com/comment/44807263
score: 0
has text: do u want to update the href only the first click ? remaining clicks should nt do anything.. is that wat ur expecting ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28220098

http://stackoverflow.com/a/28276508
type: Answer
answers question: http://stackoverflow.com/q/28276285
has body: You cannot really know what is in the clipboard of a user unless you used some sort of flash backend when they copied the text. However window.clipboardData.getData will work in some browsers. var text = window.clipboardData.getData('Text'); alert(text); //Popup with copied text. Automatic copying to clipboard may be dangerous, therefore most browsers (except IE) make it very difficult. But you could use this simple trick: function copyToClipboard(text) { window.prompt("Copy to clipboard: Ctrl+C, Enter", text); } The user is presented with the prompt box, where the text to be copied is already selected. Now it's enough to press Ctrl+C and Enter (to close the box) -- and voila! You can do this because the user does it manually (but in a pretty straightforward way). Of course, works in all browsers.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44907673
upvote count: 1

http://stackoverflow.com/q/28178263
linked to: http://stackoverflow.com/q/5210033
has comment: http://stackoverflow.com/comment/44726279
tagged with: javascript
has comment: http://stackoverflow.com/comment/44726456
score: 0
has answer: http://stackoverflow.com/a/28178416
has body: I have an element set to visibility:hidden and i need it to change to visible on hover, i tried this with javascript with no luck HTML &lt;div class="options"&gt; &lt;div id="option-1" onmouseover="dis()"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="pic-1"&gt;&lt;/div&gt; CSS #option-1{ width:100px; height:20px; background:#fff; position:relative; z-index:999; top:0;left:0; } #pic-1{ width:100%; height:100%; position:absolute; z-index:99; background:#f0f; visibility:hidden; } Javascript function dis(){ document.getElementById("pic-1").style.visibility = "visible"; }
answer count: 1
has comment: http://stackoverflow.com/comment/44725761
has title: Need to display a div on hover of other div
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44725710
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44725949
type: Question

http://stackoverflow.com/q/28132379
type: AnsweredQuestion
tagged with: javascript
upvote count: 2
possible better answer: http://stackoverflow.com/a/28132605
has answer: http://stackoverflow.com/a/28132409
answer count: 2
accepted answer: http://stackoverflow.com/a/28132409
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28132605
score: 1
has body: I'm using setInterval do show a slideshow, and i would like to show the slideshow immediately, how can i prevent the delay from the beginning? Code: setInterval( function() { $("body, #resp-background").css({ 'background-image': 'url(' + pics[i] + ')', '-webkit-transition': 'background-image .25s ease-in-out', 'transition': 'background-image .25s ease-in-out;', '-moz-transition': 'background-image .25s ease-in-out;', 'background-size': 'background-image .25s ease-in-out;', '-o-background-size': 'cover', '-moz-background-size': 'cover', '-webkit-background-size': 'cover' }); $('.s-description').html(descriptions[i]); i++; if (i &gt;= pics.length) i = 0; }, 4200); Jsfiddle: http://jsfiddle.net/kx1fgsox/3/ Thank you
downvote count: 1
type: Question
has title: How can i stop the delay from setInterval?

http://stackoverflow.com/q/28220655
tagged with: margin
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28220853
tagged with: javascript
tagged with: jquery
has title: Find a Div's margin value
score: 0
has body: I want to be able to rightclick a Div, and then find it's margin's value. The Div's are created like this. //create spaces// var addLeft=75; var addTop=105; var vert = 1; var horz = 1; var selectedunit = ""; for (var i = 1; i&lt;26; i++) { $("#background").append("&lt;div class='areas' id = 'space" + vert + horz + "' style ='position: absolute; LEFT: " + addLeft + "px; Top:" + addTop + "px'&gt;&lt;/div&gt;"); if (addLeft &lt; 600) { addLeft += 150; vert+=1; } else { horz+=1; addTop += 150; addLeft = 75; vert=1; } } And I try to find the div's margin with this. $('.areas').mousedown(function(e) { if(e.button === 2 ){ var style = window.getComputedStyle(this); var futureleft = style.marginLeft; $('#Status').append(futureleft); } }) Status is just a box that should give me the Div's left value, but it always gives 0PX. Any suggestions?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28220819
type: UnansweredQuestion

http://stackoverflow.com/comment/44883352
type: QuestionComment
comment on: http://stackoverflow.com/q/28262971
has text: @Winchestro: Everything in JavaScript is just an exposed binding to some lower-level stuff that conforms to the standard rules. That's basically how every language works…
score: 0
type: Comment

http://stackoverflow.com/comment/44636736
comment on: http://stackoverflow.com/a/28131412
has text: @sagesky36 No probs. I use that technique to pass most data to external js. I'm sure I learnt it on here. Great place to learn. :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28123525
has body: I am currently making a decibel meter visualizer using JavaScript, HTML and CSS. I have gone through several Web Audio API tutorials, but nothing on there is close to being specific to what I want to do. This is what I have so far: window.onload = init; function init() { var ctx = new webkitAudioContext() , url = 'https://dl.dropboxusercontent.com/u/86176287/pbjt.mp3' , audio = new Audio(url) // 2048 sample buffer, 1 channel in, 1 channel out , processor = ctx.createJavaScriptNode(2048, 1, 1) , meter = document.getElementById('meter') , source; audio.addEventListener('canplaythrough', function(){ source = ctx.createMediaElementSource(audio); source.connect(processor); source.connect(ctx.destination); processor.connect(ctx.destination); audio.play(); }, false); // loop through PCM data and calculate average // volume for a given 2048 sample buffer processor.onaudioprocess = function(evt){ var input = evt.inputBuffer.getChannelData(0) , len = input.length , total = i = 0 , rms; while ( i &lt; len ) total += Math.abs( input[i++] ); rms = Math.sqrt( total / len ); meter.style.width = ( rms * 100 ) + '%'; }; } Can someone please explain what I need to do, or point me in the right direction, since this doesn't seem to be working?
has comment: http://stackoverflow.com/comment/44712933
tagged with: html5-audio
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44661353
score: 16
tagged with: decibel
upvote count: 16
tagged with: audio
has title: How do you get the decibel level of an audio in Javascript
has answer: http://stackoverflow.com/a/68388111
type: Question
has comment: http://stackoverflow.com/comment/98900675
has comment: http://stackoverflow.com/comment/98910658
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28216832
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/28219647
accepted answer: http://stackoverflow.com/a/28219647
score: 0
has body: I want to hide the 0 values, and this is my chart : http://jsfiddle.net/phsx2azc/ you see under the pie chart four values "0", and is confusing to see, I need hide "0" values. So my question is... How can I hide "0" values in a multi chart ? I hope you can help me please! :( $(function () { $('#container').highcharts({ title: { text: 'Percepción y Satisfacción Origen DOM' }, xAxis: { categories: ['Noviembre', 'Diciembre', 'Enero', 'Meta'] }, yAxis: { labels: { format: '{value=0}' } }, labels: { items: [{ html: 'Insatisfacción DOM', style: { left: '50px', top: '18px', color: (Highcharts.theme &amp;&amp; Highcharts.theme.textColor) || 'black' } }] }, plotOptions: { series: { depth: 45, allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, distance: 0.5, format: '{total} ', color: '#FFFFFF', style: { fontSize: '13px', fontFamily: 'Verdana, sans-serif', textShadow: '0 0 3px black' }, }, showInLegend: true, pointPadding: 0, groupPadding: 0, borderColor: '#303030', stacking: 'normal', //colorByPoint: true } }, series: [{// columnas positivas type: 'column', stacking: 'normal', name: 'Positivos', colors: ['#009999','#009999','#009999','#FFFF00'], data: [35,32,39,38,0,0,0,0], colorByPoint: true, }, {//columnas negativas type:'column', name: 'Negativos', data: [-9, -8, -8], colorByPoint: false, }, { //aquí empieza el pie chart type: 'pie', name: 'Percepción Origen', data: [{ name: 'Check in', y: 14, color: '#13035f', }, { name: 'Embarque', y: 24, color: '#f03215', }, { name: 'Falta información', y: 20, color: '#FE7943', }, { name: 'Infraestructura', y: 20, color: '#DAFAA8', }, { name: 'Amabilidad', y: 20, color: '#BEF16D', }, { name: 'Comportamiento', y: 20, color: '#3ED72D', }, { name: 'Atraso vuelo', y: 20, color: '#148307', }, { name: 'Solicitudes especiales', y: 20, color: '#41B9FB', // Joe's color } ], center: [380, 80], size: 200, showInLegend: true, dataLabels: { enabled: true } }] }); });
answer count: 1
tagged with: charts
tagged with: javascript
type: AnsweredQuestion
has title: How to hide 0 values in multi chart in highcharts?
tagged with: highcharts

http://stackoverflow.com/a/28180012
answers question: http://stackoverflow.com/q/28179904
has comment: http://stackoverflow.com/comment/44729712
has comment: http://stackoverflow.com/comment/44730811
has body: Set your body element's height to be correct size. For web apps without the address bar I think it's supposed to be height: 672px !important; See this question: iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44730317
has comment: http://stackoverflow.com/comment/44729554

http://stackoverflow.com/q/28230491
has answer: http://stackoverflow.com/a/28230625
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm using the following code to get the ID of the anchor link: HTML: &lt;a id="{{_id}}" class="clearfix" href="#"&gt; &lt;img src="/avatar.png"/&gt; &lt;div&gt;{{username}}&lt;/div&gt; &lt;/a&gt; JS: 'click a': function(e) { var currentEditorId = $(e.target).attr('id') console.log(currentEditorId) } It works OK. The problem arises when I click on the img and div tag directly (the anchor tag is spread above them). How can I make it so that e.target only captures the anchor tag and not the HTML tags that are inside?
accepted answer: http://stackoverflow.com/a/28230521
has title: How to make the HTML tags unclickeable for e.target?
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28230521
possible better answer: http://stackoverflow.com/a/28230625

curl
tags question: http://stackoverflow.com/q/28241058
tag name: curl
type: Tag

http://stackoverflow.com/a/28224734
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28224472
score: 1
has body: The issue is with the function theCelebs[i]["id"] = function () { console.log("inner: " + i); return uniqueID + i; //this is accessing the i declared in outer function, not in For loop... } The value of i here inside of the function is referencing the lexical environment of function celebIDCreator and the variable environment of the anonymous function(){. As there is no definition inside of the variable environment, i must be taken from the lexical environment. Further, since the function is called at a later date, when i is taken from the lexical environment, it has been modified by the for loop and is now the final value (3). Alternatives for this include using an IIFE to close over the i value. theCelebs[i]["id"] = (function (i) { return function(){ console.log("inner: " + i); return uniqueID + i; //this is now accessing the i declared in the IIFE } })(i);

http://stackoverflow.com/q/28228178
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45000368
has answer: http://stackoverflow.com/a/36283734
has comment: http://stackoverflow.com/comment/54859887
tagged with: internet-explorer-11
has comment: http://stackoverflow.com/comment/44981353
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44958754
has answer: http://stackoverflow.com/a/34829541
has body: In IE11, I'm using ajax to post a FormData element to a Windows Authenticated endpoint (IIS7.5 NTLM). If the FormData element only contains text fields, everything works great -- the initial request results in a 401 and the payload gets delivered in the subsequent request that carries the credentials/payload. However, this does not work if there is a File input in the FormData object. If there is a file in the FormData object, IE11 will send the request, get the 401, and then not send the subsequent request at all. (note -- it does work in FF/Chrome) Code: // This works var fd = new FormData(); fd.append("CaseId", 1188); fd.append("PhaseId", 6); // Adding this element to the FD makes IE11 hang // but still works in FF &amp; Chrome fd.append("MyFile", document.getElementById("MyFileInput").files[0]); $.ajax({ url : "myEndpoint.ashx", type : "POST", data : fd, contentType : false, // do not to adjust content-type processData : false, // do not to convert raw data to string success : function(data){ console.log("Hooray!"); }, error : function(xhr){ console.log("Boo"); } }); I have examined the request headers with/without the file input in Fiddler and the 401 request/responses are identical in every way. Here is the Working Request (no file input). The subsequent request that follows this one includes credentials and results in a 200 POST http://example.com/myEndpoint.ashx HTTP/1.1 X-Requested-With: XMLHttpRequest Accept: */* Content-Type: multipart/form-data; boundary=---------------------------7df11b0308d6 Referer: http://example.com/IE11FormDataTest.html Accept-Language: en-US Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC LM 8) Connection: Keep-Alive Host: example.com Pragma: no-cache Cookie: ASP.NET_SessionId=mqa12rwnmxerfoz3csx0wohk Authorization: NTLM TlRMTVNTUAABAAAAB4II…
score: 2
has comment: http://stackoverflow.com/comment/54833588
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44960850
favorite count: 0
tagged with: ajax
type: Question
has title: IE11 FormData AJAX Post with File hangs after 401
has comment: http://stackoverflow.com/comment/44982132
tagged with: iis-7.5
has comment: http://stackoverflow.com/comment/44960332
tagged with: asp.net
has comment: http://stackoverflow.com/comment/54844166

http://stackoverflow.com/comment/44836672
has text: I have included reference. I should have mentioned this also in my question. Edited now
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28237718

http://stackoverflow.com/comment/44662926
type: Comment
comment on: http://stackoverflow.com/a/28145281
type: AnswerComment
has text: I added this option to the answer. Thanks!
score: 0

http://stackoverflow.com/q/28200018
tagged with: promise
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44787895
has answer: http://stackoverflow.com/a/28200238
has title: How to pass parameter into a function in my case
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28200175
has answer: http://stackoverflow.com/a/28200175
type: Question
has answer: http://stackoverflow.com/a/28200236
has answer: http://stackoverflow.com/a/28201224
has comment: http://stackoverflow.com/comment/44767688
has comment: http://stackoverflow.com/comment/44766980
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44766493
has body: I am trying to build promises for my app. I have something like var test = function(id,companyID) { return getProduct(id) .then(getProductName(companyID)) .then(function(obj) { console.log(obj) }) } test('123', '456'); All I can see is an object that contain empty contexts. However, if I change my code to no include the parameters and hardcode in the getProductName function like var test = function(id,companyID) { return getProduct(id) .then(getProductName) .then(function(obj) { console.log(obj) }) } test('123', '456'); I got the data I need in the console.log I am not sure how to pass an parameters into the chain. Any idea how to do it? Thanks a lot!
answer count: 4
accepted answer: http://stackoverflow.com/a/28201224
has comment: http://stackoverflow.com/comment/44766363

http://stackoverflow.com/comment/44864474
type: Comment
type: AnswerComment
has text: i mean post http query. Will it be ok to send as param uintArray ?
comment on: http://stackoverflow.com/a/28247398
score: 0

http://stackoverflow.com/comment/44892324
type: Comment
comment on: http://stackoverflow.com/a/28268031
has text: I'm using that middleware, see the edit to my question. I don't have stuff in a public folder though. Why would I need that? Note: everything was working before I made the backend route catch-all. Ie. when the route was just '/', everything worked except going to URLs directly.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44709878
score: 0
type: Comment
type: QuestionComment
has text: $ is add for get h at end of the string like in meeting at 7h.
comment on: http://stackoverflow.com/q/28170141

http://stackoverflow.com/q/28140638
tagged with: javascript
tagged with: variables
tagged with: jquery
has body: Say I've got this code: function helloWorld() { console.log(helloText); } When I call this function, I'd like to do something like this: helloWord( helloText = "some example text"; ) which of course doesn't work. But the idea is that I want to change a variable by referencing it's name when calling that function. I see numerous jQuery slideshows and stuff that do this, but I can't seem to figure it out. The closest thing I can find is this: function helloWorld(helloText) { console.log(helloText); } helloWorld("some example text"); Which will work, but with a longer list of variables, that gets unwieldy. So how can I instead change the variable value by using its name?
has comment: http://stackoverflow.com/comment/44653105
score: 0
possible better answer: http://stackoverflow.com/a/28140755
has answer: http://stackoverflow.com/a/28140755
has answer: http://stackoverflow.com/a/28140676
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28140676
type: Question
has title: How do I set variables by name when calling a function?
answer count: 2
tagged with: function

http://stackoverflow.com/q/28240078
score: -1
has comment: http://stackoverflow.com/comment/44841161
type: Question
has answer: http://stackoverflow.com/a/28240303
accepted answer: http://stackoverflow.com/a/28240303
answer count: 1
tagged with: arrays
tagged with: javascript
has title: How to pre fill JavaScript array with random values
has body: var cars = ["Saab", "Volvo", "BMW"]; var thisarrayshouldbe = 5; How to pre-fill random values from "cars" array and produce new array ?
favorite count: 0
has comment: http://stackoverflow.com/comment/44841253
upvote count: 0
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/q/28247260
tagged with: angular-google-maps
answer count: 2
tagged with: google-maps
downvote count: 0
possible better answer: http://stackoverflow.com/a/28259777
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28293166
favorite count: 0
has title: angular-google-maps run function ONCE after initial map load
tagged with: angularjs
linked to: http://stackoverflow.com/q/832692
upvote count: 7
type: Question
has answer: http://stackoverflow.com/a/28293166
type: AnsweredQuestion
score: 7
has body: using angular-google-maps to incorporate a google map into an app I need a command that will run a function ONCE after initial map load is complete - but only on the initial load, not after each map manipulation I can't use idle or tilesloaded since these are fired after every movement... The function I want to run needs to get map bounds to pull data off a server on initial page load - i want this to occur ONCE on initial load, then be a manual function using a refresh map-control - if i use idle or tilesloaded to fire this it will pull server data every time a user moves the map. Does anyone know how to fire a once off command to get map details (bounds etc) after initial map load ? I've tried putting maps.getBounds() in the 2nd promise function but it doesn't work. Note, I've got a fiddle working here - I just can't chain any more promises after the $scope.map controls / options etc are defined because they don't return a promise: The code example in the docs doesn't show how to chain a promise after the $scope.map is defined. html &lt;div class="angular-google-map-container" ng-controller="MainCtrl"&gt; &lt;ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="map.options" events="map.events" control="googlemap"&gt; &lt;/ui-gmap-google-map&gt; &lt;/div&gt; controller myApp.controller('MainCtrl', function($scope, uiGmapGoogleMapApi) { uiGmapGoogleMapApi .then(function(maps){ $scope.map = { center: { latitude: 37.7749295, longitude: -122.4194155 }, zoom: 12 events: { tilesloaded: function (maps, eventName, args) { myServiceFuntion(maps) // this work fine but fires every time }, dragend: function (maps, eventName, args) { myServiceFuntion(maps) // this work fine but fires every time }, zoom_changed: function (maps, eventName, args) { myServiceFuntion(maps) // this work fine but fires every time } } } $scope.bounds = maps.getBounds() // this gives me 'getBounds() not a function' myServiceFuntion(maps); // this gives an error... ? return ma…
has answer: http://stackoverflow.com/a/28259777

http://stackoverflow.com/comment/44784483
type: QuestionComment
score: 0
has text: Well... what about writing `x` and styling it with css? Or eventually use the `&times;` HTML entity?
comment on: http://stackoverflow.com/q/28209719
type: Comment

http://stackoverflow.com/a/28192540
type: Answer
has body: You can do it, the code you gave i tried it just by adding ?php &lt;div class='content'&gt;&lt;/div&gt; &lt;script type='text/javascript'&gt; $('.content').html("&lt;?php include('php/content.php'); ?&gt;"); &lt;/script&gt; When the php is executed on server it replaces content with actual html inside html() function. And on client side javascript plays its role to render it.
upvote count: 0
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/28192384

infinite-scroll
tag name: infinite-scroll
tags question: http://stackoverflow.com/q/28121977
type: Tag

http://stackoverflow.com/q/28212395
answer count: 1
tagged with: datatable
tagged with: angularjs
type: UnansweredQuestion
has body: I'm trying to derive jquery datatable to create my custom datatable and make the columns dynamic. I can't pass the colums as an object. I'm getting a string in the directive controller. var columns = { cols: [ { "mDataProp": "Name", "render": function (data, type, full, meta) { return '&lt;a href="#/u/d/' + full.Id + '"&gt;' + full.Name + '&lt;/a&gt;'; } }, { "mDataProp": "prop2" } }; function getColumns() { return columns; } &lt;my-table columns='columns' message="my message"&gt;&lt;/my-table&gt; app.directive('myTable', function () { return { restrict: 'E', templateUrl: '/TableView.html', replace: false, controller: function ($scope) { // $scope.urun = // $scope.arg1 = attrs.headerText; // }, scope: { columns: '=columns' }, link: function (scope, element, attrs) { var columns = attrs.columns; console.log(columns); } }
has answer: http://stackoverflow.com/a/28212581
type: Question
has title: Passing a Javascript Object (DataTable Columns) to Angular Directive
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/44891858
type: Comment
type: QuestionComment
has text: Side note: `jQuery.noConflict()` serves the *opposite purpose* — to *remove* the synonym "`$ = jQuery`"
comment on: http://stackoverflow.com/q/28267808
score: 4

http://stackoverflow.com/comment/44887018
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28265192
type: QuestionComment
has text: `$(".openbox1").click(function() { $(this).popup({...}); });`

http://stackoverflow.com/comment/44902840
type: Comment
type: QuestionComment
has text: Please add your code or at least part of your code in the question.
score: 0
comment on: http://stackoverflow.com/q/28273846

http://stackoverflow.com/a/28262144
downvote count: 0
has body: As long as the canonical URL isset, the overall vanity URL matters little as the canonical one will be indexed. A commercial example, ESPN do this all the time. Sometimes the URL conforms, sometime's it redirects to the correct page and if all else fails it just redirects to a search. But no matter how many variations of the URL and how malformed it is, it takes away little, if anything, from the indexed content of the page. However, if the ratio of total links to a url for a 301 redirect is overwhleming, it is indeed possible for the vanity url to appear in indexes despite it being a 301 redirect. Again, ESPN as an example, searching the term site:espn.com/billsimmons will show an indexed page that will redirect to http://search.espn.go.com/bill-simmons/. As long as you set the canonical URL, you should be fine.
accepted answer of: http://stackoverflow.com/q/28208497
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28208497
type: AcceptedAnswer

http://stackoverflow.com/q/28131017
has answer: http://stackoverflow.com/a/28131134
favorite count: 0
has comment: http://stackoverflow.com/comment/44634757
has comment: http://stackoverflow.com/comment/44634812
has title: The purpose of particular anonymous function
accepted answer: http://stackoverflow.com/a/28131131
type: AnsweredQuestion
upvote count: 3
has body: I have difficulty understanding what the following function is going to do. I need to understand what is the purpose of this function since I got different reaction using different browsers while running this function. function anonymous() { return(function() { 'use strict'; return !this&amp;&amp;!!Function.prototype.bind; } ()); }
type: Question
tagged with: browser
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28131131
answer count: 2
downvote count: 4
tagged with: anonymous-function
possible better answer: http://stackoverflow.com/a/28131134

http://stackoverflow.com/comment/44823786
has text: @edisonthk: JavaScript is unicode: http://es5.github.io/#x7.6
comment on: http://stackoverflow.com/q/28230634
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28276454
tagged with: promise
has answer: http://stackoverflow.com/a/29195001
upvote count: 4
has body: I am trying to create the following promise syntaxes: I want the secondary then to be called after the post function, how can I do that? randomBytes.then(function() { return requestPromise.post(....); }).then(function() { // I want this part to be called after the POST });
tagged with: node.js
possible better answer: http://stackoverflow.com/a/29195001
type: AnsweredQuestion
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/46605903
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44907755
has answer: http://stackoverflow.com/a/28278118
accepted answer: http://stackoverflow.com/a/28278118
has comment: http://stackoverflow.com/comment/44907572
downvote count: 1
favorite count: 0
has title: Promise that returns a promise?

http://stackoverflow.com/comment/44629307
type: Comment
has text: @jfriend00 yeah I know, I didn't say your solution is wrong, just that there's this caveat to be aware of.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28128004

http://stackoverflow.com/q/28170705
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
has answer: http://stackoverflow.com/a/28171082
downvote count: 0
answer count: 1
tagged with: javascript
has title: How can I make vinyl-source-stream output to my destination directory?
has body: I am moving from the (working, but deprecated) gulp-browserify to the plain browserify module. My source tree looks like this: projectdir public js src dist My gulp task looks like the following: var source = require('vinyl-source-stream'); gulp.task('js', ['clean'], function() { // Browserify/bundle the JS. bundler.bundle() // log errors if they happen .on('error', function(err) { return notify().write(err); }) .pipe(source('./public/js/src/index.js')) .pipe(gulp.dest('./public/js/dist')); }); However this writes out to public/js/dist/public/js/src/ which is obviously bad. However changin gulp.dest to read: .pipe(gulp.dest('./public/js/dist')); Writes outside my projects directory! ie: ~/Documents/dist/public/js/src/index.js I've seen lots of gulp documentation using gulp.src, but I am not using gulp.src, I am using vinyl-source-stream How can I make vinyl-source-stream output topublic/js/dist?
tagged with: browserify
tagged with: gulp

arrow-keys
tags question: http://stackoverflow.com/q/28147266
tag name: arrow-keys
type: Tag

http://stackoverflow.com/q/28139841
type: UnansweredQuestion
upvote count: 1
has body: I want the text 'Rate! (62)' in the 'rate' class to change to 'Rate! (63)' when a user clicks one of the input radios. The difficulty is that I have many 'stars' divs so this change must occur only to the next span descendant of the enclosing 'stars' div. Rate! (62) I'm new to jQuery and this is what I came up with until now but it's not working. i think I have confuse a couple of things on the way: ('.rating input:radio').click(function() { var str_rate = $(obj).closest('span').next().find('.rate'); //TODO: parse the current value and add 1 to it $(str_rate).html(str); } Is there something I'm completely missing? UPDATE: This jsfiddle shows the progress until now considering the answers but still it doesn't work properly.
has answer: http://stackoverflow.com/a/28140455
type: Question
score: 1
has answer: http://stackoverflow.com/a/28139888
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28139880
favorite count: 0
has title: Change span's text value when an input radio is clicked using jQuery

http://stackoverflow.com/q/28207282
has comment: http://stackoverflow.com/comment/44786353
tagged with: javascript
score: 0
has body: I have a bit of a problem and I'm not sure if javascript is the solution for this. Anyway, I have 4 fields in my forms which are a dropdown field, file upload field, and 2 text input field. My form currently implements a bootstrap validator, which is using a javascript. This is a snippet of it. $('#uploadFileForm') .bootstrapValidator({ live: 'enabled', fields: { 'data[Upload][uploadtype]': { validators: { notEmpty: { message: 'Choose Upload Type' } } }, 'data[Upload][browsefile]': { validators: { notEmpty: { message: 'Choose a file to upload' }, file: { extension: 'pdf', type: 'application/pdf', maxSize: 5120 * 5120 * 5120 * 5120 * 5120, message: 'The file must be in .pdf format and must not exceed 5MB in size' } } }; Anyway, this one is working. What I want to do is the file upload field will adjust its validator according to what was chosen in the dropdown field. For example, let's say I chose the 'PDF' in the dropdown, the code above will trigger and say 'The file must be in .pdf format and must not exceed 5MB in size', which is correct. But what if I chose 'Pictures' in the dropdown, how can I make the correct validator appear? Is there any way that I can do this? Thank you!
has comment: http://stackoverflow.com/comment/44781310
has comment: http://stackoverflow.com/comment/44781226
has comment: http://stackoverflow.com/comment/44781023
answer count: 0
type: UnansweredQuestion
has title: CakePHP Javascript OnSelect Dropdown
tagged with: cakephp
type: Question
has comment: http://stackoverflow.com/comment/44781832

http://stackoverflow.com/comment/44937281
type: AnswerComment
has text: Hi Manoj, Thanks It work but fails if we removed the check from checkbox and again type something in textbox. or we can say on first run it works but fails if check is removed.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28215271

http://stackoverflow.com/q/28232794
has comment: http://stackoverflow.com/comment/44828245
upvote count: 1
accepted answer: http://stackoverflow.com/a/28234585
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44828701
score: 1
has title: Parsererror when using AJAX and JSONP with Cordova
has comment: http://stackoverflow.com/comment/44828518
type: Question
tagged with: jsonp
has comment: http://stackoverflow.com/comment/44828369
has comment: http://stackoverflow.com/comment/44828431
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28234585
has body: I am trying to post 4 variables to a database on an external server using a mobile application created using Cordova 4.0.0. I have already had a look a countless posts similar to this trying, POST, GET, contentType etc. and none of these seem to work. I have worked with JSONP before and it worked fine (I used that code as a template), but this doesn't seem to work. Here is the console log: 2015-01-30 09:19:09.817 Alert[1253:353531] {"readyState":4,"status":200,"statusText":"load"} 2015-01-30 09:19:09.817 Alert[1253:353531] parsererror 2015-01-30 09:19:09.817 Alert[1253:353531] {"line":2,"column":2097,"sourceURL":"file:///private/var/mobile/Containers/Bundle/Application/D1746CD9-C9B3-4A31-9965-E4A6AAED3347/Alert.app/www/js/jquery-2.1.3.min.js"} Here is my AJAX Post request. function pushToDataLog(beaconid, uuid, timestamp, status) { jQuery.ajax({ type: "POST", // HTTP method POST or GET url: "http://url.co.uk/ips/pushdata.php", //Where to make Ajax calls dataType:"jsonp", // Data type, HTML, json etc. jsonp: "callback", data : {beaconid: beaconid, uuid: uuid, timestamp: timestamp, status:status}, crossDomain: true, contentType: 'application/json', success:function(response){ //console.log(JSON.stringify(response)); }, error:function (xhr, ajaxOptions, thrownError){ console.log(xhr); console.log(ajaxOptions); console.log(thrownError); } }); } I dont understand what is causing the parse error.. EDIT Here is my PHP file stored on the server: <?php if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $beaconid = NULL; $entertimestamp= NULL; $exittimestamp = NULL; //GET THE VARIABLES FROM JAVASCRIPT if(isset($_REQUEST['beaconid'])){ $beaconid = $_REQUEST['beaconid']; } if(isset($_REQUEST['uuid'])){ $uuid = $_REQUEST['uuid']; } if(isset($_REQUEST['timestamp'])){ $timestamp = $_REQUEST['timestamp']; } if(isset($_REQUEST['status'])){ $status = $_REQUEST['status']; } define('DB_SERVER', 'a'); define('DB_USER', 'a'); define('DB_PASSWORD', 'a'); define('DB_DATABASE', 'a'…
has comment: http://stackoverflow.com/comment/44828804
answer count: 1
has comment: http://stackoverflow.com/comment/44829811
favorite count: 0
tagged with: cordova
linked to: http://stackoverflow.com/q/5359224

http://stackoverflow.com/a/28126250
score: 3
answers question: http://stackoverflow.com/q/28126187
has body: You're going about in an overly roundabout way. JSON is called "JavaScript Object Notation" for a reason. There's no need to put it in a string and re-parse it. You can just use the JSON as JavaScript. ASP.NET MVC has a helper for serializing values as JSON, so you can just use that and assign it to a variable in your JavaScript: &lt;script&gt; var wordsAsObject = @Html.Raw(Json.Encode(ViewBag.wordsToShow)); &lt;/script&gt; This would eliminate the need to do the JSON serialization within your Action. I suspect that the reason you're encountering this issue is that by default, values inserted into a view with @ are automatically HTML encoded. You can use Html.Raw() to prevent this, as I've done above, but as I said, there's no reason to put it into a string first and parse it.
accepted answer of: http://stackoverflow.com/q/28126187
type: AcceptedAnswer
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/comment/44655220
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28141788
score: 0
has text: create a demo that replicates this

http://stackoverflow.com/q/28202167
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: twitter-bootstrap
type: Question
has answer: http://stackoverflow.com/a/28243917
score: 0
has title: Bootstrap popover works with html but not requested webpage
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am trying to develop a jquery script which will open a popover containing the webpage when you hover over a table td and close it when you move off of it. So far this is working pretty well . The code I have is: var html = ""; var $that = ""; var $url = ""; $('td').hover(function() { var contents = $(this).html(); if (contents.match("^http")) { console.log('contents', contents); $that = $(this); $url = contents; $.ajax({ type: "POST", url: "/echo/html/", context: $that, data: {u: 'http://stackoverflow.com'}, dataType: 'html', error: function(jqXHR, textStatus, errorThrown) { console.log('error'); console.log(jqXHR, textStatus, errorThrown); } }).done(function(html) { console.log(' here is the html ' + html); html = ' hola hola2 '; $link = $(''); $link.data('content', html); $(this).html($link); $that = $(this); // Trigger the popover to open $link = $(this).find('a'); $link.popover("show"); }) }; }, function() { console.log('this2 ', $that); $link = $that.find('a'); console.log('$link2 ', $link); $link.popover("hide"); $that.html($url); }); and you can see it at: JSFiddle The problem arises over inserting a webpage into the popover via an ajax request. You can see what happens if you remove the line: html = ' hola hola2 '; It no longer works. What am I doing wrong and is it possible to load a full webpage into a popover given all the unpredictable js within in?
type: UnansweredQuestion

http://stackoverflow.com/q/28170162
tagged with: jquery
tagged with: datetimepicker
answer count: 0
type: UnansweredQuestion
score: 0
has body: I am using this date time picker https://github.com/Envek/jquery-datetimepicker-rails ruby on my rails project. It's pretty good and things are working nice. However the time picker defaults to times on the hour. It would be nice to be able to have the time with 15 minute intervals eg [15:00, 15:15, 15:30, 15:45, 16:00 etc]. There doesn't seem to be a setting available that allows this. How would I programatically produce these times using javascript? or is there a setting which would allow me to do this in a much cleaner way? Many Thanks,
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44710040
type: Question
has title: Javascript DateTimePicker create timespan array with 15 minute intervals
has comment: http://stackoverflow.com/comment/44709993
tagged with: javascript

http://stackoverflow.com/comment/44802440
comment on: http://stackoverflow.com/q/28217794
score: 0
type: QuestionComment
type: Comment
has text: @Tim yes that's what I thought too. Seems like a race condition. Does putting it in the head really solve this?

http://stackoverflow.com/a/28228058
has body: When triggering the action you can scroll to the alert element using something like this: $("#button").click(function() { /* trigger UI bootstrap alert */ /* ... */ $('html, body').animate({ scrollTop: $("#alertElementtoScrollToID").offset().top }, 2000); });
has comment: http://stackoverflow.com/comment/44820814
score: 1
answers question: http://stackoverflow.com/q/28227497
has comment: http://stackoverflow.com/comment/44819858
has comment: http://stackoverflow.com/comment/44820864
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44820662
downvote count: 0

http://stackoverflow.com/a/28166183
has body: Try below code use Use jQuery .nextAll() and .wrapAll() HTML Password help text jQuery $('.control-label').nextAll().wrapAll(' '); JSFIDDLE DEMO
score: 0
answers question: http://stackoverflow.com/q/28166025
type: Answer

http://stackoverflow.com/comment/44746834
type: Comment
comment on: http://stackoverflow.com/q/28189236
score: 0
type: QuestionComment
has text: I don't know what that is, but nevermind. I asked whether you tried to disable the autocomplete. It wouldn't disable the typeahead, but it would prevent the browser on ipad from pre-filling the fields maybe? And a piece of code would be appreciated.

http://stackoverflow.com/q/28248584
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44866558
has comment: http://stackoverflow.com/comment/44857469
has title: jQuery Can not set timeout
type: AnsweredQuestion
has body: So I have a data table which has two columns, one column contains an anchor the other an image. This is what I need to do. Click the first link, open it in a new tab. wait some time, close the tab continue on to the next. This is what I have so far. I will not I an very new to this javascript and jQuery stuff. So with this I can get the list of anchors and click anyone I want, problem is that it opens in a new window and using .attr('target', '_blank') has not worked for me. $("#tables").find('a').get(0).click() After the anchor is clicked the anchor will disappear on page load, so I only ever really need to know where the first anchor is. So this is what I need. Click anchor 0, wait 30s close opened tab, refresh, repeat until no anchors are found. This is what I am working with so far. function clickAds() { if ($("#tables").find('a').length &gt; 0) { $("#tables").find('a').get(0).click(); setTimeout(clickAds() 35000); location.reload() }; clickAds() I have edited my problem and now have code that clicks the same link over and over again until chrome chrashes. I can not get the timeout to work! Does anyone have any idea as to why?
accepted answer: http://stackoverflow.com/a/28257285
score: 1
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44872589
has answer: http://stackoverflow.com/a/28257285

http://stackoverflow.com/a/28275413
answers question: http://stackoverflow.com/q/28275208
has comment: http://stackoverflow.com/comment/44905829
has comment: http://stackoverflow.com/comment/44906878
has comment: http://stackoverflow.com/comment/44906313
score: 0
has body: You can set a hidden input field: <input type="hidden" name="php_sess" value="<?php echo $_SESSION['REF_NO']; ?>"> Approve Request So when you submit a form, $_REQUEST['php_sess'] will be populated in php.
type: Answer

http://stackoverflow.com/a/28125323
has body: Use grunt-karma to perform unit tests. You should have tests folder in your structure. Write unit test for this code in jasmine syntax. use beforeEach to use module in which your controller is. create variable and assign controller to it using $controller function. Take variable with controller and run expect on your method in it function. Thats it, run grunt test and see the results. Some explantation about writing in jasmine syntax. For mocking http data - that one used with $http service, use $httpBackend service in angular-mocks.js. This is fake backend in which you write for example get requests, and specify answers from this using whenGET() and expect. There are also other requests like POST, PUT. Basically after defining result expectation you use $httpBackend.flush() method to flush changes, so your would retrieve data. There are also end to end tests, which you can perform with protractor using selenium webdriver, but these are hard to integrate with grunt test, so you may run all tests as two commands. Note that end to end tests are not in jasmine syntax, so you write them different.
accepted answer of: http://stackoverflow.com/q/28125203
has comment: http://stackoverflow.com/comment/44624441
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28125203

http://stackoverflow.com/a/28248387
downvote count: 0
answers question: http://stackoverflow.com/q/28248337
type: Answer
has body: The recursion is broken because each invocation reuses the same i variable in the for-loop. To fix this, replace your line with: for (var i = 0; ... ) This is because when you assign to a variable without using var, it is treated as a global variable. This is a quirk specific to JavaScript, but not most other languages. In the future, you can catch these problems by putting this line at the top of your JavaScript code: "use strict";
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44857082

http://stackoverflow.com/a/28251952
has comment: http://stackoverflow.com/comment/44889404
score: 0
has comment: http://stackoverflow.com/comment/44880683
has body: After modifying your second-version it works. I've tested it in all browsers. Sorry for not code-refactoring, but I think you cope with this now :) &lt;!-- -------------------------------------------------------- SECOND VERSION --&gt; &lt;script&gt; $(document).ready(function(){ $('#defaultCountdown3').countdown({until: 0, onTick: highlightLast5}); var teraz = Date.now(); var zapisanyCzas = localStorage.getItem("defaultCountdown3"); if (zapisanyCzas !== null &amp;&amp; teraz &lt; +zapisanyCzas) { var restTime = secDiff(teraz, +zapisanyCzas); console.log(restTime); $("#YourButton3").prop('disabled',true); $('#defaultCountdown3').removeClass('highlight').countdown('option', {until: Math.round(restTime), onExpiry: countdownFinished}); } else { localStorage.removeItem("defaultCountdown3"); } function highlightLast5(periods) { if ($.countdown.periodsToSeconds(periods) === 5) { $(this).addClass('highlight'); } } $('#YourButton3').click(function() { localStorage.setItem("defaultCountdown3", Date.now() + 60 * 1000); $('#defaultCountdown3').removeClass('highlight').countdown('option', {until: 60, onExpiry: countdownFinished}); $("#YourButton3").prop('disabled',true) }); function countdownFinished(){ // Finished - disable your button localStorage.removeItem("defaultCountdown3"); $("#YourButton3").prop('disabled',false) } function secDiff(start, end){ var diff = Math.abs(start-end); return (diff/1000); } }); &lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $('#defaultCountdown4').countdown({until: 0, onTick: highlightLast5}); var teraz = Date.now(); var zapisanyCzas = localStorage.getItem("defaultCountdown4"); if (zapisanyCzas !== null &amp;&amp; teraz &lt; +zapisanyCzas) { var restTime = secDiff(teraz, +zapisanyCzas); console.log(restTime); $("#YourButton4").prop('disabled',true); $('#defaultCountdown4').removeClass('highlight').countdown('option', {until: Math.round(restTime), onExpiry: countdownFinished}); } else { localStorage.removeItem("defaultCountdown4"); }…
has comment: http://stackoverflow.com/comment/44883083
has comment: http://stackoverflow.com/comment/44888836
type: Answer
has comment: http://stackoverflow.com/comment/44867842
has comment: http://stackoverflow.com/comment/44881210
has comment: http://stackoverflow.com/comment/44883284
answers question: http://stackoverflow.com/q/28250682
has comment: http://stackoverflow.com/comment/44884475
accepted answer of: http://stackoverflow.com/q/28250682
type: AcceptedAnswer

http://stackoverflow.com/comment/44748347
type: Comment
has text: http://caniuse.com/
type: QuestionComment
comment on: http://stackoverflow.com/q/28190306
score: 4

http://stackoverflow.com/q/28226233
type: Question
accepted answer: http://stackoverflow.com/a/28226266
has comment: http://stackoverflow.com/comment/44815739
tagged with: javascript
has comment: http://stackoverflow.com/comment/44815689
score: 0
has answer: http://stackoverflow.com/a/28226266
tagged with: regex-lookarounds
has body: Why does my JavaScript regular expression not work? var regexp = /^[1-9a-zA-Z][0-9a-zA-Z ]*$/; console.log(regexp.test('sfdf sfdf')); The rule is simple: the string must start with any number (0-9) followed by any number(s) and/or letter(s) and must allow whitespace. Some valid examples: 202Ab second text and maybe more 333333 second text and maybe more 202aaa second text and maybe more 23B second text and maybe more Invalid example: a202 second text and maybe more Second text and maybe more
answer count: 1
tagged with: jquery
has title: Regex first portion starts with number
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44815730

http://stackoverflow.com/q/28155794
type: UnansweredQuestion
tagged with: css
score: 1
has comment: http://stackoverflow.com/comment/44686210
has body: I am creating a schedule page for a college tutoring center. In order to keep it a bit more readable, I am using the rowspan attribute for sessions that occur on the same date. In some cases, I also have the same courses with multiple sessions on the same day as well. Below is a sample table: &lt;table class="schedule"&gt; &lt;tr class="tableheader"&gt; &lt;th scope="col"&gt;Day&lt;/th&gt; &lt;th scope="col"&gt;Courses&lt;/th&gt; &lt;th scope="col"&gt;Times&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th scope="rowgroup" rowspan="3"&gt;Monday&lt;/th&gt; &lt;td&gt;All CHEM&lt;/td&gt; &lt;td&gt;10:10 a.m. - 1:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CHEM 120-152&lt;/td&gt; &lt;td&gt;4:30 p.m. - 6:30 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;All Chem&lt;/td&gt; &lt;td&gt;7:10 p.m. - 9:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th scope="rowgroup" rowspan="2"&gt;Tuesday&lt;/th&gt; &lt;td&gt;CHEM 120-152 &amp;amp; 272&lt;/td&gt; &lt;td&gt;10:10 a.m. - 2:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;All CHEM&lt;/td&gt; &lt;td&gt;6:10 p.m. - 9:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th scope="rowgroup" rowspan="3"&gt;Wednesday&lt;/th&gt; &lt;td rowspan="2"&gt;CHEM 120-152 &amp;amp; 272&lt;/td&gt; &lt;td&gt;10:10 a.m. - 12:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1:10 p.m. - 2:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;All CHEM&lt;/td&gt; &lt;td&gt;3:10 p.m. - 6:00 p.m.&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; How would I be able to highlight an entire row including the parent elements that use rowspan using jQuery? I found a partial solution the works generally, but when the courses column has a rowspan attribute it tends to break except on the first child. A lot of solutions I have seen do not take the TH tag into account which must be there per Section 508 which I must adhere to as much as possible.
has title: How Can I Highlight Rows with TH and TD Tags with Rowspan Attribute?
type: Question
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44683622
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28155832

http://stackoverflow.com/q/28197338
has answer: http://stackoverflow.com/a/28309800
score: 0
answer count: 1
tagged with: intel-xdk
tagged with: javascript
type: UnansweredQuestion
has body: I am trying to create an android application using IntelXDK and when it runs on a simulator it works fine, but when I try and run it on a physical device none of the native features work. I have included this code in my head tag: &lt;script src="intelxdk.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="cordova.js" type="text/javascript"&gt;&lt;/script&gt; And I am trying to use this (which is the code off of their website: https://software.intel.com/en-us/node/493021) in the body intel.xdk.device.launchExternal('http://www.google.com'); However nothing happens when the link is clicked I have included the device plugin as shown below: Thanks in advance!
has comment: http://stackoverflow.com/comment/44765037
has comment: http://stackoverflow.com/comment/44785700
type: Question
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has title: IntelXDK native bridge not working
has comment: http://stackoverflow.com/comment/44783821

http://stackoverflow.com/comment/44830611
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28221266
type: Comment
has text: I'm getting Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/DPC/workspaces/automation/dpc-login-plugin/timelines/timeline.json' on the console.

http://stackoverflow.com/comment/44891096
score: 1
comment on: http://stackoverflow.com/q/28262940
has text: Under the hood c3 is using a `d3.xhr` to retrieve the data. This is an async call meaning that it's outside of your `try` block.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28206020
has comment: http://stackoverflow.com/comment/44777653
upvote count: 2
answers question: http://stackoverflow.com/q/28205914
has comment: http://stackoverflow.com/comment/44777754
score: 2
has comment: http://stackoverflow.com/comment/44777700
has body: When you use route resolve argument as dependency injection in the controller bound to the route, you cannot use that controller with ng-controller directive because the service provider with the name HttpResponse does not exist. It is a dynamic dependency that is injected by the router when it instantiates the controller to be bound in its respective partial view. Just remove the ng-controller="DealerLeads" from the view and make sure that view is part of the html rendered by the state leads @ templateUrl: "views/leads.html",. Router will bind it to the the template for you resolving the dynamic dependency HttpResponse. If you want to use controllerAs you can specify that in the router itself as:- controller: 'DealerLeads', controllerAs: 'leads' //Not sure if this is supported by ui router yet or controller: 'DealerLeads as leads', Also when you do: .state('leads', { url: "/leads", templateUrl: "views/leads.html", data: { pageTitle: 'Dealer Leads' }, controller: 'DealerLeads', resolve: DealerLeads.resolve }) make sure that DealerLeads is accessible at the place where the route is defined. It would be a better practice to move the route definition to its own controller file so that they are all in one place. And whenever possible especially in a partial view of a route it is better to get rid of ng-controller starting the directive and instead use route to instantiate and bind the controller for that template. It gives more re-usability in terms of the view as a whole not being tightly coupled with a controller name and instead only with its contract. So i would not worry about removing ng-controller directive where router can instantiate the controller.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28205914

http://stackoverflow.com/comment/44895552
type: QuestionComment
comment on: http://stackoverflow.com/q/28269651
type: Comment
has text: Thats true, but as I was using this http://jquery.malsup.com/form/#getting-started You just set content here, json_encode data in PHP and it works. SO I hope that setting JSON output for jQuery would work. So, is the ONLY option to set the header?
score: 0

http://stackoverflow.com/q/28131736
score: 1
type: Question
tagged with: javascript
tagged with: passport.js
tagged with: callback
has body: I have a function findOrCreateUser that returns a generator. But I need to call a callback done when the function has completed. How do I do this? I tried calling next() on the generator but the result was pending. passport.use(new FacebookStrategy({ clientID: fbConfig.appId, clientSecret: fbConfig.appSecret, callbackURL: 'http://localhost:' + (process.env.PORT || 3000) + '/auth/facebook/callback' }, function(token, tokenSecret, profile, done) { var user = yield userRepository.findOrCreateUser( profile.id, profile.name, 'pic'); return user; }) );
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28131880
has title: How do I wait for a yield?
accepted answer: http://stackoverflow.com/a/28131880
upvote count: 1
tagged with: node.js
tagged with: generator
type: AnsweredQuestion

http://stackoverflow.com/a/28138825
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: You can try to use the onSliderLoad and the onSlideAfter option of bxSlider to add a class to the current slide: onSliderLoad: function () { $('.slider4 &gt; div:not(.bx-clone)').eq(1).addClass('active'); }, onSlideAfter: function ($slideElement, oldIndex, newIndex) { $('.slide').removeClass('active'); $($slideElement).next().addClass('active'); } After you manage to add an 'active' class to the active slide, it's just a matter of CSS: .slide:not(.active){ opacity:0.8; } The above examples are from memory (pseudo-code) and are not intended as a copy-paste solution.
has comment: http://stackoverflow.com/comment/44649971
answers question: http://stackoverflow.com/q/28138675
has comment: http://stackoverflow.com/comment/44649514
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28138675

http://stackoverflow.com/comment/44739968
has text: This can help you http://www.html5rocks.com/en/tutorials/file/dndfiles/
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28185571
type: Comment

http://stackoverflow.com/comment/44722022
has text: So where did you define `$`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28176444

http://stackoverflow.com/q/28224411
has answer: http://stackoverflow.com/a/28295157
type: Question
tagged with: cucumber
tagged with: protractor
tagged with: javascript
has body: How do you allocate more memory when running cucumber-js tests from the command line? Is there a specific tag or would you do it in your step-def files?
score: 0
answer count: 1
tagged with: cucumberjs
has title: Allocate more memory cucumber-js
type: UnansweredQuestion
tagged with: selenium

http://stackoverflow.com/comment/44647072
has text: Mor Haviv: In this simple example I need to pass just one variable. But in reality I need to receive whole data from PHP (name, address, postcode etc.) and then paste the data as a few inputs. Is there any way to receive a array from PHP or this need to be done in different way?
score: 0
comment on: http://stackoverflow.com/q/28137386
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/85710712
score: 0
type: AnswerComment
type: Comment
has text: A variation of this worked for me when building an app at glitch.me. I used `app.set('trust proxy', true)` based on [this documentation](http://expressjs.com/en/api.html#trust.proxy.options.table) The link you provided is redirected to the top of the express API documentation page. I'm sure it's just because the page has changed since you posted this answer.
comment on: http://stackoverflow.com/a/28186596

http://stackoverflow.com/comment/44761977
has text: In some cases as suggested by David, it will decrease font-size, not increase it
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28197743
type: AnswerComment

http://stackoverflow.com/q/28184475
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28184609
type: AnsweredQuestion
has title: How do I hide a div when another divs are present?
tagged with: hide
type: Question
has answer: http://stackoverflow.com/a/28184564
accepted answer: http://stackoverflow.com/a/28184564
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28184609
has answer: http://stackoverflow.com/a/28184917
score: 0
answer count: 3
has body: Lately I've been trying to watch/study javascript and got interested in this certain program since I know I'll be able to use it a lot in the future. I've seen a tutorial on youtube on how to "hide/show" a div so I tweaked it and made it "show/hide" div's and added two more div's. My problem is I wanted to hide other open div's when I want to show a specific one since my code now shows all of the div's regardless of the present ones. First Name Add Edit Delete Add First Name: Edit First Name: Delete First Name:
tagged with: show
linked to: http://stackoverflow.com/q/602168
has comment: http://stackoverflow.com/comment/44737978

http://stackoverflow.com/q/28139016
score: 0
type: AnsweredQuestion
tagged with: twitter-bootstrap
has body: Here is the code &lt;script type="text/javascript"&gt; window.setTimeout(function() { $("#alert_message").fadeTo(500, 0).slideUp(500, function(){ $(this).remove(); }); }, 10000); &lt;/script&gt; &lt;div id="alert_message" class="alert" style="width:100%;" &gt; &lt;span&gt;If download button does not work. Right click on the meme and click save as...&lt;/span&gt;&lt;span class="close" style="float:right;" data-dismiss="alert"&gt;&amp;times;&lt;/span&gt; &lt;/div&gt; Now on page load the alert appears. I wrote the following code to make it appear again on click of a check box. else if(document.getElementById('31').checked) { src = 'http://qph.is.quoracdn.net/main-qimg-7212ce8aa821a3af3d91ee709f3fd7f1?convert_to_webp=true'; $( "#alert_message" ).toggle(); } It does not become visible again with this code.
type: Question
has answer: http://stackoverflow.com/a/28139393
has title: Showing an alert in bootstrap is not working
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28139393

http://stackoverflow.com/comment/44627750
score: 0
type: Comment
type: QuestionComment
has text: I am obviously not the only one. After all you have posted this several times before. I even suggested you scale the demo down to it's simplest form which didn't seem to happen. You may know this widget inside out...we don't
comment on: http://stackoverflow.com/q/28127036

http://stackoverflow.com/q/28168471
tagged with: iron-router
has answer: http://stackoverflow.com/a/28169491
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28171794
type: Question
has title: Single view page permalink empty with Iron Router
has answer: http://stackoverflow.com/a/28171507
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28171507
score: 0
possible better answer: http://stackoverflow.com/a/28171794
answer count: 3
tagged with: meteor
has body: I've set up two routes in Iron-Router: 'home' (a paged list of all post) and 'doc' (a detail view). The home page loads just fine, but the detail view can only be loaded if the home page has been viewed previously. Otherwise it will render empty – and it can't be used as a permalink. This will always load: http://localhost:3000/ This will only load if 'home' has been viewed before: http://localhost:3000/doc/tZFawq8cgf43hZBaJ the routes: Router.map(function() { this.route('home', { path: '/' }); this.route('doc', { path: '/doc/:_id', data: function() { return MyPix.findOne({_id: this.params._id}); } }); }); the doc template: &lt;template name="doc"&gt; &lt;h1&gt;{{this.name}}&lt;/h1&gt; &lt;img src="{{ this.url store='OriginalRetinaPix' }}" width="{{ this.metadata.width }}" height="{{ this.metadata.height }}" /&gt; &lt;/template&gt; publish/subscribe: Meteor.publish('MyPix', function(cursor) { Counts.publish(this, 'numberOfPosts', MyPix.find(), { noReady: true }); return MyPix.find({}, {sort: {uploadedAt: -1}, limit: 4, skip: cursor}); }); if(Meteor.isClient) { Session.setDefault('docCursor', 0); console.log('docCursor: ' + Session.get('docCursor')); Meteor.autorun(function(){ Meteor.subscribe('MyPix', Session.get('docCursor')); }) } btw: the project on GitHub

http://stackoverflow.com/comment/44795544
score: 2
has text: nop. O(n^2) = O((n^2)/2), becouse 1/2 is a constant, even though the later is more precise, it is true to say O(n^2)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28214257

http://stackoverflow.com/comment/44621173
type: Comment
comment on: http://stackoverflow.com/q/28123766
has text: http://developer.android.com/reference/android/webkit/WebSettings.html#setMediaPlaybackRequiresUserGesture(boolean) WebView.getSettings().setMediaPlaybackRequiresUserGesture(false)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44712933
type: QuestionComment
has text: Hi, does the code work properly now? If so, please post it as an answer so that the question can be marked as resolved. Thanks!
comment on: http://stackoverflow.com/q/28123525
score: 0
type: Comment

http://stackoverflow.com/q/28153407
answer count: 1
tagged with: mapbox
has title: mapbox geojson properties not available on hover
accepted answer: http://stackoverflow.com/a/28154845
type: AnsweredQuestion
tagged with: leaflet
tagged with: geojson
type: Question
tagged with: javascript
has body: I'm using mapbox and loading multiple geojson layers on to the map, like so: ... var aLayer = L.mapbox.featureLayer('/a.geojson'); var bLayer = L.mapbox.featureLayer('/b.geojson'); var cLayer = L.mapbox.featureLayer('/c.geojson'); var layers = { LayerA: aLayer, LayerB: bLayer, LayerC: cLayer } ... layers.LayerA.addTo(map).on('ready', function(e) { map.fitBounds(LayerA.getBounds(), {animate: true}); }); L.control.layers(layers).addTo(map); Each geojson feature contains a number of properties; the title and description display correctly within the tooltips, for instance. Where I'm having trouble is accessing these properties with other interactions. I'm adjusting the style of each polygon on hover, like so: LayerA.on('mouseover', function(e) { e.layer.setStyle({ weight: 2, fillOpacity: 0.7 }); if (!L.Browser.ie &amp;&amp; !L.Browser.opera) { e.layer.bringToFront(); } }); LayerA.on('mouseout', function(e) { e.layer.setStyle({ weight: 0.5, fillOpacity: 0.5 }); }); Any attempt to access the properties within the interactions, via e.layer or e.target, fails. I assume the tooltip working means they are available, but can't work out where I've gone wrong...?
has answer: http://stackoverflow.com/a/28154845
score: 0

http://stackoverflow.com/comment/44778096
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28178386
type: AnswerComment
has text: @dognose i have tried your code but still error is there

http://stackoverflow.com/q/28124367
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
has body: I have 3 contenteditable divs in on page. I need one of them to have inline ckeditor toolbar. But when I use the following lines in code in order to hide ckeditor toolbar, ckeditor is disabled for all of them. If I enable the inline editing all of the divs have the ckeditor toolbar. // disable inline editing of ckeditor. CKEDITOR.disableAutoInline = true; What am I supposed to do?
type: Question
score: 1
has title: How to enable and disable ckeditor inline toolbar in the same page?
has answer: http://stackoverflow.com/a/28124988
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: ckeditor
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/44782758
type: QuestionComment
comment on: http://stackoverflow.com/q/28208693
score: 2
type: Comment
has text: http://jsonlint.com/

http://stackoverflow.com/comment/44789325
type: Comment
type: QuestionComment
has text: the problem might come from your `description` call. `replacePlaceHolder("foo \n bar")` doesn't throw any error for me. try to add `console.log(description);` before `return` and make sure you're passing a string to your func
score: 0
comment on: http://stackoverflow.com/q/28212644

http://stackoverflow.com/comment/44669086
type: QuestionComment
comment on: http://stackoverflow.com/q/28148588
has text: So, that's the solution? :P
score: 0
type: Comment

http://stackoverflow.com/a/28151374
answers question: http://stackoverflow.com/q/28151315
has comment: http://stackoverflow.com/comment/44674018
upvote count: 2
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44674076
score: 2
has body: $(function(){}) is just a shorter version of $(document).ready(function(){}); In the above function, this is document and for a function to be global, it needs to be in window context. Hoisting isn't your problem, the scope in which the function is declared, is. If it is used widely in the code and if it isn't part of some specific module or library you're building, then you can just declare the function in the global context or just make the function, the property of window, which makes it global. If it is some library or module then you can attach it to it making it specific to only that library/module. In short, use namespacing or make it global if you really use it lot many times and is a generic function.
has comment: http://stackoverflow.com/comment/44673982

http://stackoverflow.com/comment/44775578
score: 1
comment on: http://stackoverflow.com/a/28204748
type: AnswerComment
has text: ugh, what an idiot i feel now thinking about it. It's almost the same feeling I got when i realized my script didn't work because javascript treats months as 0-11. Thanks
type: Comment

http://stackoverflow.com/q/28272560
tagged with: themes
upvote count: 2
has comment: http://stackoverflow.com/comment/44900482
has answer: http://stackoverflow.com/a/28805290
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28805290
downvote count: 1
has comment: http://stackoverflow.com/comment/45883671
favorite count: 0
has comment: http://stackoverflow.com/comment/44900283
type: AnsweredQuestion
score: 1
has body: when i submit my Get request too large it showing me following error : Request-URI Too Large The requested URL\'s length exceeds the capacity limit for this server. Apache Server at c61.servage.net Port 80 Please Give me solution for this. May be my page is not loading properly.
tagged with: wordpress
type: Question
has title: Request-URI Too Large (414 error) in jarida theme
has comment: http://stackoverflow.com/comment/44900426
has comment: http://stackoverflow.com/comment/44901419
tagged with: javascript

http://stackoverflow.com/q/28196978
has comment: http://stackoverflow.com/comment/44760614
type: UnansweredQuestion
tagged with: animation
linked to: http://stackoverflow.com/q/6367339
has body: sorry am still learning JavaScript, read W3Cschools javascript and Jquery but there is a lot they don't teach. I am studying animation at the moment, how do I auto start this rather then wait for someone to click (event listener), I've attempted turning it into a function but I must be doing it wrong, also 1 more what does (Idx) mean, I understand (id) is Html ID element but not sure Idx, not easy to find on google. to read, event listener starts at 5th line from the bottom, and the shuffle cards is 6th line from top (not sure if that helps), original code is located here http://www.the-art-of-web.com/javascript/css-animation/ thanks for any help. Regards. William. var cardClick = function(id) { if(started) { showCard(id); } else { // shuffle and deal cards card_value.sort(function() { return Math.round(Math.random()) - 0.5; }); for(i=0; i &lt; 16; i++) { (function(idx) { setTimeout(function() { moveToPlace(idx); }, idx * 100); })(i); } started = true; } }; // initialise var stage = document.getElementById(targetId); var felt = document.createElement("div"); felt.id = "felt"; stage.appendChild(felt); // template for card var card = document.createElement("div"); card.innerHTML = "&lt;img src=\"/images/cards/back.png\"&gt;"; for(var i=0; i &lt; 16; i++) { var newCard = card.cloneNode(true); newCard.fromtop = 15 + 120 * Math.floor(i/4); newCard.fromleft = 70 + 100 * (i%4); (function(idx) { newCard.addEventListener("click", function() { cardClick(idx); }, false); })(i); felt.appendChild(newCard); cards.push(newCard);
has title: How to Autorun an onclick event
type: Question
has answer: http://stackoverflow.com/a/28197755
tagged with: javascript
has comment: http://stackoverflow.com/comment/44762119
has comment: http://stackoverflow.com/comment/44760845
has comment: http://stackoverflow.com/comment/44760653
score: 0
answer count: 1

http://stackoverflow.com/a/28159494
answers question: http://stackoverflow.com/q/28159425
score: 0
type: Answer
has body: Try putting the variable above var currentElement = this;

http://stackoverflow.com/comment/44740828
type: Comment
has text: *"By performance I of course mean execution performance (including lookup, scope traversal, etc..) "* There is none. Both definitions create the same kind of function object.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28185860

http://stackoverflow.com/comment/44679287
has text: please help me on this...
comment on: http://stackoverflow.com/q/28122218
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28179551
type: UnansweredQuestion
has title: ExpressJS routes how use and get differ
tagged with: node.js
has answer: http://stackoverflow.com/a/28179630
type: Question
tagged with: javascript
tagged with: express
score: 0
has body: I'm working on a ExpressJS site, my first one and I'm having trouble getting routes working. I have a app.js file that sets out the routes like this: app.use('/', routes); app.use('/users', users); app.use('/work', work); Then in my hjs layout page (I'm using Hogan as I don't like Jade) I have a link like this: Home Work Mobile Contact As you can see they are just simple href tags point to each route. Now my Work link doesn't work, I get a 404 error I was wondering if there is more to setting up routes like this in a ExpressJS site. Or am I trying to build a Express site like I would a static site. In the examples I've looked a lot of them have routes that show res.send() displaying text in the page or console, but nothing showing how to load a new view/html page. Am I setting up the app.use wrong? Stephen
answer count: 1

http://stackoverflow.com/q/28247734
tagged with: php
has comment: http://stackoverflow.com/comment/44856121
tagged with: laravel
has comment: http://stackoverflow.com/comment/44856318
has comment: http://stackoverflow.com/comment/44860376
has comment: http://stackoverflow.com/comment/44857861
has comment: http://stackoverflow.com/comment/44864750
has title: Argument controller is not function, got undefined at Error
has body: I'm using AngularJS + Laravel for my web-application. AngularJS install in public/app folder, the view for my web-application is not from public/app, is from Laravel/app/view folder. -views --web-app ---partials ---chat-rooms.blade.php --index.blade.php Index.blade.php Chat application {{ HTML::script('app/libs/angular/angular.min.js')}} {{ HTML::script('app/libs/angular-route/angular-route.min.js')}} {{ HTML::script('app/scripts/app.js')}} {{ HTML::script('app/scripts/controllers/chat-rooms.js')}} Chat-rooms.blade.php Select chat room Create My app.js is from public/app folder : 'use strict'; angular.module('chatApp', ['ngRoute']) .config(function($routeProvider) { $routeProvider .when('/', { templateUrl: 'partials/chat-rooms', controller: 'ChatRoomsCtrl' }) .when('/chat-room/:chatRoom', { templateUrl: 'partials/chat-room.html', controller: 'ChatRoomCtrl' }); }); The problem now is "ChatRoomsCtrl" cause this problem, the function is undefined. Here's the js: 'use strict'; angular.module('chatApp') .controller('ChatRoomsCtrl', function($scope, ChatRoom, $location) { var chatRoomsLoaded = function(chatRooms) { $scope.chatRooms = chatRooms; } var handleErrors = function(response) { console.error(response); } $scope.selectChatRoom = function(chatRoom) { $location.path('chat-room/' + chatRoom.id); } $scope.createChatRoom = function(chatRoom) { ChatRoom.create(chatRoom).then($scope.selectChatRoom); } ChatRoom.getAll() .then(chatRoomsLoaded) .catch(handleErrors); }); Again, everything seems work, the front-end can work, but the backends couldn't. The create button "ng-click" doesn't toggle at all. Seems like controller is causing this. Part of my index.blade.php is actually put inside my video template. My video template consist of videoController and route... VideoController public function getChatRoom() { return View::make('chat-app.partials.chat-rooms'); } Route Route::get('video/{slug}', array( 'as' => 'showVideo', 'uses' => 'VideoController@show' )); Route::get('vide…
has comment: http://stackoverflow.com/comment/44856301
answer count: 0
has comment: http://stackoverflow.com/comment/44856336
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44856255
tagged with: controller
type: Question
has comment: http://stackoverflow.com/comment/44856231
has comment: http://stackoverflow.com/comment/44865198
has comment: http://stackoverflow.com/comment/44856452
tagged with: angularjs
score: 0

http://stackoverflow.com/q/28197441
answer count: 0
type: UnansweredQuestion
tagged with: mysql
type: Question
has title: get data from table and fill text box depending on select value
has comment: http://stackoverflow.com/comment/44761606
has body: Suppose there is a table student: mysql> select * from student; +----+-------------+ | id | studentname | +----+-------------+ | 1 | jack | | 2 | mack | | 3 | rock | | 4 | john | +----+-------------+ 4 rows in set (0.02 sec) i have a view file that contains a form. Here i have a list where teacher gives marks to the students, so in the case I get data from table student and fill a text box.... After the user fills the form, Marks tables will be updated. form look like below: +----+-------------+--------+ | id | studentname | Marks | +----+-------------+--------+ | 1 | jack | | | 2 | mack | | | 3 | rock | | | 4 | john | | +----+-------------+--------+ after entry data form look like below: +----+-------------+--------+ | id | studentname | Marks | +----+-------------+--------+ | 1 | jack | 5 | | 2 | mack | 4 | | 3 | rock | 6 | | 4 | john | 8 | +----+-------------+--------+ after click submit data will insert into marks table.
has comment: http://stackoverflow.com/comment/44761400
score: 0
has comment: http://stackoverflow.com/comment/44761454
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: php

http://stackoverflow.com/q/28248683
type: Question
upvote count: 4
has body: I've tried big.js, bignumber.js, and decimal.js; they all work reasonably well up to a certain point, but fall short when I need to do arbitrary-precision calculations with large enough numbers of "odd" digits (my current test case is 31435517643980 * (1 / 31435517643980) === 1). I am open to any solution that allows me to process expressions like this, including calls to an external API. I'm currently looking at Wolfram|Alpha's API, but the 2000 calls/month limit is a restriction I'd like to avoid, because my application is going to be making quite a few calls. If this is the wrong SE site for this question, please let me know and/or move it.
accepted answer: http://stackoverflow.com/a/28248945
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: rounding-error
score: 4
has answer: http://stackoverflow.com/a/28248945
has title: Is it possible to achieve arbitrary-precision arithmetic with no rounding issues in JavaScript?
favorite count: 0
has comment: http://stackoverflow.com/comment/44865227
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44858154
tagged with: math

http://stackoverflow.com/a/28156538
upvote count: 1
answers question: http://stackoverflow.com/q/28156304
downvote count: 0
score: 1
has body: Here's one approach based on elements being children var $container =$('.container'); function wrapGroup( target, $container){ // wrap until next non group element var $groups = $container.children(target) if($groups.length){ $groups.first().nextUntil(':not('+target+')').andSelf().wrapAll('&lt;div class="group-wrap"&gt;') } // check if more group as children and do it again if($container.children(target).length){ wrapGroup( target, $container); } } //usage wrapGroup('.group', $container); DEMO
type: Answer

http://stackoverflow.com/q/28205324
upvote count: 1
has answer: http://stackoverflow.com/a/28205489
tagged with: ionic-framework
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28205489
favorite count: 0
tagged with: angularjs
has title: Angular Ionic Toggle Group
has body: I have a group of toggles for a phonegap app written with angular and ionic. The basic set is like this; html: Items {{ item.text }} Logout and js: angular.module('zpassApp') .controller('SettingsCtrl', ['$scope', '$http', '$rootScope', '$location', function($scope, $http, $rootScope, $location) { $scope.riderList = []; $scope.addRider = function(name, id, active) { $scope.riderList.push( { "text" : name, "checked" : active , "id" : id}); $scope.$apply(); }; $scope.updateRider = function() { console.log("in update rider how do I get the item.id!?" ); // I expect this to be selectedRider.id, but that is undefined // in jquery would be $(this)..data('id'); } function getRidersFromDB() { // this just queries db an populates, works fine... } can't seem to get to the id and state of the toggle that has changed. What is the correct way to do this?
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44817527
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28226800
has text: providing a working jsfiddle will let people easier on helping you
score: 0

http://stackoverflow.com/q/28190536
has answer: http://stackoverflow.com/a/28202673
upvote count: 0
has comment: http://stackoverflow.com/comment/44752138
type: Question
has title: Making sure old marker stay on top
score: -2
has body: I am trying to make a function to search the nearby location and make markers appear when click on a default marker. How do I ensure that the same marker would not appear or make sure that the marker does not get cover up by the new marker. This is my code: http://jsfiddle.net/fq57xf7e/ google.maps.event.addListener(marker, 'click', function(marker, i) { console.log(this.markerDataIndex,this.anotherDataIndex); infowindow.setContent(atm[this.markerDataIndex][this.anotherDataIndex][0]); infowindow.open(map, this); map.setCenter(new google.maps.LatLng(atm[this.markerDataIndex][this.anotherDataIndex][1], atm[this.markerDataIndex][this.anotherDataIndex][2])); map.setZoom(17); var man = new google.maps.LatLng(atm[this.markerDataIndex][this.anotherDataIndex][1], atm[this.markerDataIndex][this.anotherDataIndex][2]); var request = { location: man, radius: 200, types: ['shopping_mall','store'] }; placesList = document.getElementById('places'); var service = new google.maps.places.PlacesService(map); service.nearbySearch(request, callback); }); } } } function callback(results, status, pagination) { if (status != google.maps.places.PlacesServiceStatus.OK) { return; } else { createMarkers(results); if (pagination.hasNextPage) { var moreButton = document.getElementById('more'); moreButton.disabled = false; google.maps.event.addDomListenerOnce(moreButton, 'click', function() { moreButton.disabled = true; pagination.nextPage(); }); } } } function createMarkers(places) { var bounds = new google.maps.LatLngBounds(); for (var i = 0, place; place = places[i]; i++) { var tested = new google.maps.Marker({ map: map, title: place.name, position: place.geometry.location }); placesList.innerHTML += '&lt;li&gt;' + place.name + '&lt;/li&gt;'; } }
tagged with: javascript
tagged with: google-maps-api-3
downvote count: 2
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44756571
type: UnansweredQuestion

http://stackoverflow.com/comment/44814465
score: 0
comment on: http://stackoverflow.com/a/28225427
type: Comment
has text: Hi @CrayonViolent is there another reason why this tracking code will not work? Is it because of the snippets I've included?
type: AnswerComment

http://stackoverflow.com/q/28207288
has answer: http://stackoverflow.com/a/28207516
accepted answer: http://stackoverflow.com/a/28207652
possible better answer: http://stackoverflow.com/a/28207561
has answer: http://stackoverflow.com/a/28207561
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28207427
has comment: http://stackoverflow.com/comment/44780048
upvote count: 4
has body: I have a directive that receives whether an element should be required or not from a REST api. Right now, I can't seem to get the form to invalidate when an attribute is set to required. So, in essence I'm able to dynamically add the 'required' attribute from the directive below, but it doesn't invalidate the form. Looking through chrome I see that, even though the required attribute exists, a required entry in the $error array doesn't exist. app.directive('requireiftrue', function ($compile) { return { require: '?ngModel', link: function (scope, el, attrs, ngModel) { if (!ngModel) { return; } if(attrs.requireiftrue==="true"){ console.log('should require'); el.attr('required', true); $compile(el.contents())(scope); } else{ console.log('should not require'); } } }; }); Here's a jsfiddle to illustrate the problem. And, here's sample JSON returned from my rest API { race: false, martialStatus: true, } EDIT: While the accepted answer got me up and running, I still had a good bit of finagling to do. Namely: 1. Resolving a deferred promise to ensure that my form actually receives the required fields to validate 2. observing my 'requireiftrue' attribute My solution module config: function config($stateProvider) { $stateProvider .state('testState', { url: '/test/form', controller: 'TestCtrl', templateUrl: 'test/form/testForm.tpl.html', resolve: { formDefaultService: function getFormDefaults($q, dataservice) { // Set up a promise to return var deferred = $q.defer(); var myData = dataservice.getFormDefaults(); deferred.resolve(myData); return deferred.promise; //return } }, data: { pageTitle: 'Test Info' } }); } And, finally the directive / HTML that receives api data: Directive: .directive('requireiftrue', function ($compile) { return { require: '?ngModel', link: function (scope, el, attrs, ngModel) { if (!ngModel) { return; } attrs.$observe('requireiftrue', function(value){ if(value==="true"){ el.attr('required', true); el.removeAttr('requireiftrue'); $compile(el[0])(scope)…
has title: AngularJS dynamic required attribute in directive and form validation
has answer: http://stackoverflow.com/a/41308725
tagged with: validation
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28207652
favorite count: 0
tagged with: angularjs
answer count: 5
has comment: http://stackoverflow.com/comment/44779889

http://stackoverflow.com/q/28148455
score: 4
upvote count: 4
tagged with: canvas
tagged with: html5-canvas
answer count: 1
downvote count: 0
tagged with: data-url
favorite count: 0
has body: I work on an JS application which use canvas to manipulate a picture (i.e and convert to png/base64 with .toBlob() and .toDataURL(). I would use .transferControlToProxy() to let a worker do the job and get a smooth GUI. But it seems to be unsupported... as they said on Mozilla devs Some of you have other information ? Maybe a workaround ?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44673811
has comment: http://stackoverflow.com/comment/44668665
has answer: http://stackoverflow.com/a/32451366
type: Question
has title: How to use HTML5 and transferControlToProxy?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44684659

http://stackoverflow.com/comment/44876883
comment on: http://stackoverflow.com/a/28259616
has text: Thank you so much jack, can i have any example please
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44728544
type: AnswerComment
score: 0
type: Comment
has text: would that still work for elements that are loaded after an the document, for example the result of an ajax call?
comment on: http://stackoverflow.com/a/28165445

http://stackoverflow.com/a/28215528
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28215501
answers question: http://stackoverflow.com/q/28215501
type: AcceptedAnswer
has body: Change, from $(".submit").click(function() {}); To $("#submit").click(function(event) { event.preventDefault(); .... }); Element has id #submit, not class .submit
downvote count: 0
type: Answer
score: 3

http://stackoverflow.com/comment/81927597
type: QuestionComment
has text: Possible duplicate of [How can I trigger a Bootstrap modal programmatically?](https://stackoverflow.com/questions/11404711/how-can-i-trigger-a-bootstrap-modal-programmatically)
comment on: http://stackoverflow.com/q/28250009
score: 0
type: Comment

http://stackoverflow.com/comment/44796611
has text: @xc123e1 You can check multiple conditions in if stament
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28216128
type: AnswerComment

http://stackoverflow.com/comment/44913958
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28278580
type: Comment
has text: @Jens-AndréKoch Downvotes: "this answer is not useful". Nobody owes more of an explanation than that, stop posting such comments.

http://stackoverflow.com/q/28223183
has answer: http://stackoverflow.com/a/28223319
answer count: 4
type: AnsweredQuestion
has body: I'm trying to write a script that prints the names of the previous 12 months. Since this month is January, it should print: December November October September August July June May April March February January Instead, it prints March twice. http://jsfiddle.net/h69gm04g/2/ November October September August July June May April March March February HTML &lt;div id="test"&gt;&lt;/div&gt; Javascript monthNames = [ "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" ]; d = new Date(); for (i = 0; i &lt; 12; i++) { d.setMonth(d.getMonth() - 1); monthName = monthNames[d.getMonth()]; $('#test').append(monthNames[d.getMonth()] + "&lt;br&gt;"); } What am I doing wrong?
downvote count: 0
upvote count: 8
type: Question
accepted answer: http://stackoverflow.com/a/28223302
tagged with: javascript
has answer: http://stackoverflow.com/a/28223302
has answer: http://stackoverflow.com/a/28224984
has title: JavaScript: Print previous 12 months -- "March" prints twice?
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/28224991
possible better answer: http://stackoverflow.com/a/28223319
has comment: http://stackoverflow.com/comment/44809853

http://stackoverflow.com/comment/44845002
type: QuestionComment
comment on: http://stackoverflow.com/q/28241267
has text: What plugin are you using for constructing the tooltips?
score: 0
type: Comment

http://stackoverflow.com/comment/44994774
has text: @ChanX Did you put a console statement and check if your function is called at all?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28231351

http://stackoverflow.com/comment/44731104
type: Comment
has text: Use this guide as introduction to Generators: http://davidwalsh.name/es6-generators It's the best I know. @Bergi: you're so right, I've updated the answer.
comment on: http://stackoverflow.com/a/28165119
type: AnswerComment
score: 0

http://stackoverflow.com/a/28195539
answers question: http://stackoverflow.com/q/28195124
score: 0
type: Answer
has body: Is this a typo, looks like an extra open parens "(" before data ).success((data, status) -&gt;

http://stackoverflow.com/q/28222322
tagged with: javascript
has comment: http://stackoverflow.com/comment/44810266
tagged with: flash
upvote count: 1
has comment: http://stackoverflow.com/comment/44813516
answer count: 1
favorite count: 0
tagged with: actionscript-3
has title: Hide Javascript inside SWF file
accepted answer: http://stackoverflow.com/a/28226319
has comment: http://stackoverflow.com/comment/44809921
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28226319
downvote count: 0
score: 1
has body: Instead of hidding my .JS using low criptography, I would prefer using a .SWF file to hide my .JS. The problem is i have no knowledge in ActionScript 3, so i was thinking that maybe someone could give me a light in the end of the tunnel and tell me what APP i have to download to program the Swf file and what code i have to use for it to work. If somebody haven't undestood i'll make it clear: I want to call Javascript using a SWF file. Thank you, sorry for the bad english and good bye.
type: Question
has comment: http://stackoverflow.com/comment/44810789

http://stackoverflow.com/comment/44790611
type: Comment
comment on: http://stackoverflow.com/a/28212039
type: AnswerComment
has text: Thanks. Although this resizes the test div to parent div size. I guess resizing parent div dynamically is not possible.
score: 0

http://stackoverflow.com/comment/44894201
type: QuestionComment
has text: TypeError: val.attachments[0] is undefined
comment on: http://stackoverflow.com/q/28268982
score: 0
type: Comment

http://stackoverflow.com/q/28197528
has title: MixedContent when I'm loading https page through ajax, but browser still thinks it's http
answer count: 2
has comment: http://stackoverflow.com/comment/44770539
linked to: http://stackoverflow.com/q/13556772
downvote count: 0
score: 7
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 7
has answer: http://stackoverflow.com/a/30308701
tagged with: restangular
has answer: http://stackoverflow.com/a/35134088
has body: After Installing SSL Cert on a web page, I had the problem where the page served with https would require http endpoint with ajax. I'm using restangular, and I changed the base url to have https. var uri = location.protocol + "//" + location.host; RestangularProvider.setBaseUrl(uri); The interesting part is that, when I see the request in the chrome developer tools i see Request URL:https://theaddress.com/api/endpoint Request Headers Provisional headers are shown Accept:application/json, text/plain, */* Referer:https://theadress.com/somepage User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36 X-Requested-With:XMLHttpRequest So the request should be an https one, yet I still get: Mixed Content: The page at 'https://theaddress.com/somepage' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://theadress.com/api/endpoint'. This request has been blocked; the content must be served over HTTPS. Also I should mention, this happens on prod server, but on my local test it works fine ( I have self signed ssl cert ) after I have made it use base url that includes https. What could be the problem?
tagged with: https
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44786701

http://stackoverflow.com/comment/44671424
type: Comment
score: 0
has text: sorry for my question i am so dumb
comment on: http://stackoverflow.com/a/28150096
type: AnswerComment

http://stackoverflow.com/comment/44691781
type: QuestionComment
type: Comment
has text: You're misunderstanding garbage collection. That probably won't help. (unless you're storing & dropping lots of object, in which case it still won't help)
comment on: http://stackoverflow.com/q/28160147
score: 0

http://stackoverflow.com/comment/44868349
type: AnswerComment
has text: Sorry yes i had an error when i pasted here, i forget ]} at the end, the problem is when i call to JSON since the function "rellenarJson" and then i use the array variable "playasArray" in setMarkers(map,playasArray) doesn't work, i don´t know why work if i complete the array manually like you do it, and doesn´t work if i use a function to complete the array since the external json!! why??? thanks so much again!!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28254398

http://stackoverflow.com/comment/44782300
has text: FYI, you are working with JavaScript objects and arrays (and their literal representation). This has nothing to do with JSON at all. JSON is a *language-independent, textual data-exchange format*.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28208693

http://stackoverflow.com/a/28184852
type: Answer
answers question: http://stackoverflow.com/q/28184807
score: 0
has body: You can add use .eq() - it uses 0 based index so to target 6th img, you need to use index as 5 $(function () { var $imgs = $(".shopbar_smallimg_container img"); if ($imgs.length &gt; 6) { $imgs.eq(5).addClass('newclass') } })

http://stackoverflow.com/q/28258654
has answer: http://stackoverflow.com/a/28258681
accepted answer: http://stackoverflow.com/a/28258681
upvote count: 3
has comment: http://stackoverflow.com/comment/44875304
downvote count: 1
tagged with: javascript
tagged with: jquery
has title: Elegant solution to same height boxes
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/4804581
tagged with: css
possible better answer: http://stackoverflow.com/a/28258697
has body: I have three boxes in a row with different content in each. They are not the same height. Is there an elegant solution that does not involve absolute positioning to dynamically produce the same height on every box I would prefer not to use max-height because it is not dynamic for the future.
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28258697
has answer: http://stackoverflow.com/a/28258675
has comment: http://stackoverflow.com/comment/44875235
type: Question

http://stackoverflow.com/comment/44713779
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28169146
has text: What sets the size of the "map" divs? Do you really have multiple functions named "initialize"?
score: 0

http://stackoverflow.com/a/28181941
downvote count: 0
has body: You could use javascript to detect an empty date field and send an alert. Modifying the javascript should work. Try something like this: function calcAge(birthDate) { todaysDate = new Date(today); /*date of birth entered*/ var birthDate = new Date(givenDOB); var years = (todaysDate.getFullYear() - birthDate.getFullYear()); if (todaysDate.getMonth() &lt; birthDate.getMonth() || todaysDate.getMonth() == birthDate.getMonth() &amp;&amp; todaysDate.getDate() &lt; birthDate.getDate()) { years--; } return years; } function setAge() { var givenDOB = document.getElementById('dateof').value; if (givenDOB == "") { alert("Sorry, you must enter your date of birth!"); } else { var age = calcAge(givenDOB); if (age &lt; minAge) { alert("Sorry, the minimum age is 17!"); } else alert("Welcome!"); } } }
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28181795
accepted answer of: http://stackoverflow.com/q/28181795
score: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28273403
has title: mysql retrieve data, for each data append a new row
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28273547
accepted answer: http://stackoverflow.com/a/28273547
has answer: http://stackoverflow.com/a/28273585
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28274180
tagged with: http://stackoverflow.com/tag/html
has body: i'm doing a project for my school whereby i have to retrieve student works from database. On my home page, i have preset 10 div to hold the data returned from query. I preset it because i only need to retrieve 10 data. HTML Author Description Author Description Author Description Author Description Author Description Author Description Author Description Author Description Author Description Then i use jquery to query to my php to get back 10 data and place onto my 10 div Jquery /* Home Page Autoload featured thumbnails based on computer viewport/mobile viewport ================================================== */ $.ajax({ type: "POST", dataType: "json", url: "CMS/PHP/displayFeatThumbs.php", success: function(data) { // Display image thumbnail, caption & description of works onto each thumbnail div $('.viewport-computer .img_thumb_holder img').each(function(index, element) { // Work out the data to set var imageUrl = "cms/" + data[index].links; var captionHtml = "" + data[index].caption + " " + data[index].title + "" // Now apply this to the elements $(element).attr("src", imageUrl); // i must find a way to solve this $(element).parent().css('background-image', 'url("'+imageUrl+'")'); $(element).next().html(captionHtml); // push the caption & id into global variable array to be used on other functions easily captionArray.push(data[index].caption); idArray.push(data[index].id); homeLinksArray.push(data[index].links); homeTitleArray.push(data[index].title); }); }); It's working fine since i loop through my preset div(10 of them) and then place the data into each div.. Now i need to do a search bar function, and it will return me ALL the results(more than 50), and i have to display all of them, now the problem is that i only preset 10divs, so my workflow is not good for this so instead of my current loop through 10 div > retrieve data and place on 10 div i would like to retrieve all data, for each data, append a new div and place it i am not very good with php as i'm …
answer count: 4
favorite count: 0
score: 2
downvote count: 0
tagged with: php
has answer: http://stackoverflow.com/a/28273569
type: AnsweredQuestion
tagged with: mysql
possible better answer: http://stackoverflow.com/a/28273569

http://stackoverflow.com/a/28255951
has comment: http://stackoverflow.com/comment/45103253
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44871650
has body: You can use an IFrame to embed the webpage in your website. Check this Fiddle
answers question: http://stackoverflow.com/q/28254358
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28254358
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44871775

http://stackoverflow.com/q/28256484
upvote count: 2
accepted answer: http://stackoverflow.com/a/28306727
type: AnsweredQuestion
has title: How do you render multiple templates with one route controller using iron-router?
has body: URL to current version of my project Here is the code for my project Background: I am making a blog using meteor and iron-router. I want to use a single controller for several different "category pages," which filter a list a blog articles in the yield region. The Problem: The article list does not get rerendered when the URL changes. I.e. the article list is not reactive. Interestingly, if I navigate back to the home page, the correct article list shows up. The Question: How do I make that article list change when I change between different routes on the category route controller? Some example code: Please note that the code for this whole project is available here. Here is my Route Controller: CategoryController = RouteController.extend({ action: function(){ this.render(); }, template: 'category', data: function(){ return {category: this.params.category}; } }); CategoryController.helpers({ articles: function(){ return Articles.find({category: this.params.category}); } }); And here is the template it is rendering: {{category}}: {{#each articles}} {{#linkTo route="article.show"}} {{title}} {{/linkTo}} {{/each}} Resources/Updates: Read this article on Meteor Reactivity and the Deps Package. Very interesting, but after trying some Deps.autoruns in different places, I don't think that this is the answer. Currently trying to make different "category" routes inherit from the controller.
type: Question
tagged with: mongodb
score: 2
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28306727
tagged with: javascript
tagged with: meteor
favorite count: 0
tagged with: iron-router

http://stackoverflow.com/a/28122927
answers question: http://stackoverflow.com/q/28122617
downvote count: 0
type: Answer
upvote count: 6
has body: Try this: You are allowed to access certain values through mongoose. User.findOne({_id: id}, 'firstName lastName email location picture', function(err, user){ console.log(user); }); You just mention the fields needed, after the query. Hope it helps....
score: 6

http://stackoverflow.com/q/28270458
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28270576
has comment: http://stackoverflow.com/comment/44896723
has comment: http://stackoverflow.com/comment/44896956
tagged with: video
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: captcha
has comment: http://stackoverflow.com/comment/44896886
tagged with: javascript
has answer: http://stackoverflow.com/a/57138427
has body: YouTube, Vimeo or any other video service will do. I'm looking for a way of knowing that there is definitely a person watching a video. So far my best idea is to request a Captcha at intervals (say 30 seconds)... Is this possible?
has answer: http://stackoverflow.com/a/28270599
answer count: 3
has title: Is it possible to pause a video at intervals, and request a Captcha to continue playing?
has comment: http://stackoverflow.com/comment/44897342

http://stackoverflow.com/a/28275876
answers question: http://stackoverflow.com/q/28273321
has body: You can use css only brother. Example this is your form. error you can use the class .has-error to set a css codes. your css codes will only use if the error message is displayed. div{ overflow-y: scroll; } div .has-error{ height: 400px; } height will defend your current section height with errors message. Something like this on fiddle demo if the message is not visible on button click, add this to your click function code $( '#add_message_1' ).delay( 200 ).animate({scrollTop: 0 }, 300);}
score: 0
type: Answer

http://stackoverflow.com/comment/44688979
comment on: http://stackoverflow.com/q/28146407
has text: have you looked at using Web Workers ? each runs in its own independent thread - and transferring **HUGE** Transferable Object flavor of typed array's to/from any WW and browser is surprisingly snappy ... dunno how performant node-webkit is in keeping up with this browser technology however its already on all top shelf laptop browsers as well as thier lillipop android brothers
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44720657
type: QuestionComment
has text: What is ctrlOptions ?
comment on: http://stackoverflow.com/q/28175785
score: 0
type: Comment

http://stackoverflow.com/comment/44699939
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28164338
has text: compare the value calendar in onSelect at datepicker using [this solution](http://stackoverflow.com/questions/492994/compare-dates-with-javascript) . If calendar is not the result what you want ( in this case 3 days advance ) then call return
score: 0

http://stackoverflow.com/q/28153017
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44678826
has comment: http://stackoverflow.com/comment/44677606
tagged with: php
linked to: http://stackoverflow.com/q/6255344
has comment: http://stackoverflow.com/comment/44680741
score: 0
has comment: http://stackoverflow.com/comment/44677495
has comment: http://stackoverflow.com/comment/44677393
has body: Im fairly new to php and ajax. I am trying to pass along a variable from jquery to a php page that is loaded up in a modal window. I have php returning the table information for a bunch of users. Next to each users name, I have an edit button. I have jquery grabbing the data-id parameter of that button. $(document).ready(function() { $('.editButton').click(function(e){ e.preventDefault(); var getid = $(this).data('id'); Now I have a php form script that I want to load in a modal window when the "edit" button is clicked. The only way to do that is to make the button that opens the modal window an a tag and use href to call the php script. I want to pass along the variable "getid" to the php script that will use the value to run a query against the database to find the user that was clicked(the data-id parameter is generated by another php script which returns the id of that user). I tried many ways to send the ajax information to the external php script but no matter what I do, cant get it to work. Here is my ajax request: $.ajax ({ url: '/extschedule.php', data: {getid : getid}, type: 'POST', success: function(data) { alert('success'); } }).error(function() { Alert('Error'); Here is the php code on extschedule.php: $connection = mysqli_connect(stuff); $idVar = $_POST['getid']; $sqledit = "SELECT * from database WHERE id = (".$idVar.")"; $result = $connection-&gt;query($sqledit); while($row = $result-&gt;fetch_array(MYSQLI_ASSOC)){ $name = $row['name']; $id = $row['id']; $team = $row['team']; $language = $row['language']; $dedicatedHotel = $row['ded_hotel']; $satStart = $row['Sat_start_time']; $satEnd = $row['Sat_end_time'];..............yadda yadda I tried using if(isset($_POST['getid']))) but that causes a ton of issues on the php side. Ive searched around a while but still cannot get to any resolution. Can someone help me with this? Thanks in advance!
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44677556
has title: PHP not receiving Ajax post
has answer: http://stackoverflow.com/a/28153422
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44678520
has comment: http://stackoverflow.com/comment/44677638
tagged with: ajax
has comment: http://stackoverflow.com/comment/44677801
has comment: http://stackoverflow.com/comment/44677615
has comment: http://stackoverflow.com/comment/44677688
has comment: http://stackoverflow.com/comment/44677751
linked to: http://stackoverflow.com/q/10955017
has comment: http://stackoverflow.com/comment/44679290
has comment: http://stackoverflow.com/comment/44677674
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44677390
has answer: http://stackoverflow.com/a/28173321
has comment: http://stackoverflow.com/comment/44677659
has comment: http://stackoverflow.com/comment/44677466
has comment: http://stackoverflow.com/comment/44678255

http://stackoverflow.com/a/28225622
has comment: http://stackoverflow.com/comment/44814602
has body: "undefined" is a string, and undefined is a variable containing the primitive value undefined (Thank you elclanrs). if(typeof x === undefined) should only ever be able to return true if undefined is reassigned to a string matching the type of x.
has comment: http://stackoverflow.com/comment/44814415
has comment: http://stackoverflow.com/comment/44816137
has comment: http://stackoverflow.com/comment/44815987
has comment: http://stackoverflow.com/comment/44815838
has comment: http://stackoverflow.com/comment/44814894
type: Answer
has comment: http://stackoverflow.com/comment/44815182
has comment: http://stackoverflow.com/comment/44816069
has comment: http://stackoverflow.com/comment/44815097
has comment: http://stackoverflow.com/comment/44815999
has comment: http://stackoverflow.com/comment/44814684
has comment: http://stackoverflow.com/comment/44814810
has comment: http://stackoverflow.com/comment/44816035
has comment: http://stackoverflow.com/comment/44816087
has comment: http://stackoverflow.com/comment/44814458
upvote count: 1
has comment: http://stackoverflow.com/comment/44814847
has comment: http://stackoverflow.com/comment/44814863
downvote count: 1
has comment: http://stackoverflow.com/comment/44816181
has comment: http://stackoverflow.com/comment/44814566
has comment: http://stackoverflow.com/comment/44814585
has comment: http://stackoverflow.com/comment/44814581
has comment: http://stackoverflow.com/comment/44814789
has comment: http://stackoverflow.com/comment/44814914
has comment: http://stackoverflow.com/comment/44814921
has comment: http://stackoverflow.com/comment/44814450
has comment: http://stackoverflow.com/comment/44814814
has comment: http://stackoverflow.com/comment/44814802
score: 0
has comment: http://stackoverflow.com/comment/44814471
has comment: http://stackoverflow.com/comment/44815162
answers question: http://stackoverflow.com/q/28225571
has comment: http://stackoverflow.com/comment/44814722

http://stackoverflow.com/comment/44773995
type: Comment
comment on: http://stackoverflow.com/q/28163960
has text: @JK. thanks for the comments. I needed to change the today variable that I didn't know how to. A little bit of research and many tries finally got me going again. See my answer later. And yes I am moving it by 7 because I like to shows the dates by weeks.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44660857
has text: yes I do! I think that the problem is in the php file, when I try to print data before the call $.post('php/contact_me.php'.. ) I successfully can do that; but after the call, I can see nothing
comment on: http://stackoverflow.com/q/28144445
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44799479
score: 0
type: Comment
has text: You have to find the way to pass the number to the id attribute.. however you need to check jquery mobile and find something.. bye
type: AnswerComment
comment on: http://stackoverflow.com/a/28216262

http://stackoverflow.com/comment/44681210
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28154638
has text: @DarinDimitrov Wouldn't they work well together? Using Razor to initially load the html and data and expose a REST API for everything else? This would reduce the number of request to the service
type: Comment

http://stackoverflow.com/q/28157995
has body: On a page I have songs playing in a small audio player and the song change every 1-2 minutes or when I want them to(like a radio). Every song can be voted by users this way: &lt;span class='up'&gt;&lt;a href="" class="vote" id="&lt;?php echo $mes_id; ?&gt;" name="up"&gt;&lt;img src="up.png" alt="Down" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt; For upvote button, &lt;div class="totalvotes"&gt;&lt;/div&gt; for total votes and &lt;span class='down'&gt;&lt;a href="" class="vote" id="&lt;?php echo $mes_id; ?&gt;" name="down"&gt;&lt;img src="down.png" alt="Down" /&gt;&lt;/a&gt;&lt;/span&gt; for downvote button. Everything is working well but the page obviously will refresh when I click on one of the buttons to vote. The id="&lt;?php echo $mes_id; ?&gt;" from a element is what I need to be updated every 1-2 seconds because it gets the id of the current song playing. For the totalvotes the solution was using: function refresh_div() { jQuery.ajax({ url:'totalvotes.php', type:'POST', success:function(totalvotes) { jQuery(".totalvotes").html(totalvotes); } }); } t = setInterval(refresh_div,1000); It was easy because I created a div with a class and specified the class in the function. But I have no ideea how can I specify the ID of a "a" to be updated every second.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28158127
downvote count: 0
has comment: http://stackoverflow.com/comment/44687615
has comment: http://stackoverflow.com/comment/44687513
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/28158152
tagged with: http://stackoverflow.com/tag/html
score: 1
has answer: http://stackoverflow.com/a/28158088
has title: Update a href ID using Ajax
favorite count: 0
accepted answer: http://stackoverflow.com/a/28158127
possible better answer: http://stackoverflow.com/a/28158088
upvote count: 1
tagged with: php
answer count: 3

http://stackoverflow.com/a/28186596
has comment: http://stackoverflow.com/comment/85710712
type: Answer
downvote count: 0
has body: If you're proxying requests through something like Nginx, then you can configure express to respect the X-Forwarded-For header when getting req.ip: app.set('trust proxy', 'loopback'); http://expressjs.com/api.html#app.set
score: 7
accepted answer of: http://stackoverflow.com/q/28186395
answers question: http://stackoverflow.com/q/28186395
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/comment/44696987
has text: like to hear what you mean about that
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28162994

http://stackoverflow.com/comment/44859178
comment on: http://stackoverflow.com/a/28248877
type: AnswerComment
has text: I dont have any back end code...the site is all front end java html5 and css and this didnt seem to work for me....
score: 0
type: Comment

http://stackoverflow.com/q/28259754
tagged with: bit-manipulation
upvote count: 1
has answer: http://stackoverflow.com/a/28376158
type: AnsweredQuestion
tagged with: performance
score: 1
has comment: http://stackoverflow.com/comment/44877146
type: Question
has comment: http://stackoverflow.com/comment/44877809
downvote count: 0
has comment: http://stackoverflow.com/comment/44877174
answer count: 1
tagged with: javascript
has title: Efficiency of bitwise operation in Javascript
accepted answer: http://stackoverflow.com/a/28376158
favorite count: 0
has body: According to w3schools Unlike many other programming languages, JavaScript does not define different types of numbers, like integers, short, long, floating-point etc. JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard. So my question comes: if we want to perform a bitwise operation, how javascript translates that 64-bit IEEE 754 standard float to an ordinary 32-bit integer, and how efficient it is? From intuition, converting numbers will be costly, so will it still be more efficient to use bit shifting than multiply by 2n? Thank you very much!

http://stackoverflow.com/q/28194242
has answer: http://stackoverflow.com/a/28194344
has body: I have inherited a site from a new client who has a wordpress site that was heavily hand-coded by their previous webdev. The current code (in the header.php file) is: //When page loads... $(".tab").hide(); //Hide all content //Find URL location var idToShow = location.pathname.split("/")[1]; //If URL location is one of these, then show its proper menu. If it isn't just show the home's menu. if (idToShow == "unknown" || idToShow == "home" || idToShow == "parish" || idToShow == "formation" || idToShow == "school" || idToShow == "youth-ministry" || idToShow == "councils" || idToShow == "committees" || idToShow == "organizationsactivites" || idToShow == "contact") { $("#nav li."+idToShow).addClass("current").show(); //Activate first tab $("#"+idToShow).show(); } else { $("#nav li.home").addClass("current").show(); //Activate first tab $("#home").show(); } I am in the process of moving this site to a new host, and this works on the old host, but not the new host. I'm not sure where I could look for error logs (if there are any) or any other information that would help me solve this. Any ideas? Thanks!
has comment: http://stackoverflow.com/comment/44756367
score: 1
tagged with: wordpress
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44755377
has comment: http://stackoverflow.com/comment/44756573
tagged with: javascript
downvote count: 0
answer count: 1
has title: How to load different menu based on current page in wordpress?
favorite count: 0
has comment: http://stackoverflow.com/comment/44755969
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44755621
tagged with: php

http://stackoverflow.com/q/28257589
favorite count: 0
score: 35
answer count: 5
has answer: http://stackoverflow.com/a/28257649
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28257649
has answer: http://stackoverflow.com/a/28257651
tagged with: css
has comment: http://stackoverflow.com/comment/44873322
upvote count: 36
has answer: http://stackoverflow.com/a/28257658
has title: How to find a parent element width in JavaScript or jQuery?
has comment: http://stackoverflow.com/comment/44873339
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28257683
tagged with: javascript
has comment: http://stackoverflow.com/comment/44873385
possible better answer: http://stackoverflow.com/a/28257651
has body: I have a HTML code like this - &lt;div class="bs-example"&gt; &lt;input type="text" id="typehead" style="width: 500px;" class="form-control" placeholder="accounts" /&gt; &lt;input type="text" class="form-control" placeholder="accounts" /&gt; &lt;/div&gt; I have to find the width of the parent element having ID typehead. So in this case I have to find width of the div having class bs-example. I can't use ID in the upper div so that I can have the width of the element by ID because I want a re-usable code because it should be used many places in the page. What I have done is - function myFunction() { var x = document.getElementById("myLI").parentNode.parentElement.width; document.getElementById("demo").innerHTML = x; } But it is not working.
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28257619

http://stackoverflow.com/q/28278291
has answer: http://stackoverflow.com/a/28278662
has answer: http://stackoverflow.com/a/28278353
type: Question
has answer: http://stackoverflow.com/a/28278674
has answer: http://stackoverflow.com/a/28278374
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
accepted answer: http://stackoverflow.com/a/28278374
score: 0
has comment: http://stackoverflow.com/comment/44910761
tagged with: jquery-selectors
has body: can anyone please help? I have a HTML code like this. Hide Filter I try to add a .click event on li having id hide_filter. What I have done is- $("#hide_filter").click(function() { alert('message'); }); And - $(".navbar-left li").click(function() { alert(this.id); // id of clicked li by directly accessing DOMElement property alert($(this).attr('id')); // jQuery's .attr() method, same but more verbose alert($(this).html()); // gets innerHTML of clicked li alert($(this).text()); // gets text contents of clicked li }); And - $('ul.selectedItems li#hide_filter').click(function() { //$("p").hide(); alert('message'); }); And - $('#hide_filter')[0].click(function() { //$("p").hide(); alert('message'); }); But nothing works for me. Thanks in advance for helping..
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44910784
has comment: http://stackoverflow.com/comment/44910804
has answer: http://stackoverflow.com/a/28296260
has title: jQuery li element select by ID
answer count: 5
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44910767
possible better answer: http://stackoverflow.com/a/28278353

http://stackoverflow.com/comment/44627816
comment on: http://stackoverflow.com/a/28126525
type: Comment
has text: @klode Honestly, I have never used `$id()` but I think so. Basically, Angular automatically adds `$$hashkey` to each element in the `ng-repeat` in order to track them using the added `$$hashkey`. So, if you write `track by $id(item)`, this also tells Angular to track by `$$hashkey` again. Logically, it is equivalent. You can take a look at this [Video](https://www.youtube.com/watch?v=ZBwE0mNehx8) for more understanding and look at this [JsFiddle](http://jsfiddle.net/pygksyq0/5/).
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44894010
has text: Thank you very much , could you please tell me how to select the first tag value also ??
comment on: http://stackoverflow.com/a/28268988
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44895286
score: 0
comment on: http://stackoverflow.com/q/28269445
type: Comment
type: QuestionComment
has text: it can display haircolor or anyting.It's about can i bind THIS explicitly to this function in php..

http://stackoverflow.com/q/28144152
type: Question
downvote count: 0
tagged with: javascript
tagged with: watir
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: iframe
tagged with: selenium-webdriver
tagged with: watir-webdriver
has body: I have a read only text field inside an iframe to be filled. Please find the navigation below. URL is "http://www.broadwaylofts.com/apartments/unitLevel.do?lid=en_US&amp;pid=3015&amp;uid=1866117&amp;msud=Q%20&amp;adAction=initial" Click on "Monthly Price" button. You will be able to see a text box on overlay. I am trying to fill that text box but I am unable to Below are the ways I tried: b.iframe(:class => "lb_iframe_pricegrid").execute_script("window.document.getElementById('actionForm_moveindate').value = '03/20/2015';") It throws the following error Selenium::WebDriver::Error::JavascriptError: window.document.getElementById(...) is null b.execute_script("window.document.getElementById('actionForm_moveindate').value = '03/20/2015';") It throws the following error Selenium::WebDriver::Error::JavascriptError: window.document.getElementById(...) is null b.iframe(:class => "lb_iframe_pricegrid").text_field.set "02/20/2015" Below is the error I am facing Watir::Exception::ObjectReadOnlyException: object is read only {:tag_name=&gt;"input or textarea", :type=&gt;"(any text type)"} from /Library/Ruby/Gems/2.0.0/gems/watir-webdriver-0.6.10/lib/watir-webdriver/elements/element.rb:553:in `assert_writable' from /Library/Ruby/Gems/2.0.0/gems/watir-webdriver-0.6.10/lib/watir-webdriver/user_editable.rb:12:in `set' from (irb):19 from /usr/bin/irb:12:in `&lt;main&gt;' Any thoughts or suggestion that make it work?
score: 2
has answer: http://stackoverflow.com/a/28668012
has comment: http://stackoverflow.com/comment/44677121
has title: Unable to fill a text box which is read only and in iframe using watir webdriver

http://stackoverflow.com/a/28176153
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28175429
has body: So the problem here looks like you have defined the function getData() inside the Poller factory that makes the ajax request, but didn't bind that to a key inside the factory's returning object. Try adding this, return{ data: data, getData: getData } And then remove the getData() you have right before the returning block. Now I feel like depending on your app's setup, if you want to achieve long polling effects, you should attach getData() to a variable in some top-level controller that is always present so that you can invoke the getData() periodically using $timeout. Speaking of $timeout is that you should extract the $timeout outside of the getData() and so that the function itself simply makes the ajax request. More modular, single responsibility design that way, which makes that factory function more usable in other areas of your app if you ever need. If you want to update the information after you finish the ajax requests every five minutes, you should looking into $broadcast and $rootScope, you can basically tell your entire Angular app that some rootScope variable or service has changed, and they will update accordingly. You need some kind of callback set up after the ajax request inside whichever controller you are invoking the getData() function.

http://stackoverflow.com/comment/44928825
has text: You can check this link https://developers.google.com/google-apps/calendar/migration for calendar migration guide.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28262674

http://stackoverflow.com/comment/44830872
comment on: http://stackoverflow.com/q/28234599
score: 3
type: Comment
type: QuestionComment
has text: please use a fiddle.

http://stackoverflow.com/comment/44682030
comment on: http://stackoverflow.com/a/28155209
has text: no need for an extra `deferred`. `$.ajax` returns a deffered itself. A lot of people call this an anti-pattern for ajax
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/28179666
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28179793
tagged with: parse-platform
tagged with: http-redirect
accepted answer: http://stackoverflow.com/a/28179793
type: AnsweredQuestion
has title: Prevent main page from flashing before login-page redirect
type: Question
tagged with: javascript
has body: I feel like the solution will be simple. At least, I hope so. I've got index.html, which is my main page, and the first thing it checks is whether or not the user is logged in or not. var currentUser = Parse.User.current(); if (currentUser) { } else { window.location = "login"; } If the user isn't logged in, then he/she is redirected to the login page. The problem is that the main page flashes for a quick second before redirection. Of course, I understand that this is because checking whether or not the user is logged in takes just enough time to show the page for a split second. What's the best way to solve this? The ways I've thought of would probably still flash a page. (Turning the login page into index.html would probably flash the login page for a second).
score: 0

http://stackoverflow.com/comment/44716308
score: 1
comment on: http://stackoverflow.com/q/28173422
has text: why u cannot just remove all from unfiltered and then add all from filtered to unfiltered?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44661308
score: 1
has text: this is a known bug in ff https://bugzilla.mozilla.org/show_bug.cgi?id=629350
comment on: http://stackoverflow.com/q/28144668
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28227621
has comment: http://stackoverflow.com/comment/44818394
has comment: http://stackoverflow.com/comment/44818495
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/44818357
has comment: http://stackoverflow.com/comment/44818472
has comment: http://stackoverflow.com/comment/44818332
type: AnsweredQuestion
has title: Weird Decoded JavaScript Code
has comment: http://stackoverflow.com/comment/44818456
score: -2
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/44818317
has answer: http://stackoverflow.com/a/28228158
accepted answer: http://stackoverflow.com/a/28228158
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28228164
has comment: http://stackoverflow.com/comment/44818523
favorite count: 0
has body: In my journey to learn JavaScript I encountered today this strange code in a script that I'm trying to read its code and understanding. var j =["\\1A\\W\\1g","\\X\\S\\1p\\M","\\I\\G\\x\\H\\x\\H\\V\\I\\M","\\s\\W\\L\\1o\\z","\\W\\z\\W\\H","\\1v\\S\\1p\\1B\\T\\z\\1C\\G\\x\\I\\M\\G\\H\\V"]; I tried to console log the value of the j variable like this. console.log(j[1] + '' + j[2] + '' + j[3] + '' + j[4] + '' + j[5] + '' + j[6]); but unfortunately the console gave me an error which is "undefined". So is there any one can help me figure out how I can read this code.
has comment: http://stackoverflow.com/comment/44818310
has comment: http://stackoverflow.com/comment/44818560
has answer: http://stackoverflow.com/a/28228164
has comment: http://stackoverflow.com/comment/44818392

http://stackoverflow.com/comment/44908707
has text: @AshadShanto you are right, but with a simple validation he can do that
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28277145

http://stackoverflow.com/q/28154042
has answer: http://stackoverflow.com/a/28154432
type: AnsweredQuestion
has body: I have been trying to get my animation to work properly using AngularJS and animate.css. So, I created the SASS like this: .slide-animate { &.ng-enter, &.ng-leave{ } &.ng-enter { -webkit-animation: bounceIn 1s; -moz-animation: bounceIn 1s; -o-animation: bounceIn 1s; animation: bounceIn 1s; &.ng-enter-active { } } &.ng-leave { -webkit-animation: zoomOutLeft 1s; -moz-animation: zoomOutLeft 1s; -o-animation: zoomOutLeft 1s; animation: zoomOutLeft 1s; &.ng-leave-active { } } } When my page loads, I get the bounceIn animation and when I press a link, I get the zoomOutLeft animation, but the view that loads has no animation. If I reload that view when the browser loads, it does the bounceIn animation. Can someone tell me from that concise description what might be going wrong? my html just looks like this:
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28154432
score: 0
has comment: http://stackoverflow.com/comment/44680071
tagged with: css
tagged with: angularjs
tagged with: animation
has title: AngularJS ngAnimate and animate.css

http://stackoverflow.com/q/28182603
has comment: http://stackoverflow.com/comment/44735493
has answer: http://stackoverflow.com/a/28183615
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44734915
has comment: http://stackoverflow.com/comment/44735684
has comment: http://stackoverflow.com/comment/44734530
type: Question
has title: reduce array to a by grouping objects with same property
has answer: http://stackoverflow.com/a/28182742
tagged with: arrays
linked to: http://stackoverflow.com/q/28182367
tagged with: javascript
has body: I have an array of objects and I am trying to group them by similar property value. So lets say here is array [ { "size":"6.5", "width":"W" }, { "size":"6.5", "width":"M" }, { "size":"7.5", "width":"w" }, { "size":"8", "width":"M" }, { "size":"8", "width":"w" } ] and i am trying to get something like this [ { "size_new":"6.5", "width_group":[ "W", "M" ] }, { "size_new":"7.5", "width_group":[ "M" ] }, { "size_new":"8", "width_group":[ "w", "M" ] } ] My js looks like this var _x = []; for(var i = 0; i &lt; x.length; i++){ if(x[i].size == x[i+1].size){ _x[i] = { new_size: x[i].size, width_group: [x[i].width,x[i+1].width] } } } Here is my fiddle http://jsfiddle.net/sghoush1/ogrqg412/1/ I am pretty sure that there is probably a giant gaping hole in my logic
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44734466

http://stackoverflow.com/q/28142293
tagged with: karma-jasmine
has answer: http://stackoverflow.com/a/28142637
accepted answer: http://stackoverflow.com/a/28142637
answer count: 1
tagged with: jasmine
has body: I wrote an angular directive to manipulate the DOM on scroll and now I am trying to write a test in Karma/Jasmine but I am having trouble getting even a simple test to pass, but I haven't been able to find a solution I could apply to my situation. this is my directive: 'use strict'; angular.module('myApp.sticky', []) .directive('sticky', ['$window', '$anchorScroll', function($window, $anchorScroll) { return { restrict: 'A', link: function(scope, elm, attrs) { var atTop; scope.atTop = atTop; var stickyVal = elm.context.offsetTop; scope.sticky = function () { angular.element($window).bind("scroll", function() { if (angular.element($window).scrollTop() > stickyVal) { elm.css({position: 'fixed', top: '0px'}); if (elm.children().length === 1) { elm.append(elm.next().next()); } return true; } else { elm.css({position: 'static'}); return false; } }); }; scope.sticky(); } }; }]); and this is what I have so far for my test: 'use strict'; describe('myApp.sticky module', function () { var scope, element, directive, compiled, html; beforeEach(function () { module('myApp.sticky'); html = 'test'; inject(function ($compile, $rootScope) { scope = $rootScope.$new(); element = angular.element(html); compiled = $compile(element); compiled(scope); scope.$digest(); }); }); describe('sticky directive', function () { it('should exist', function () { expect(element).toBeDefined(); }); it('should set the element to a fixed position at a break point', function () { }); }); }); and this is what my terminal is giving me: Chrome 40.0.2214 (Mac OS X 10.10.1) myApp.sticky module sticky directive should exist FAILED TypeError: Cannot read property 'offsetTop' of undefined at link (/Users/meredithcapone/src/StickyChallenge/app/components/sticky/sticky-directive.js:12:34) at nodeLinkFn (/Users/meredithcapone/src/StickyChallenge/app/bower_components/angular/angular.js:6752:13) at compositeLinkFn (/Users/meredithcapone/src/StickyChallenge/app/bower_components/angular/angular.js:6146:13) at publicLinkF…
favorite count: 0
tagged with: angularjs
score: 2
type: AnsweredQuestion
tagged with: karma-runner
downvote count: 0
type: Question
has title: Angular/Karma TypeError: Cannot Read Property 'offsetTop' of Undefined
tagged with: javascript
upvote count: 2

http://stackoverflow.com/comment/44744449
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28187988
type: Comment
has text: For those who don't get it, `&para;` is the HTML entity for ¶. It might be your browser, have you tried in different ones?

http://stackoverflow.com/q/28245705
has comment: http://stackoverflow.com/comment/44853929
tagged with: javascript
linked to: http://stackoverflow.com/q/6396906
has title: Use the home directory in HTML code
answer count: 1
has comment: http://stackoverflow.com/comment/44852174
tagged with: home-directory
has body: I am using the script from "Peter Riber" here: How do I access and read a local file from html+javascript page running locally to display a local file on a html page. Basically, it uses an iframe where the source is the path to my local file: &lt;iframe id='iframe' src = '/PATH/TO/HOME/file.txt' onload='readfile()'&gt; &lt;/iframe&gt; and it also uses a "readfile" function. My question is: how to change in the HTML the hard-coded /PATH/TO/HOME/ in the src to the home directory? In bash you could use ~/ or $HOME. Please let me know if you also have an answer for Windows. Thank you.
has answer: http://stackoverflow.com/a/28245840
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/28245840

http://stackoverflow.com/q/28196979
tagged with: javascript
has title: Clicking cancel on confirmation box does not cancel the action
has comment: http://stackoverflow.com/comment/44760507
has comment: http://stackoverflow.com/comment/44761222
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44760918
has comment: http://stackoverflow.com/comment/44760539
tagged with: object
has comment: http://stackoverflow.com/comment/44760545
has answer: http://stackoverflow.com/a/28197074
type: Question
score: 0
has body: var Main = { addConfirmations: function() { var e = document.querySelectorAll(".bg-red"); for (var t = 0; t &lt; e.length; t++) { e[t].addEventListener("click", function() { var e = this.getAttribute("title"); Main.confirmation(e) }) } }, confirmation: function(e) { if (e === null || e.toString().length === 0) { e = "Are you sure you want to proceed?" } return window.confirm(e); } } window.onload = Main.addConfirmations HTML: &lt;input type="submit" class="bg-red" value="Delete"&gt; Hi, I have the above function that I use in my website so that it adds a confirmation box to every button which has a red background.. Now this seems to be working such that a confirmation box is popped up whenever I click a red button, however, if I click cancel on the confirmation box it doesn't cancel the action.. This has been annoying me for hours.. I've tried lots of debugging but I can't seem to find it. Can anyone help?
tagged with: confirm
answer count: 1

http://stackoverflow.com/q/28164968
tagged with: nested-loops
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44700531
has comment: http://stackoverflow.com/comment/44700466
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28183743
has body: I am at my wits end with this nested loop. I am trying to create an object with nested objects in it grouped by the containing div id. So far this is what I have: $('#survey-submit').on('click', function (e) { var formData = {}; var item = {}; $("div[id^='question-']").each(function () { var id = '#' + $(this).attr('id'); var $this = $(this); formData[id] = $this.children('input, select,checkbox').each(function () { item[this.name] = this.value; }); //console.debug(formData); }); console.debug(formData); return false; }); The result of the console log is all the input elements of the divs that have the start like question, I get the expected number of new objects all dynamically named, but they all contain the same thing. The contents of each object are not specific to the this object I am trying to generate it from, any help would be appreciated!
has title: Jquery getting nested inputs of Div, placing in Object
linked to: http://stackoverflow.com/q/5666445
has comment: http://stackoverflow.com/comment/44700488
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44703531
has comment: http://stackoverflow.com/comment/44703939
accepted answer: http://stackoverflow.com/a/28183743
type: Question
has comment: http://stackoverflow.com/comment/44700430

http://stackoverflow.com/a/32686693
downvote count: 1
has comment: http://stackoverflow.com/comment/53221367
has body: if you have the cookies sent over, i think that would be good enough. Having " crossDomain: true, withCredentials: true " solved the issue of "Refused to set unsafe header “Cookie”" i encountered as well. Even though the alert message still there, however, i have the cookie sent over and have correct response back.
answers question: http://stackoverflow.com/q/28255284
score: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/63344202
answers question: http://stackoverflow.com/q/28150967
type: Answer
has comment: http://stackoverflow.com/comment/112012912
upvote count: 1
downvote count: 1
has body: function instantiateEmptyObject(obj: object): object { if (obj == null) { return {}; } const prototype = Object.getPrototypeOf(obj); if (!prototype) { return {}; } return Object.create(prototype); } function quickCopy(src: object, dest: object): object { if (dest == null) { return dest; } return { ...src, ...dest }; } quickCopy(src, instantiateEmptyObject(new Customer()));
score: 0

http://stackoverflow.com/a/28202871
type: Answer
upvote count: 6
score: 6
accepted answer of: http://stackoverflow.com/q/28202779
answers question: http://stackoverflow.com/q/28202779
has body: You should be able to do this with the native CasperJS function getElementsInfo. It contains a text property for each element: var texts = casper.getElementsInfo('.field-validation-error').map(function(info){ return info.text.trim(); }); e.getAttribute('textContent') obviously can't work, because there is no textContent attribute, but only a textContent property. The same code that you used in the browser console should have worked in PhantomJS. You may try to change .textContent to .innerText.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28167925
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44717118
has body: Given a 2D sparse matrix like so: . 2 3 . . . 2 3 . . . . . . . Where . is an empty value. Taking into account: The matrix is initially void of values but has a defined column and row count. The column and row count never changes. All selections from the matrix will be rectangular, and upon selection the fields become populated and should not be reselected. The matrix will only store numbers between 0 and 255 once populated, but the number bares no relation to the index (unlike the example). So given the 3 x 5 matrix below: . . . . . . . . . . . . . . . Select 2 x 2 from [1, 0]: . 1 2 . . . 1 2 . . . . . . . Select 2 x 3 from [2, 1]: . 1 2 . . . 1 2 3 4 . . 2 3 4 Is there a faster method to find whether or not a value is populated already, than looping through all of the values of the given rectangle to test them? So that given my select 1 x 2 from [2, 1] I know I can just take the slice 2 3 without iterating the values? I understand that iterating this matrix is not a problem but I intend to use this on matrices with matrices of 30,000+ cells, and large selection rectangles with a lot of overlapping.
has title: Determining cached rectangles in a matrix
favorite count: 0
has comment: http://stackoverflow.com/comment/44717781
has comment: http://stackoverflow.com/comment/44717503
tagged with: matrix
has comment: http://stackoverflow.com/comment/44718362
answer count: 0
has comment: http://stackoverflow.com/comment/44719461
type: UnansweredQuestion
tagged with: bitmap
score: 1
tagged with: math
has comment: http://stackoverflow.com/comment/44718295
tagged with: caching
type: Question
upvote count: 1

http://stackoverflow.com/q/28135212
has comment: http://stackoverflow.com/comment/44642499
tagged with: arrays
has comment: http://stackoverflow.com/comment/44642486
favorite count: 0
has comment: http://stackoverflow.com/comment/44642511
tagged with: multidimensional-array
has comment: http://stackoverflow.com/comment/44642500
has body: I have an Array as bellow array( (int) 0 =&gt; array( 'Homeslider' =&gt; array( 'id' =&gt; '1', 'title' =&gt; null, 'display_photo' =&gt; '1402379775bdaebd329b69.jpg', 'order_no' =&gt; null, 'created' =&gt; '2014-06-10 05:56:15', 'modified' =&gt; '2014-06-10 05:56:15' ) ), (int) 1 =&gt; array( 'Homeslider' =&gt; array( 'id' =&gt; '2', 'title' =&gt; null, 'display_photo' =&gt; '1402379784a426fe476711.jpg', 'order_no' =&gt; null, 'created' =&gt; '2014-06-10 05:56:24', 'modified' =&gt; '2014-06-10 05:56:24' ) ), (int) 2 =&gt; array( 'Homeslider' =&gt; array( 'id' =&gt; '3', 'title' =&gt; null, 'display_photo' =&gt; '1402379793cb81f1a5bbf9.jpg', 'order_no' =&gt; null, 'created' =&gt; '2014-06-10 05:56:33', 'modified' =&gt; '2014-06-10 05:56:33' ) ) ) What i am trying to achieve ["img/default/slide/bg1.jpg","img/default/slide/bg2.jpg","img/default/slide/bg3.jpg"] what i tried? var slider_container = []; &lt;?php foreach($sliders as $slide): ?&gt; slider_container[] = "img/sliders/&lt;?php echo $slide['Homeslider']['display_photo'] ?&gt;"; &lt;?php endforeach; ?&gt; console.log(slider_container); Error
has comment: http://stackoverflow.com/comment/44642517
has answer: http://stackoverflow.com/a/28135253
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28135326
has answer: http://stackoverflow.com/a/28135326
has comment: http://stackoverflow.com/comment/44642491
downvote count: 1
has comment: http://stackoverflow.com/comment/44642510
type: Question
accepted answer: http://stackoverflow.com/a/28135253
tagged with: javascript
score: -1
has title: Javascript Array from PHP Multidimensional Array
answer count: 2
has comment: http://stackoverflow.com/comment/44642489
has comment: http://stackoverflow.com/comment/44642512
upvote count: 0

http://stackoverflow.com/a/28188364
type: Answer
answers question: http://stackoverflow.com/q/28187382
accepted answer of: http://stackoverflow.com/q/28187382
score: 0
type: AcceptedAnswer
has body: Finally ad some IF to my JS code to detect my comma, and add "-comma" class to the : $(document).ready(function(){ function wrapCharacters() { $('.precios').contents().each(function() { if(this.nodeType === 1) { wrapCharacters(this); } else if(this.nodeType === 3) { $(this).replaceWith($.map(this.nodeValue.split(''), function(c) { if (c == ',') { c='-comma'; return '&lt;span class="big p' + c +'"&gt;' + c + '&lt;/span&gt;'; }else{ return '&lt;span class="big p' + c +'"&gt;' + c + '&lt;/span&gt;'; } }).join('')); } }); } wrapCharacters($('.precios')); });

http://stackoverflow.com/a/28197417
type: Answer
has comment: http://stackoverflow.com/comment/44804917
answers question: http://stackoverflow.com/q/28170605
accepted answer of: http://stackoverflow.com/q/28170605
has comment: http://stackoverflow.com/comment/44806110
score: 0
type: AcceptedAnswer
has body: Are you familiar with Flux architecture? It uses event emitters in Stores that a Controller-view can listen to. This is a really good example of what you're describing. The Controller-view is a top level component that listens for new events and then passes the data down to lower level components via props. Whether you implement Flux or not, Facebook has some good examples that answer your question in their Todo List Example.
has comment: http://stackoverflow.com/comment/44812283

http://stackoverflow.com/a/28244105
type: Answer
has body: It is not entirely clear to me what type of data structure you want to end up with after you've added a number of items to the cart. So, this answer is a guess based on what it looks like you're trying to do in your question, but if you show a Javascript literal for what you want the actual structure to look like after there are several items in the cart, we can be sure we make the best recommendation. You have to initialize a javascript object or array before you can use it. The usual way to do that is to check if it exists and if it does not, then initialize it before assigning to it. And, since you're keeping a count, you also will want to initialize the count. var data = []; function addproduct(id,name,price){ if (!data[id]) { // initialize object and count data[id] = {count: 0}; } data[id]["name"] = name; data[id]["price"] = price; ++data[id]["count"]; console.log(data); } And FYI, arrays are used for numeric indexes. If you're using property names like "name" and "price" to access properties, you should use an object instead of an array. And, I would suggest that you use the dot syntax for known property strings: var data = []; function addproduct(id,name,price){ if (!data[id]) { // initialize object and count data[id] = {count: 0}; } data[id].name = name; data[id].price = price; ++data[id].count; console.log(data); }
has comment: http://stackoverflow.com/comment/44849175
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28243850
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28243850

http://stackoverflow.com/comment/44820379
type: QuestionComment
comment on: http://stackoverflow.com/q/28228643
has text: @Chris It show the variable as undefined..
score: 0
type: Comment

http://stackoverflow.com/a/28195803
downvote count: 1
has comment: http://stackoverflow.com/comment/44769328
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/44758433
score: -1
answers question: http://stackoverflow.com/q/28195689
has body: Wrap if($("#register-form").valid()){} around your ajax to only submit the form if it passes validation. if($("#register-form").valid()){ $.ajax({ url:"http://192.168.1.11/services/bookService4Homes.php", type:"POST", dataType:"json", data:{type:"booking",Name:uName, Email:mailId, Mob_Num:mobNum }, //type: should be same in server code, otherwise code will not run ContentType:"application/json", success: function(response){ //alert(JSON.stringify(response)); }, error: function(err){ //alert(JSON.stringify(err)); } }); }

google-maps
tags question: http://stackoverflow.com/q/28247841
tag name: google-maps
tags question: http://stackoverflow.com/q/28278248
tags question: http://stackoverflow.com/q/28129615
tags question: http://stackoverflow.com/q/28186720
tags question: http://stackoverflow.com/q/28213216
tags question: http://stackoverflow.com/q/28233018
tags question: http://stackoverflow.com/q/28247260
tags question: http://stackoverflow.com/q/28126778
tags question: http://stackoverflow.com/q/28208937
tags question: http://stackoverflow.com/q/28140386
tags question: http://stackoverflow.com/q/28205823
tags question: http://stackoverflow.com/q/28170511
tags question: http://stackoverflow.com/q/28261525
tags question: http://stackoverflow.com/q/28157278
tags question: http://stackoverflow.com/q/28240226
tags question: http://stackoverflow.com/q/28121936
tags question: http://stackoverflow.com/q/28239416
tags question: http://stackoverflow.com/q/28205665
tags question: http://stackoverflow.com/q/28152941
tags question: http://stackoverflow.com/q/28250348
tags question: http://stackoverflow.com/q/28195610
tags question: http://stackoverflow.com/q/28139070
tags question: http://stackoverflow.com/q/28253168
tags question: http://stackoverflow.com/q/28126462
tags question: http://stackoverflow.com/q/28152601
tags question: http://stackoverflow.com/q/28264516
tags question: http://stackoverflow.com/q/28166625
tags question: http://stackoverflow.com/q/28126635
tags question: http://stackoverflow.com/q/28222856
tags question: http://stackoverflow.com/q/28154798
tags question: http://stackoverflow.com/q/28222963
tags question: http://stackoverflow.com/q/28171995
tags question: http://stackoverflow.com/q/28159392
tags question: http://stackoverflow.com/q/28134114
tags question: http://stackoverflow.com/q/28261997
tags question: http://stackoverflow.com/q/28141372
tags question: http://stackoverflow.com/q/28137714
tags question: http://stackoverflow.com/q/28127344
tags question: http://stackoverflow.com/q/28213656
tags question: http://stackoverflow.com/q/28203589
tags question: http://stackoverflow.com/q/28276936
tags question: http://stackoverflow.com/q/28270102
tags question: http://stackoverflow.com/q/28254090
tags question: http://stackoverflow.com/q/28174006
tags question: http://stackoverflow.com/q/28141271
tags question: http://stackoverflow.com/q/28183374
tags question: http://stackoverflow.com/q/28155703
tags question: http://stackoverflow.com/q/28138510
tags question: http://stackoverflow.com/q/28150715
tags question: http://stackoverflow.com/q/28169146
type: Tag
tags question: http://stackoverflow.com/q/28265228
tags question: http://stackoverflow.com/q/28202562
tags question: http://stackoverflow.com/q/28192756
tags question: http://stackoverflow.com/q/28133800
tags question: http://stackoverflow.com/q/28140181
tags question: http://stackoverflow.com/q/28196886
tags question: http://stackoverflow.com/q/28219832
tags question: http://stackoverflow.com/q/28176507
tags question: http://stackoverflow.com/q/28254044
tags question: http://stackoverflow.com/q/28235533
tags question: http://stackoverflow.com/q/28245542
tags question: http://stackoverflow.com/q/28196026
tags question: http://stackoverflow.com/q/28145767
tags question: http://stackoverflow.com/q/28263022
tags question: http://stackoverflow.com/q/28153532
tags question: http://stackoverflow.com/q/28152476
tags question: http://stackoverflow.com/q/28202866
tags question: http://stackoverflow.com/q/28130114
tags question: http://stackoverflow.com/q/28131661
tags question: http://stackoverflow.com/q/28166924
tags question: http://stackoverflow.com/q/28198415
tags question: http://stackoverflow.com/q/28180683
tags question: http://stackoverflow.com/q/28232924

http://stackoverflow.com/comment/44638680
has text: It does not have anything to do with `window.location.href` btw
comment on: http://stackoverflow.com/q/28133053
score: 0
type: QuestionComment
type: Comment

jquery-mobile
tags question: http://stackoverflow.com/q/28157554
tags question: http://stackoverflow.com/q/28243067
tags question: http://stackoverflow.com/q/28216520
type: Tag
tags question: http://stackoverflow.com/q/28275410
tags question: http://stackoverflow.com/q/28196632
tags question: http://stackoverflow.com/q/28122784
tags question: http://stackoverflow.com/q/28249067
tags question: http://stackoverflow.com/q/28143391
tags question: http://stackoverflow.com/q/28158066
tags question: http://stackoverflow.com/q/28216952
tags question: http://stackoverflow.com/q/28139011
tags question: http://stackoverflow.com/q/28177514
tags question: http://stackoverflow.com/q/28259236
tags question: http://stackoverflow.com/q/28237548
tags question: http://stackoverflow.com/q/28143353
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/28231512

http://stackoverflow.com/a/28137327
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28137213
has comment: http://stackoverflow.com/comment/44646675
has body: It is not obvious without your code but why do you remove and then append elements? Maybe it's better to leave your inputs as they are and just set to its proper value?
has comment: http://stackoverflow.com/comment/44646409
has comment: http://stackoverflow.com/comment/44646526

http://stackoverflow.com/comment/44735088
has text: You're probably right, Jon. I'll keep this minor issue I have to myself from now on ;)
comment on: http://stackoverflow.com/a/28182269
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44691365
comment on: http://stackoverflow.com/q/28159890
type: QuestionComment
type: Comment
has text: It's quite common knowledge - bitwise operators always converts operands to signed 32bit integer.
score: 0

http://stackoverflow.com/comment/44959230
has text: Maybe there's something wrong with the rest of my code, but it's just using the html options still, not loading from my User table....
type: Comment
comment on: http://stackoverflow.com/a/28247684
score: 0
type: AnswerComment

http://stackoverflow.com/q/28185218
has answer: http://stackoverflow.com/a/28195954
has comment: http://stackoverflow.com/comment/44753239
type: Question
tagged with: google-apps-script
has title: Google won't duplicate the active sheet using "duplicateActiveSheet();"
tagged with: google-sheets
has comment: http://stackoverflow.com/comment/44758540
answer count: 1
has body: Code: ss.setActiveSheet(template); Browser.msgBox("Set Active Sheet"); ss.dupliacteActiveSheet(); Browser.msgBox("Duplicated Sheet"); ss.deleteSheet(sheet); Browser.msgBox("Deleted Old Sheet"); ss.moveActiveSheet(1); Browser.msgBox("Moved Sheet"); ss.renameActiveSheet("Timesheet2"); Browser.msgBox("Renamed Sheet"); I just don't understand...I am looking to replace a sheet with its template every week. I have set a time trigger to the above function... When I run the function I get to the "Set active sheet" popup but my code doesn't seem to go any further. Any help is appreciated.
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/11781758
has comment: http://stackoverflow.com/comment/44758662
favorite count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28295605
accepted answer of: http://stackoverflow.com/q/28159618
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28159618
has body: You should connect the analyser to the destination to make it work. sound.connect(analyser); analyser.connect(context.destination);

http://stackoverflow.com/a/28261155
has body: Any expression is allowed in a condition checking statement. If the value of the expression isn't boolean, then it will be converted to boolean to determine what the statement should do. You can for example use a number in an if statement: if (1) { ... } Any non-zero number will be converted to true. In Javascript an assignment is also an expression, i.e. it has a value. The value of the expression is the same value that was assigned to the variable. So, you can use an assignment expression in a condition checking statement, and the value of the expression is converted to boolean if needed: if (x = 1) { ... } Using an assignment in an condition checking statement can be useful, if the value that you assign should be used to control what happens. If you for example have a function that returns different values for the first calls, then a null when there are no more values, you can use that in a loop: while (line = getLine()) { document.write(line); } You can of couse do that with the assignment separated from the logic, but then the code gets more complicated: while (true) { line = getLine(); if (line == null) break; document.write(line); }
accepted answer of: http://stackoverflow.com/q/28261072
answers question: http://stackoverflow.com/q/28261072
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44720965
comment on: http://stackoverflow.com/a/28174854
has text: for scores as you describe them, this code should do.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44660691
score: 0
type: AnswerComment
has text: I would, but you haven't posted enough code for me to guess on an exact solution. Can you post the code that adds the new elements to the DOM, include the ngController too
type: Comment
comment on: http://stackoverflow.com/a/28144425

http://stackoverflow.com/comment/44910190
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28276936
has text: I am certain that there are more than one cities.

http://stackoverflow.com/comment/44797854
type: Comment
comment on: http://stackoverflow.com/q/28217153
type: QuestionComment
has text: That is also intended for UnitTests. I want to know if it is a good idea to put such assertions in production code.
score: 0

http://stackoverflow.com/q/28232227
tagged with: lightbox
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I am using: $(".first-image-gallery").first().trigger('click'); To create the action of clicking on a gallery of images. The reason for this is I am using a 'Start Gallery' button elsewhere on the page and want this button to open up the first image of the gallery and then the user can move forward and back as they please. I am using iLightBox for the gallery and can't find anything that it has build in to open up the gallery from another button or action via jQuery. The current code I am using works fine elsewhere on desktop, but mobile iPad it wont work.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/38453064
has title: $(".element").first().trigger('click') - not working iPad
score: 1
has answer: http://stackoverflow.com/a/28232299
upvote count: 1
type: Question
tagged with: image-gallery
tagged with: ios
has answer: http://stackoverflow.com/a/28232294
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/44826602

http://stackoverflow.com/a/28138458
has comment: http://stackoverflow.com/comment/44649147
has comment: http://stackoverflow.com/comment/44650885
downvote count: 0
has comment: http://stackoverflow.com/comment/44648908
score: 1
answers question: http://stackoverflow.com/q/28137482
upvote count: 1
type: AcceptedAnswer
has body: The keyup event fires only after the keyboard key has been released, and then the character has made its way into the textarea/input element already. keydown on the other hand fires as soon as the key is pressed, and if you cancel the event then, the charater will not even be inserted into the input field in the first place. Make sure to handle this carefully though, so that you do not eliminate other key presses that the user might need to use the input field, like f.e. the cursor keys or ins/del etc. (And you might want to add additional validation/sanitization of the value before it gets submitted or otherwise used, because the value could get into the input field in other possible ways that key events would not catch, such as f.e. paste triggered via context menu.)
accepted answer of: http://stackoverflow.com/q/28137482
type: Answer

http://stackoverflow.com/q/28217941
type: Question
score: -2
linked to: http://stackoverflow.com/q/12814334
has answer: http://stackoverflow.com/a/28217968
tagged with: syntax
downvote count: 3
upvote count: 1
answer count: 1
duplicate of: http://stackoverflow.com/q/12814334
linked to: http://stackoverflow.com/q/28201724
has title: if-else-if javascript returns true and exits regardless of input
tagged with: javascript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/28201724
has body: I have been trying desperately to figure out the syntax for using multiple else-if statements in javascript for a long time, and after about three hours reading and testing, I feel like I've pretty much hit a wall. javascript: var n = prompt("please enter number"); if (n = 2) { window.alert("b") } else { if (n = 1) { window.alert("a") } else { window.alert("other") } }; From everything I've read, the above code should work, but very time I run it the output results in a "b" alert no matter what I use for input. I've tried several different variations of this trying to find the correct syntax, but nothing has worked so far. Can anyone tell me what I'm doing wrong?
tagged with: syntax-error
favorite count: 0

http://stackoverflow.com/a/28187922
score: 0
type: AcceptedAnswer
has body: Try: $.ajax({ type : 'GET', url: '/RestFulApi/api/v1/mcd/get-projects', datatype : "json", success : function(data) { $.each(data, function (key, values) { var template = ' ' + key + ': ' + ' '; for(var i=0; i<values.length; i++){ template = template + ' ' + values[i] + ' '; } template = template + ' '; $("div#project-names").append(template); }); } });
accepted answer of: http://stackoverflow.com/q/28187109
type: Answer
answers question: http://stackoverflow.com/q/28187109

http://stackoverflow.com/comment/44710182
score: 0
type: Comment
type: QuestionComment
has text: Indeed, it does sound like phasing. Well, I'm not playing it back twice intentionally. Perhaps an event retrigger problem that's getting stuck? Although it would still be strange that it only occurs after a certain time.
comment on: http://stackoverflow.com/q/28141139

http://stackoverflow.com/a/28200188
has comment: http://stackoverflow.com/comment/44767073
type: Answer
accepted answer of: http://stackoverflow.com/q/28199689
has body: The trick is in the message you are seeing Uncaught TypeError: undefined is not a function I'm not too sure how distance[i] is being instantiated; but my guess is that it is an int, not a string, so it does not have any of the built in string functions (like .replace). You could try this: var dis = distance[i].toString(); Please take care to make sure distance[i] isn't null, or 'toString fails and you're back to sqaure one.
answers question: http://stackoverflow.com/q/28199689
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/44808491
type: QuestionComment
has text: Prod order number is not the primary key . They can be more than one prod order number. But, Prod order number and "Operation" combined together can be unique.
comment on: http://stackoverflow.com/q/28222480
score: 1
type: Comment

http://stackoverflow.com/comment/44723104
score: 0
type: AnswerComment
has text: I'm sorry, i should of specified that; it's currently placed in the footer.
type: Comment
comment on: http://stackoverflow.com/a/28176965

http://stackoverflow.com/comment/44887510
type: Comment
type: QuestionComment
has text: Awesome!... I would have coded this as an answer but I'm between meetings on an iPhone :-(
comment on: http://stackoverflow.com/q/28265145
score: 0

http://stackoverflow.com/a/28226534
has comment: http://stackoverflow.com/comment/45222344
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45222289
answers question: http://stackoverflow.com/q/28203617
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28203617
has body: The previous answer suggested to use currentTime(), which is a get/set method in HTML5 but only a get method in MEJS. You should rather use (MEJS') setCurrentTime(), to set the starting time so, having a button like play : starts at 8 seconds ... you could use this jQuery code : var media; // we need this global variable jQuery(document).ready(function ($) { $("video").mediaelementplayer({ success: function (mediaElement, domObject) { media = mediaElement; // make it available for other functions } }); $(".button").on("click", function () { media.setCurrentTime(8); // set starting time media.play(); }); }); // ready ... or you could have more buttons (with different IDs) to set more actions like $("#parentContainer").on("click", ".button", function (event) { if (event.target.id == "play") { media.setCurrentTime(8); media.play(); } if (event.target.id == "pause") { media.pause(); } }); Note: video should be preloaded for set properties to work.
downvote count: 0

http://stackoverflow.com/comment/44678011
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28153118
has text: Thanks for clearing this up. Both your exmples work, but unfortunately the second (with the handler included in the '$(function() {' area) returns a double click event -- alert window opens, I click ok, second alert window opens. This function is going to drive a toggle, so I can't have that happening. Anyway, bottom line is the issue is resolved.

http://stackoverflow.com/comment/44734404
score: 0
type: Comment
has text: I prefer single quotes, more aesthetic in my opinion and easier to embed double quotes within. See the JavaScript tutorial [here](http://www.w3schools.com/js/js_strings.asp) for more info.
comment on: http://stackoverflow.com/a/28182510
type: AnswerComment

http://stackoverflow.com/comment/44632424
has text: It matches `0000-00-00 00:00` but doesn't take care of leap second. http://en.wikipedia.org/wiki/Leap_second
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28126744
type: Comment

http://stackoverflow.com/q/28197946
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44762514
upvote count: 1
has answer: http://stackoverflow.com/a/28198075
type: AnsweredQuestion
has title: Getting started with QTip
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44762808
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28198075
tagged with: javascript
tagged with: qtip2
tagged with: jquery
has body: I'm trying to use Qtip to add tooltips to a site I'm working on, but for the life of me, I can't get it to do anything! I tried posting my question in the qtip forums but have gotten no reply, so I want to try here instead. I've created a simple webpage to get the general syntax down, but even that isn't working. Here's the HTML for the test page. test Here's the div And here's the code for the .JS file. // Create the tooltips only when document ready $(document).ready(function() { $('#box').qtip({ content: 'Mouse tracking! Content' }); }); I just want cool tooltips for my page to work quickly and easily T_T Thanks in advance for any assistance!

http://stackoverflow.com/a/28126849
type: Answer
answers question: http://stackoverflow.com/q/28126585
score: 0
has body: You need to say your script where it should send its data to the server. so you need something like &lt;from method="POST" action="target.php"&gt;......&lt;/form&gt; iMo you need to have a server script which consumes your formular data via "$_POST" globals (in PHP). I guess with pure html, you can just send an email with the form data. http://php.net/manual/de/reserved.variables.post.php

http://stackoverflow.com/comment/44670293
type: Comment
has text: Alright then..... There could still have been a good reason, but seems like this time there really isn't, fair enough.
type: AnswerComment
comment on: http://stackoverflow.com/a/28149252
score: 0

http://stackoverflow.com/q/28237559
tagged with: store
type: Question
has answer: http://stackoverflow.com/a/28272417
tagged with: forms
score: 0
answer count: 1
tagged with: javascript
tagged with: extjs
accepted answer: http://stackoverflow.com/a/28272417
tagged with: sencha-touch-2
has body: I want to build a survey loading the questions from a database. The number of questions varies, so I am building dynamically a form. I thought using store.each and a form.add inside will work, but store.data.length return 0 even the data is loaded. console.log(store) returns: Ext.apply.create.Class {[...] data: Ext.apply.create.Class [...] all: Array[3] raw: Object 0: name: "textfield1" title: "label1" xtype: "textfield" 1: [...] 2: [...] [...] length: 3 [...] So, the data is loaded. But the next line is console.log('number of q:',question.data.all.length); and returns: number of q: 0 I don't know why is returning 0 records, and never run store.each. I attach all related files. Model: Ext.define("LabApp.model.Survey", { extend : "Ext.data.Model", config : { idProperty : 'id', fields : [ { name : 'id', type : 'int' }, { name : 'xtype', type : 'string' }, { name : 'title', type : 'string'}, { name : 'name', type : 'string'} ] } }); Store: Ext.define('LabApp.store.Survey', { extend : 'Ext.data.Store', requires : "Ext.data.proxy.Ajax", config : { model : 'LabApp.model.Survey', autoLoad : false, proxy : { type : 'ajax', url : '/LabApp/server/surveys.php', reader : { type : 'json', rootProperty : 'data' }, }, sorters : [ { property : 'id', direction : 'ASC' } ], } }); JSON: ﻿﻿﻿ ﻿﻿﻿{ success: true, data: [ {xtype: 'textfield', title: 'label1', name: 'textfield1'}, {xtype: 'textfield', title: 'label2', name: 'textfield2'}, {xtype: 'textfield', title: 'label3', name: 'textfield3'} ] } View: Ext.define('LabApp.view.Survey', { extend : 'Ext.form.Panel', alias : 'widget.surveyView', requires : [ 'Ext.form.FieldSet', 'Ext.Button' ], config : { title : 'Survey', layout : { type : 'vbox', }, items : [ { xtype : 'fieldset', margin : '0 10 5 10', items : [] } ] } }); Controller: Ext.define('LabApp.controller.Survey', { extend : 'Ext.app.Controller', config : { refs : { mainView : 'mainView', surveyView : 'surveyView' } }, launch : function() { var question = Ext.getStore('Survey'); …
type: AnsweredQuestion
has title: Loading store data to build a form dynamically Sencha Touch2

http://stackoverflow.com/a/28138176
accepted answer of: http://stackoverflow.com/q/28138139
type: Answer
has body: You can use indexOf in filter, like this var res = a.filter(function (el) { return kpis.indexOf(el.id) &gt;= 0; }); Example
has comment: http://stackoverflow.com/comment/44649077
answers question: http://stackoverflow.com/q/28138139
score: 22
upvote count: 22
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44882661
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28262881
has text: BTW: You also really do not need the class active-art, if you load the page with $(document).ready(function(){$('.art:eq(0)').css({display:'inline'})}); where .art:eq(0) is the first matched .art
type: AnswerComment

http://stackoverflow.com/comment/44651892
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28138226
has text: It should still work, why wouldn't it? Let me know what problems you think might occur?
score: 0

http://stackoverflow.com/a/28239839
has comment: http://stackoverflow.com/comment/44843393
score: 0
answers question: http://stackoverflow.com/q/28239603
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28239603
type: Answer
has body: First add asp:HiddenField in your aspx. Lets this hiddeField have ID="hidden". After that you will use jquery to attach onClick event to the td of the table and you will set the value of the hidden field to the ID of the current td. $(document).ready(function () { $('.window td').on('click',function(){ var idName = this.id; $('#hidden').val(idName); }); }); At last in your C# code: string text = hidden.Text;//you will remove m part of the Id and you have the number. Be aware the code is written on the fly, probably you should check the javascript using console.log or alert functionality.

http://stackoverflow.com/comment/44670069
comment on: http://stackoverflow.com/q/28149109
type: QuestionComment
has text: in the chrome dev tools network tab, do you see the request going out? How does it differ with the Postman request? Assuming that 405 is a service error (f'ed up if it's the client), compare the two requests and you should be able to pinpoint what the framework on the client side is doing wrong.
score: 0
type: Comment

http://stackoverflow.com/q/28170461
score: 1
type: Question
has title: $q service - should I use CommonJS-style or constructor-style in new AngularJS application?
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28170549
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28170549
upvote count: 1
has body: AngularJS documentation for $q service says that $q can be used in two fashions - constructor-style and CommonJS-style, see https://docs.angularjs.org/api/ng/service/$q Nevertheless, it doesn't mention whether both fashions are equal, or whether one is preferred. Are those two uses equal, or is there any difference?
type: AnsweredQuestion

http://stackoverflow.com/q/28140597
answer count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28142227
type: Question
has body: I'm attempting to extend pixi.js' sprite class and set it's position.x property in my child class constructor var Ship = function(x, y, image, focused) { PIXI.Sprite.fromImage.call(this, image); this.x = x; this.y = y; this.image = image; this.focused = typeof focused != 'undefined' ? focused : false; this.position.x = window.width/2; }; Ship.prototype = Object.create(PIXI.Sprite.fromImage.prototype); Ship.prototype.constructor = Ship; but, I keep getting the error "Uncaught TypeError: Cannot set property 'x' of undefined" on this.position.x = window.width/2; I believe that I'm not able to access parent class's properties until after the Object.create() call... So what's the proper way of doing this?
has title: Extend pixi.js sprite an accessing parent's properties in constructor
tagged with: javascript
tagged with: inheritance
tagged with: prototype
tagged with: class
accepted answer: http://stackoverflow.com/a/28142227
score: 0

http://stackoverflow.com/comment/44911722
comment on: http://stackoverflow.com/a/28278701
type: Comment
has text: To avoid 5 letter colours you can use for colour: ('00000'+Math.random().toString(16).replace('.', '')).slice(-6) and for on line 4 similarily ('00' + rep).slice(-3)
score: 1
type: AnswerComment

http://stackoverflow.com/a/28220591
accepted answer of: http://stackoverflow.com/q/28219354
type: Answer
upvote count: 1
score: 1
has body: It sounds like you want something like this: $('.featureCheck').change(function() { if (this.checked) { $('.featureCheck').not(this).filter(':checked').closest('.featureLabel').click(); } }); So if you check a checkbox, find others which are checked, and trigger the click event on their parent label
answers question: http://stackoverflow.com/q/28219354
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28214203
downvote count: 0
has body: This is how you combine both functions var i = 0; var o = 0; // opacity var y_frames = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H",]; function draw_y() { // drawing if ( i &lt; y_frames.length ) { o = easeOutSine( i , 0 , 1, y_frames.length); $y .text( y_frames[i] ) .css( { opacity: o } ); i++; window.requestAnimationFrame( draw_y ); } else { // code to be executed when animation finishes } }; function easeOutSine(t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; } window.requestAnimationFrame( draw_y ); Note: Always call the requestAnimationFrame inside the condition or it will keep running infinitely.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/44803059
answers question: http://stackoverflow.com/q/28213526
has comment: http://stackoverflow.com/comment/44797345
accepted answer of: http://stackoverflow.com/q/28213526
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44794256
type: Comment
score: 1
has text: I thinks that it can be hardly done... sorry i cant help you D: im not that good with js
type: AnswerComment
comment on: http://stackoverflow.com/a/28209716

http://stackoverflow.com/comment/47965814
score: 0
type: Comment
type: QuestionComment
has text: Is anyone actually seeing this below screen sizes of 2426...
comment on: http://stackoverflow.com/q/28137801

http://stackoverflow.com/comment/44850420
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28244371
has text: There were a few things: 1. Your Fiddle wasn't doing anything with the result of the `q` function. 2. The input element was referring to an unknown `q2` function. 3. jsFiddle doesn't work well with inline events, which is another reason to define them in the script section.

http://stackoverflow.com/comment/44813494
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28225159
has text: the second one wouldnt work as op wants, as you would just be creating a variable/property named `key`
type: AnswerComment

http://stackoverflow.com/a/28853316
type: Answer
has body: Here this could be your starting point. It just uses jQuery. You need to add autocomplete, validation, etc. Press enter to add Tags. HTML Tags JS var tag = ''; $("#exampleInputTags").keyup(function (e) { if (e.keyCode == 13) { tag = '#' + $("#exampleInputTags").val(); $("#tags").append(tag + ' '); $("#exampleInputTags").val(''); } }); http://jsfiddle.net/iambnz/b7gju2c1/ EDIT: I have added some logic for autocomplete. RegEx patterns should be tested and changed. Dont know how to add this to the input context so far. JS var tag = ''; var str = 'JavaScript'; $("#exampleInputTags").keyup(function (e) { var re = $("#exampleInputTags").val(); console.log(re); if (re != '') { testinput(re, str); } else if (re == '') { $("#suggestions").text(''); } }); function testinput(re, str) { if (str.search(re) != -1) { $("#suggestions").text(str); } } $("#exampleInputTags").keyup(function (e) { if (e.keyCode == 13) { tag = '#' + $("#exampleInputTags").val(); $("#tags").append(tag + ' '); $("#exampleInputTags").val(''); } }); HTML Tags http://jsfiddle.net/iambnz/yye1b4ye/ If that all does not fit your needs, take a look on the typeahead add on from bootstrap. http://getbootstrap.com/2.3.2/javascript.html#typeahead
answers question: http://stackoverflow.com/q/28255883
score: 0

http://stackoverflow.com/q/28256305
tagged with: javascript
has body: I am searching for such method to save the current url of the webpage to a file. after alot search I found this working script: SET !ERRORIGNORE YES SET !EXTRACTADD SAVEAS TYPE=EXTRACT FOLDER=c:\ FILE=URL.CSV But the point is that how to use this in javascript . I just tried as following : var link; link +="SET !ERRORIGNORE YES"; link +="SET !EXTRACTADD "; link +="SAVEAS TYPE=EXTRACT FOLDER=c:\ FILE=URL.CSV"; But this is not working for me. I am just a noob , Help me out with a easy way :) Thanks in Advance
answer count: 1
has answer: http://stackoverflow.com/a/28256455
favorite count: 0
has comment: http://stackoverflow.com/comment/44871017
type: UnansweredQuestion
downvote count: 2
has title: How to save current url using javascript?
score: -1
upvote count: 1
type: Question
tagged with: imacros

http://stackoverflow.com/a/28326072
answers question: http://stackoverflow.com/q/28126681
has body: I got it working but the code is 80+ lines longer than it should ever need to be. I tried every variation of importNode, replaceChild, appendChild, adoptNode, removeChild, ect. I could think of. I am fairly certain I could write a book on how many ways you could handle any given XML element or node. Here's an example of how absurd the issue was. This will work function AddNewElem() { var menubar = document.getElementById('menubarwrapper'); var menuitem = '&lt;menu id="help-menu" label="Help" accesskey="H" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;'; menuitem += '&lt;menupopup id="help-popup"&gt;'; menuitem += '&lt;menuitem id="test-menu" label="Test" acceltext="Ctrl+T" accesskey="T" /&gt;'; menuitem += '&lt;menuseparator/&gt;'; menuitem += '&lt;menuitem id="about-menu" label="About" acceltext="Ctrl+A" accesskey="A" /&gt;'; menuitem += '&lt;/menupopup&gt;'; menuitem += '&lt;/menu&gt;'; var parser = new DOMParser(); var xmlDoc = parser.parseFromString(menuitem, 'text/xml').documentElement; menubar.appendChild(xmlDoc); } but this will not function RequestData() { var url = 'newmenu.txt'; var request = new XMLHttpRequest(); request.onload = function(aEvent) { var menubar = document.getElementById('menubarwrapper'); var responsetxt = aEvent.target.responseText; var parser = new DOMParser(); var xmlDoc = parser.parseFromString(responsetxt, 'text/xml').documentElement; menubar.appendChild(xmlDoc); }; request.onerror = function(aEvent) { alert("Error Status: " + aEvent.target.status); }; request.open('POST', url, true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); request.send('pageid=menu'); } newmenu.txt is just the contents of menuitem in the preceding piece of code. I even went as far as to serialize the xmlDoc back to a string and then parse it again and still wouldn't work. I tried a ton of dumb ideas, and many I knew wouldn't work, on the off chance I might get a clue as to the problem. When you crash F…
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28126681

http://stackoverflow.com/comment/44695372
score: 0
type: QuestionComment
has text: I think it is important to point out the that "way you **do not** wan't to do it" is by retrieve-modify-save at all costs. So ignore that statement any focus on the latter part which is to explain what you are really trying to do in context in your question. There is likely a better solution when others can see the whole problem.
type: Comment
comment on: http://stackoverflow.com/q/28144362

http://stackoverflow.com/q/28242133
tagged with: javascript
has comment: http://stackoverflow.com/comment/44846626
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I'm a new employee at a company and also new to php and jqplot. :$ I'm trying to create a simple graph using jqplot. I followed all the instructions at http://www.jqplot.com/tests/line-charts.php but nothing is displayed in my div :( can someone help? I think the problem might that its not loading the jqplot files :,( Capacity Report <!--[if lt IE 9]> <![endif]--> graph1 graph2
has comment: http://stackoverflow.com/comment/44845231
accepted answer: http://stackoverflow.com/a/28243353
type: AnsweredQuestion
tagged with: jqplot
has title: can't display a simple graph using jqplot
type: Question
tagged with: graph
has answer: http://stackoverflow.com/a/28243353

http://stackoverflow.com/a/28254635
upvote count: 1
answers question: http://stackoverflow.com/q/28254593
has body: First hide then only use fadeIn: $('.working').val('finding...').hide().fadeIn('slow'); Your updated fiddle.
has comment: http://stackoverflow.com/comment/44869134
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44867749
score: 1

http://stackoverflow.com/comment/44788411
type: Comment
comment on: http://stackoverflow.com/a/28211945
score: 0
has text: if you are using ajax which load this td and input elements.. in this case you need to put this after you have insert that elements in the html content. i,e in the success paremeter code of ajax method
type: AnswerComment

http://stackoverflow.com/a/28177823
answers question: http://stackoverflow.com/q/28160906
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28160906
has body: The first argument for create() needs to be a dict. Try: client.indices.create({index: 'myindex'}, function (err, resp) { if (err) console.log('failed to create ElasticSearch index, ' + err.message); else console.log('successfully created ElasticSearch index'); });
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44729668

http://stackoverflow.com/comment/44797681
comment on: http://stackoverflow.com/a/28216953
type: AnswerComment
has text: @McBoman did you include the Jquery before the bootstrap JS. Because when i paste your HTML inside JSFiddle, it works. http://jsfiddle.net/9cka1pd5/
type: Comment
score: 1

http://stackoverflow.com/comment/44902469
has text: I do intend to use it, I'd just like to have a clean layered architecture where the bit that interacts with the dom is kept separate from the core business logic.
comment on: http://stackoverflow.com/q/28268245
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44624506
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28125416
has text: Hmm.. I got a bit of an odd one. When using +count I get no stars at all, if I use count I only get one. Any idea why? My solution is identical to yours.
type: AnswerComment

http://stackoverflow.com/a/28243210
answers question: http://stackoverflow.com/q/28243115
type: Answer
score: 2
upvote count: 2
has body: Split on spacing, and use the resulting array's length: function wordCount(elements) { var count = 0; for (var i = 0; i &lt; elements.length; i++) { count += elements[i].textContent.split(/\s/).length; } return count; } var wordsInParagraphs = wordCount(document.getElementsByTagName("p"));
downvote count: 0
has comment: http://stackoverflow.com/comment/44847352

http://stackoverflow.com/q/28270710
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44896986
tagged with: function
has comment: http://stackoverflow.com/comment/44896985
has title: Google map API theme option page not displaying
has comment: http://stackoverflow.com/comment/44898898
type: UnansweredQuestion
has body: I'm having some issues with the integration of a google map in my web site which can geocode an address before displaying the map with the correct location. So i have a script (it worked when i was in localhost but since i put the web site online nothing happens) : I put an address in a field in my theme option page then i register the value and put it in a hidden input in my front-end and try to get it with geocoder.geocode( { 'address' : document.getElementById('address_field').value} Seems to have a problem with geocoding, i tested with a simple script with a fix position and it showed fine. In case you need it this is how i display the map in the front-end : <?php echo " "?>
has comment: http://stackoverflow.com/comment/44902848
answer count: 0
has comment: http://stackoverflow.com/comment/44903077
has comment: http://stackoverflow.com/comment/44896987
has comment: http://stackoverflow.com/comment/44896984
type: Question

http://stackoverflow.com/q/28164448
type: Question
answer count: 2
tagged with: javascript
has title: Jsonp not getting variable userRole
score: 0
possible better answer: http://stackoverflow.com/a/28164540
has comment: http://stackoverflow.com/comment/44699597
has answer: http://stackoverflow.com/a/28164540
has body: I am trying to write a jsonp that pulls the content of a single variable - userRole off of a completely separate URL. I can only do javascript on the server URL, and the sites have to remain separate. Why does service.userRole return undefined? How do I fix it? Server: function service(request, response) { var callBackFuncStr = request.getParameter('callback'); var strJson=''; var jsonval = userRole; strJson=callBackFuncStr+'(\''+jsonval+'\');'; response.write(strJson); var json=userRole; var context= nlapiGetContext(); var userRole = context.getRole(); response.write( userRole); } Client: &lt;script type="text/javascript"&gt; $.ajax({ url: "********.com/app/site", type: "GET", dataType : "jsonp", success: function( service ) { console.log(service.userRole); }, error: function( xhr, status, errorThrown ) { console.log( "Sorry, there was a problem!" ); console.log( "Error: " + errorThrown ); console.log( "Status: " + status ); console.dir( xhr ); }, // Code to run regardless of success or failure complete: function( xhr, status ) { console.log( "The request is complete!" ); } }); &lt;/script&gt;
has answer: http://stackoverflow.com/a/28164546
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28164546

http://stackoverflow.com/comment/44836771
has text: This jquery is only for checkbox ,I want my form to input textarea or select checkbox, any one or both?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28237739
score: 0

http://stackoverflow.com/q/28272476
score: 0
has comment: http://stackoverflow.com/comment/44900107
has comment: http://stackoverflow.com/comment/44900323
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44900095
has comment: http://stackoverflow.com/comment/44901513
answer count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44900139
has comment: http://stackoverflow.com/comment/44901197
type: Question
has comment: http://stackoverflow.com/comment/44901297
has title: Failed to sum variable in javascript
has body: I have script to sum amount that I get from ID's of html element, this is the script : &lt;script type="text/javascript"&gt; $(document).ready(function() { /* var sum=0; */ $('#checkAll').click(function(event) { //on click if(this.checked) { // check select status var i = 0; var sum = 0; $('.checkItem').each(function() { //loop through each checkbox this.checked = true; //select all checkboxes with class "checkbox1" sum = sum + parseInt($('#amount'+i).val()); i++; }); }else{ $('.checkItem').each(function() { //loop through each checkbox this.checked = false; //deselect all checkboxes with class "checkbox1" }); sum=0; i=0; } $('#totalRecord').val(i); $('#totalAmount').val(sum); $('#totalAmountFake').val(ChangeToRupiah(sum)); }); }); &lt;/script&gt; function ChangeToRupiah(angka){ var rev = parseInt(angka, 10).toString().split("").reverse().join(""); var rev2 = ""; for(var i = 0; i &lt; rev.length; i++){ rev2 += rev[i]; if((i + 1) % 3 === 0 &amp;&amp; i !== (rev.length - 1)){ rev2 += "."; } } return rev2.split("").reverse().join("") + ",00"; } But when i run it, i got this message in my result element : I guess it's about limitation of javascript variable, but it's not, I use Internet Explorer 9.
has comment: http://stackoverflow.com/comment/44900687
has comment: http://stackoverflow.com/comment/44900090

http://stackoverflow.com/a/28275383
answers question: http://stackoverflow.com/q/28275298
has body: It sure is function handle(e) { e.preventDefault(); window.open(this.href, "popupWindow", "width=600,height=600,scrollbars=yes"); } var el = document.querySelector('.req_faqs'); el.addEventListener('click',handle);
has comment: http://stackoverflow.com/comment/44905617
accepted answer of: http://stackoverflow.com/q/28275298
has comment: http://stackoverflow.com/comment/44905550
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28238472
has answer: http://stackoverflow.com/a/28238547
favorite count: 0
has body: http://jsfiddle.net/ujapned5/ I'm trying to make an "initializer" function that will be used to define CSS id and class names. function init() { //our empty array for pushing var DivNamingPushArray = []; //object where we define our properties that will be used later var namingScheme = { "parentId": { "firstChild": "blah", "secondChild": "blahblah", "thirdChild": "blahblahblah" } } //loop through the namingScheme object and push into array for (propOne in namingScheme) { DivNamingPushArray.push(propOne); for (propTwo in namingScheme[propOne]) { DivNamingPushArray.push(namingScheme[propOne][propTwo]) } } } function execute() { //call the "init" function init(); //this cannot be called console.log(DivNamingPushArray); //however, why can this be successfully called? console.log(propOne); } execute(); I would really prefer to keep these functions separate, instead of including execute inside init. There are other functions that will need to call the DivNamingPushArray variable later on. I am looking through the MDN documentation on variable scope but not finding a simple solution...
has answer: http://stackoverflow.com/a/28239078
has answer: http://stackoverflow.com/a/28238558
answer count: 5
has answer: http://stackoverflow.com/a/28238599
upvote count: 1
has comment: http://stackoverflow.com/comment/44838200
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28238712
type: Question
has title: JS variable scope: pushing into an array in one function and accessing it another function
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28238712
possible better answer: http://stackoverflow.com/a/28238547

http://stackoverflow.com/q/28173949
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28174413
has title: Request.JS and Node.js Data problems
has comment: http://stackoverflow.com/comment/44717323
has comment: http://stackoverflow.com/comment/44717234
type: UnansweredQuestion
score: 0
tagged with: node.js
has body: I am new to Node and I am developing an app that uses Request.JS to pull data from a private API. I need the data to be displayed in one of my views. Currently I have Request being required and defined in one of my routes, like so: var models = require('../models');// Required for sequelize var express = require('express');// Required for the Express framework var router = express.Router(); var request = require('request');// For requesting API data router.get('/', function (req, res) { request( // Request from API 'http://PrivateAPI.com:8080/reports/22?type=0&amp;key=privatekey', function (error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { console.log(body) // Print the return of the api call. } }) models.User.findAll({ // $$$-Define User DB call. }).then(function(users) { res.render('index', { title: 'Project Insight', users: users, request: request }); }); }) When this runs, I can see the output of the data in my console, but I wanted to know the best way to have it display in one of my views. Also, should I even have this in my route? Am lost, thanks for any help.

http://stackoverflow.com/comment/44730479
type: QuestionComment
type: Comment
has text: One thing you could do is position an empty ` ` over the video. That should allow you to retain the swiping functionality.
score: 0
comment on: http://stackoverflow.com/q/28180672

http://stackoverflow.com/comment/45337429
comment on: http://stackoverflow.com/a/28227634
score: 0
type: AnswerComment
has text: Indeed it was helpful, thank you. Unfortunately, after several tests and trials, I could not leave the date field as I wanted. I had to leave it a little smaller, occupying a space that it could be modified as the user changes the dimensions of the browser. I am grateful for your help and for your patience. Your answer unfortunately did not solve my problem, but in the right, I had better results, thank you. I think maybe what I'm trying is not possible, I do not know.
type: Comment

http://stackoverflow.com/comment/44722343
score: 0
type: QuestionComment
type: Comment
has text: https://www.dropbox.com/s/pqep6av09b83pxq/example.PNG -- this shows what the code itself looks like on the page. The image is washed out because dreamweaver is in the middle of crashing (stupid program) and I've added in the text "today is (DAY)" and "10am til when" myself so I could roughly format the rest of that section. I need one bit of code that will say what day it is "Wednesday" or whatever and I need this to just display in a way that I can format it. I then need the second bit of code, which you've provided for me above but I'm not sure what I'm doing wrong...
comment on: http://stackoverflow.com/q/28176313

http://stackoverflow.com/comment/44691540
score: 1
has text: I couldn't see the array myArray using inside your for loop...
comment on: http://stackoverflow.com/q/28160066
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28187166
answers question: http://stackoverflow.com/q/28186880
type: Answer
has body: Iterate over an array of functions and call them with arguments Iteration myFunctions.forEach(function(row){ row.fx.apply(null, row.arguments); }); Usage example: function add(a, b){return a + b;} function sub(a, b){return a - b;} var myFunctions = [ {fx: add, arguments:[2,5]}, {fx: sum, arguments: [10,3]} ]; myFunctions.forEach(function(row){ row.fx.apply(null, row.arguments); }); Further explanation There are three different methods to call function in JavaScript Direct Invoke add(1,3); Using function.call add.call(thisContext, 1, 3) Using function.apply add.apply(thisContext, [1, 3]) (same as call but it takes array of arguments, Remember hint: a in apply for array )
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44745679
downvote count: 0

http://stackoverflow.com/comment/44651173
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28139658
has text: If you still have the delay after changing to get the data prior to `document.ready` then your problem is probably in your rendering code, so please post that somewhere on fiddle so we can take a look
score: 0

http://stackoverflow.com/a/28150091
has body: You either need to add the corresponding css for that class or change the tag like @john_Smith specified Adding the CSS span.red { color: red; } Changing the tag On your code replace this getMsg = getMsg.replace('/i/gi'); for getMsg = getMsg.replace('/i/gi'); Some example of inline css Some advice on color palettes Try looking into d3 color scales(https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors) or apply a principle similar to incrementing an RGB value instead of using names of colors. Hope this helps.
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28149644
upvote count: 1
has comment: http://stackoverflow.com/comment/44753486

http://stackoverflow.com/q/28263875
has answer: http://stackoverflow.com/a/28265600
type: AnsweredQuestion
has title: fancybox opens in new tab
type: Question
possible better answer: http://stackoverflow.com/a/39905111
tagged with: javascript
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/14344289
tagged with: jquery
has body: I have following html: &lt;a href="createCompany/getOriginalImage/1" class="fancy_image"&gt;&lt;img id="right_tab_image" src="createCompany/getSmallThumbnail/1" alt=""&gt;&lt;/a&gt; And following code executes(tested in debug) when page loads: $(document).ready(function(){ $(".fancy_image").fancybox({ type : 'image', openEffect : 'none', closeEffect : 'none' }); }); and to the the page include following sources: But when I click on href image opens but in another tab. What did I forget ?
has comment: http://stackoverflow.com/comment/44889639
accepted answer: http://stackoverflow.com/a/28265600
has answer: http://stackoverflow.com/a/39905111
tagged with: fancybox

http://stackoverflow.com/comment/44803261
has text: Your .NET code receives a set of URL variables (`GET` in some languages). It doesn't appear that you're sending it any of your own, but DataTable sends it `sEcho`, `iSortCol1`, `iSortCol2`, `sSortDir1`, `sSortDir2`, `sSortDir3`, etc.
type: AnswerComment
comment on: http://stackoverflow.com/a/28218230
score: 0
type: Comment

http://stackoverflow.com/a/28133510
has body: Just a couple of comments before the answer. Please note that you are missing the html tag at the begging, and that you are using the incorrect bar "\" to close tags in table headers (it should be < /th>) and in the button tag (< /button>). Also, the div inside the table is not correct. The code does nothing because the function just gets the innerHTML. For your purpose, the function should get what's inside the table, add a row and then paste it back on the table Price Location Insert Table
has comment: http://stackoverflow.com/comment/44645719
type: Answer
answers question: http://stackoverflow.com/q/28133404
score: 0

http://stackoverflow.com/comment/44746335
comment on: http://stackoverflow.com/q/28187507
type: Comment
type: QuestionComment
has text: @micha it's like I don't want to include the date that is not today's date in the table
score: 0

iron-router
tags question: http://stackoverflow.com/q/28234857
tags question: http://stackoverflow.com/q/28258978
tags question: http://stackoverflow.com/q/28253283
tags question: http://stackoverflow.com/q/28256484
tags question: http://stackoverflow.com/q/28132404
tags question: http://stackoverflow.com/q/28256234
tags question: http://stackoverflow.com/q/28269399
tags question: http://stackoverflow.com/q/28268538
tags question: http://stackoverflow.com/q/28195801
tags question: http://stackoverflow.com/q/28262012
tag name: iron-router
tags question: http://stackoverflow.com/q/28168471
tags question: http://stackoverflow.com/q/28135919
type: Tag
tags question: http://stackoverflow.com/q/28239202

http://stackoverflow.com/comment/44720535
type: QuestionComment
comment on: http://stackoverflow.com/q/28174996
score: 0
has text: MelanciaUK Thank u so much. Its solved. I cannot understood at 1st how to explain my problem and search here for solved it. Thank again sir.
type: Comment

http://stackoverflow.com/comment/44868228
type: AnswerComment
comment on: http://stackoverflow.com/a/28254820
score: 0
type: Comment
has text: It works! That's what I tried before but it didn't work for me with any Grunttask... I will have to run some tests again. Thanks.

readonly
tag name: readonly
type: Tag
tags question: http://stackoverflow.com/q/28135705

http://stackoverflow.com/a/28273202
has comment: http://stackoverflow.com/comment/44901682
score: 0
has body: You could use ng-init to select the ng-model value by their $index: Updated your Fiddle.
type: Answer
has comment: http://stackoverflow.com/comment/44901912
has comment: http://stackoverflow.com/comment/44901845
answers question: http://stackoverflow.com/q/28273013

http://stackoverflow.com/comment/61298500
type: AnswerComment
comment on: http://stackoverflow.com/a/28256972
type: Comment
has text: Are you trying to do it in a custom example or a Google example? The second link that you provide on the question is broken so I cannot see where are you trying to do that. I am using `console.log` on my custom example and it works perfectly.
score: 0

http://stackoverflow.com/comment/44725486
type: AnswerComment
comment on: http://stackoverflow.com/a/28177761
has text: I use AngularJS v1.3.10
type: Comment
score: 0

http://stackoverflow.com/comment/44833738
score: 0
type: Comment
type: QuestionComment
has text: By that logic 2 points should be 16.666 and 33.333. You divide 50 by number of points + 1 and that's your length
comment on: http://stackoverflow.com/q/28235888

http://stackoverflow.com/q/28218837
has answer: http://stackoverflow.com/a/28219643
possible better answer: http://stackoverflow.com/a/28218972
accepted answer: http://stackoverflow.com/a/28219643
has title: Searching a JSON file in AngularJS
type: Question
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/28219002
upvote count: 1
has body: So I have the following service/factory setup that should query a JSON file: myappServices.factory('Result', ['$resource', function($resource){ return $resource('search.json', {}, { query: { method:'GET', params: {}, isArray:true } }); }]); And then in my SearchCtrl I have: myappControllers.controller('SearchCtrl', function($rootScope, $scope, $state, Result, $location) { $scope.query = ($state.includes('search') ? $location.search()['q'] : ''); $scope.filterQuery = ($state.includes('search') ? $location.search()['q'] : ''); $scope.queryChanged = function () { if($scope.query){ $state.go('search', {'q': $scope.query} ); $scope.results = Result.query(); } else { $location.search('q', null); } $scope.filterQuery = $scope.query; } if($scope.query){ $scope.results = Result.query(); } else { $location.search('q', null); } }); The search results page looks like: 0"> {{result.name}} {{result.snippet}} Nothing here! If I do a query like: /search?=hello Then ALL the results in the JSON file are returned REGARDLESS of what I have searched for (should only be showing results that match). However if I don't do a query then no results are shown (correct behaviour). Why is the query not being used against the JSON file to filter the results? I did originally have the repeater as: But that would be incorrect in this case, as it's would be saying show me the results but filter them using the filterQuery. But in reality there would never be any results if no query, hence removing this part of the repeater. As I don't want to filter a list but return a list filtered. So it would seem I am missing something in my service to handle this.
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28218972
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28256280
downvote count: 1
has answer: http://stackoverflow.com/a/28256301
tagged with: javascript
type: UnansweredQuestion
has body: function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geen geolocatie hier."; } function showPosition(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; var total = String(lat).concat(',', String(lon)); } How do I get that last 'total'-variable to be usable in other functions? And why doesn't declaring a global variable in the showPosition() function seem to work?
upvote count: 0
favorite count: 0
has title: How do I get my HTML5 Location result in a global variable?
has answer: http://stackoverflow.com/a/28256336
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -1
answer count: 2

http://stackoverflow.com/comment/44664967
score: 0
comment on: http://stackoverflow.com/q/28146276
has text: @Second Rikudo: I agree on that a promise should eventually be resolved or rejected. Insofar, my above code is not complete - in a real piece of code, `waitForMessage` should have a way to reject the promise when listening for further incoming messages should stop. For otherwise, the main loop would run forever.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44791149
score: 0
has text: 1. I'm using angular ng-click to bind the save function, I cannot use id to bind it. 2. Keyboards shortcuts are ment to trigger buttons. 3. I do not want to have to check the button state, it's an hassle
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28213070

http://stackoverflow.com/a/28236257
answers question: http://stackoverflow.com/q/28235888
accepted answer of: http://stackoverflow.com/q/28235888
type: Answer
score: 0
has body: You could divide the side of the the rectangle into n+1 or m+1 segments of equal length: if the side has a length of H, the length of a segment would be h=H/(n+1), so your ports would be at location (y) h,2*h,3*h...
type: AcceptedAnswer

http://stackoverflow.com/q/28280022
tagged with: focus
has comment: http://stackoverflow.com/comment/44914211
answer count: 1
has comment: http://stackoverflow.com/comment/44915092
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44914972
has comment: http://stackoverflow.com/comment/44914136
has title: SAPUI5 switch focus
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28287287
has comment: http://stackoverflow.com/comment/44914472
score: 1
has comment: http://stackoverflow.com/comment/44914087
tagged with: sapui5
upvote count: 1
accepted answer: http://stackoverflow.com/a/28287287
type: Question
has body: In my code I have textarea and dropdown input with binded model data. When changing dropdown value textarea gets new value and changes its content. Problem is that I would like to focus to switch from dropdown to textarea. Currently I have modified liveChange event like this: flavorScriptsDDLB.liveChange = function(ev) { _scriptModel.setProperty("@selectedScript", textArea.getValue()); _scriptModel.setSelectedScriptID(ev.getSource().getSelectedKey()); textArea.setEnabled(true); textArea.focus(); }; but still dropdown keeps the focus instead of switching it to textarea. Found relative Question here, but it was unanswered also.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44914703

http://stackoverflow.com/comment/44790705
comment on: http://stackoverflow.com/q/28212637
type: Comment
type: QuestionComment
has text: Yep, It's related to the @sepulchered answer. The first parameter of Function.call is the `thisArg` and not the first argument. See : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
score: 1

http://stackoverflow.com/comment/45033983
score: 0
type: QuestionComment
type: Comment
has text: Hi. I can not link it, since I do not have it in accessible in internet. Do you know any places (good ones) to place projects, that works good with linking in stackoverflow?
comment on: http://stackoverflow.com/q/28217985

http://stackoverflow.com/a/34186262
score: 2
has body: If you like Ruby, take a look at Capybara. You'll probably also want to use Xvfb so that you can run the tests on a machine that doesn't have a display. Here is an example snippet that will let you open Chome with the switches that Philipp suggests. I've used this to create a headless video recording test. Capybara.register_driver :chrome do |app| switches = %w(disable-popup-blocking disable-translate use-fake-ui-for-media-stream use-fake-device-for-media-stream test-type) Capybara::Selenium::Driver.new(app, browser: :chrome, switches: switches) end
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28228905
has comment: http://stackoverflow.com/comment/116260971

http://stackoverflow.com/a/28215975
type: Answer
accepted answer of: http://stackoverflow.com/q/28213093
score: 0
type: AcceptedAnswer
has body: can solve, following the codes below: icon: &lt;img id="heart-m-&lt;?php echo $id ?&gt;" src="&lt;?php if ($item-&gt;getPriority() &lt; 1) { echo $this-&gt;getSkinUrl('images/heart-m-disabled.png'); } else { echo $this-&gt;getSkinUrl('images/heart-m.png'); } ?&gt;" alt="" onclick='adicionaFav(&lt;?php echo $id ?&gt;)'/&gt; &lt;/div&gt; Javascript code: &lt;script type="text/javascript"&gt; var $jq = jQuery.noConflict(); var heart_m = "&lt;?php echo $this-&gt;getSkinUrl('images/heart-m.png') ?&gt;"; var heart_m_disabled = "&lt;?php echo $this-&gt;getSkinUrl('images/heart-m-disabled.png') ?&gt;"; var valor; function adicionaFav(id) { if (document.getElementById("heart-m-" + id).src == "&lt;?php echo $this-&gt;getSkinUrl('images/heart-m-disabled.png');?&gt;") { $jq("#heart-m-" + id).attr("src", heart_m); $jq('#priority-select-' + id).val('1'); } else { $jq("#heart-m-" + id).attr("src", heart_m_disabled); $jq('#priority-select-' + id).val('0'); } } function priorityChange(size, id) { if (size == 1) { $jq("#heart-m-" + id).attr("src", heart_m); } else { $jq("#heart-m-" + id).attr("src", heart_m_disabled); } } &lt;/script&gt; hope I can to help someone!! =)
answers question: http://stackoverflow.com/q/28213093

http://stackoverflow.com/a/28155641
has comment: http://stackoverflow.com/comment/44682700
has comment: http://stackoverflow.com/comment/44682585
has body: You need to use event.stopPropagation: $('div.b').on('click',function(e){ e.stopPropagation(); //... }); Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28155601
has comment: http://stackoverflow.com/comment/44682755
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28155601
has comment: http://stackoverflow.com/comment/44683288
type: Answer

http://stackoverflow.com/a/28182238
answers question: http://stackoverflow.com/q/28182062
type: Answer
has body: You can try using jquery.serialize() method, then split the result string by & check if differents parameter has a value and insert in another array if it has, finally join the result string using & and change the location.href using your url and concatenate the result string with your parameters (of course instead of all this split,join... stuff you can do it with a regex using string.replace): $( "form" ).on( "submit", function( event ) { event.preventDefault(); var url = $( this ).serialize(); var array = url.split('&'); var resultArray = []; for(i in array){ console.log(array[i].split('=')); if(array[i].split('=')[1]){ resultArray.push(array[i]); } } var url_params = resultArray.join('&'); var yourURL = "http://your_url" + "?" + url_params; // do your get... alert("location.href to " + yourURL); location.href = yourURL; }); a a Hope this helps,
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/44638306
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28130317
has text: wow - that's beautiful - I was going for something a bit more retro but I'll see if I can work with that. Thanks for the link.
type: Comment

http://stackoverflow.com/q/28153025
has title: Node.js - Async.js map function only showing results of the last iteration?
has body: Sorry for the title, but I can't think of an easier way to word this. I'm trying to use the async library with Node.js to run 3 asynchronous functions and do some operation on the results of all 3. From what I understand, the map() function allows me to run all 3 and apply an argument to an iterator, then provide a callback to operate on the results of all 3 async functions (stored in an array). The results are showing 3 successful responses, but they all contain the data from that last (3rd) function run, the other 2 are overwritten for some reason. For example, /**map the array of exchange names through the iterator function * xchange is an external library which has functions of the form - * xchange.bitstamp.ticker(callback), xchange.bitfinex.ticker(callback), etc.. */ var xchange = require("xchange.js"), async = require("async"); async.map([ "bitfinex", "bitstamp", "okcoin" ], function(item, callback) { xchange[item].ticker(function(err, body) { console.log("item: " + item); console.log(body); return callback(err, body); }); }, function(err, results) { console.log(results); }); //print out item: bitstamp { bid: 275.16, ask: 275.21, low: 245, high: 309.9, volume: 54017.1092978, timestamp: 1422283998 } item: okcoin { bid: 279.25, ask: 280.44, low: 242.93, high: 310.57, volume: 29342.543, timestamp: 1422284015 } item: bitfinex { bid: 279.2, ask: 279.77, low: 246.59, high: 315, volume: 165380.17021898, timestamp: 1422284011.1361156 } //Why are these all from the last run? Should be the results of all 3 above [ { bid: 279.2, ask: 279.77, low: 246.59, high: 315, volume: 165380.17021898, timestamp: 1422284011.1361156 }, { bid: 279.2, ask: 279.77, low: 246.59, high: 315, volume: 165380.17021898, timestamp: 1422284011.1361156 }, { bid: 279.2, ask: 279.77, low: 246.59, high: 315, volume: 165380.17021898, timestamp: 1422284011.1361156 } ] Basically the xchange ticker function uses the request module to call an http request on each ticker api. The results (somewhat transfor…
type: Question
tagged with: async.js
has answer: http://stackoverflow.com/a/65627476
has answer: http://stackoverflow.com/a/28329679
accepted answer: http://stackoverflow.com/a/28329679
has comment: http://stackoverflow.com/comment/45007009
score: 0
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/65627476
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28147378
type: AnsweredQuestion
tagged with: math
has answer: http://stackoverflow.com/a/28147769
tagged with: seconds
has body: I was having some problem when trying to perform some calculation logic using JavaScript. Basically along a route there is 80 steps and it took around 9 minutes to finish up the entire route. So I was trying to do an auto route which will tell you the minutes left to destination. My logic is as below: 9 * 60 / 80 = 6.75 So basically for each step is 6.75 seconds but I wanted to show a round number like 9 instead of 8.4 minutes. Here is the code: getAllBusLoc(function(busList) { var totalBusLoc = busList.length; var busLeftPct = Math.round(parseFloat(busList.length) * 40 / 100) document.getElementById("busStopLeft").innerHTML = totalBusLoc; pointArr.forEach(function(coord,index){ setTimeout(function(){ var travelTime = document.getElementById(travelDistMin").value; moveNext(coord.x, coord.y); }, 1000* index); }); }); I got the travel time as variable travelTime which in this case is 9 minutes. For each point, I wanted to minus 6.75 seconds from the 9 minutes and display a round number instead of 8.2. Any ideas? Thanks in advance.
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44666387
possible better answer: http://stackoverflow.com/a/28147771
has comment: http://stackoverflow.com/comment/44666739
tagged with: javascript
score: -1
has title: JavaScript calculate time and seconds
upvote count: 2
downvote count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/44666933
tagged with: time
has answer: http://stackoverflow.com/a/28147771
accepted answer: http://stackoverflow.com/a/28147769
tagged with: minute

http://stackoverflow.com/q/28171878
has answer: http://stackoverflow.com/a/28172005
accepted answer: http://stackoverflow.com/a/28172005
type: AnsweredQuestion
tagged with: wysiwyg
downvote count: 3
type: Question
upvote count: 0
has title: Edit an html page like the concept of WYSIWYG
tagged with: content-management-system
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44712964
has body: I would like to give The admin: The ability to edit parts in an html page lively by chnaging the view to something like WYSIWYG. After submit, the entire content must change Something similar to the edit mode in DRUPAL: Image: http://s9.postimg.org/lp1rnaqgv/Capture.jpg Is there any plugin or ideas?
score: -3
has comment: http://stackoverflow.com/comment/44712968
has comment: http://stackoverflow.com/comment/44712953
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28200182
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28200504
favorite count: 0
has comment: http://stackoverflow.com/comment/44766778
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28200292
type: AnsweredQuestion
score: 2
has title: AngularJS directive parameter "ctrls"
downvote count: 0
has answer: http://stackoverflow.com/a/28200292
possible better answer: http://stackoverflow.com/a/28200504
has body: I see a link function in a directive in Angular like so: link: function (scope, element, attrs, ctrls) { var ngModelCtrl = ctrls[0], invalidInputController = ctrls[1]; // ... } Can someone help me understand where the controllers in the ctrl parameter are coming from? Edit: the directive has an angular require property specifying two other directives by name like so: require: ['ngModel', '?numberFormatterPreventInvalidInput'], I suspect they come from there.

http://stackoverflow.com/comment/44648423
comment on: http://stackoverflow.com/q/28138228
score: 0
type: QuestionComment
type: Comment
has text: The code is already posted @Mouser

http://stackoverflow.com/comment/44856781
type: QuestionComment
has text: Please ignore previous link. Use this http://jsbin.com/kehovazeja/1/edit?html,js,console,output
comment on: http://stackoverflow.com/q/28234922
score: 0
type: Comment

http://stackoverflow.com/comment/44620352
type: AnswerComment
type: Comment
has text: Just create a variable and store the reference to your ` ` element using the `document.getElementById()` method, then in your if/else, change the `src` property on the variable that you use to store the reference to your ` ` element. Make sense?
comment on: http://stackoverflow.com/a/28123293
score: 0

http://stackoverflow.com/q/28173410
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28173614
tagged with: css
has title: selecting/highlighting a column only from a table 'like github does it'?
answer count: 4
has answer: http://stackoverflow.com/a/28173614
has answer: http://stackoverflow.com/a/28174180
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28173566
upvote count: 1
has body: The source code in github is stored in a html table like this: 1 // here is a comment 2 var i = 1; 3 console.log(i); How can I select/highlight this table so that I don't select the line numbers ? In other words: How can I select only a portion of a second column ? I know github does it but I can't work out how possibly without jquery
type: Question
has answer: http://stackoverflow.com/a/28173617
tagged with: javascript
downvote count: 0
has answer: http://stackoverflow.com/a/28173566
has comment: http://stackoverflow.com/comment/44716973
score: 1
has comment: http://stackoverflow.com/comment/44718426
favorite count: 0

http://stackoverflow.com/q/28199421
linked to: http://stackoverflow.com/q/21286599
has answer: http://stackoverflow.com/a/28199967
has answer: http://stackoverflow.com/a/28199895
has title: How to create UTC Time in Express for Mongo Query in Express.js
type: Question
possible better answer: http://stackoverflow.com/a/28199967
accepted answer: http://stackoverflow.com/a/28199895
has answer: http://stackoverflow.com/a/58358658
tagged with: mongoose
tagged with: javascript
tagged with: express
score: 0
answer count: 3
has body: This has probably been asked a hundred times, yet I dare to ask: In express / mongoose I need to create a UTC ISO date in order to query MongoDB. This is what I am doing: var date = new Date(req.params.date + " 00:00:00 UTC").toUTCString(); Whereas req.params.date equals this string: 2015-01-01. Above line creates: Mon, 12 Jan 2015 00:00:00 GMT, in MongoDB I have: "date" : ISODate("2014-12-08T00:00:00.000Z") How do I get this to work?
type: AnsweredQuestion

http://stackoverflow.com/q/28193018
has comment: http://stackoverflow.com/comment/44790179
downvote count: 0
tagged with: jquery
tagged with: file-upload
has comment: http://stackoverflow.com/comment/44757538
favorite count: 0
has comment: http://stackoverflow.com/comment/44779604
linked to: http://stackoverflow.com/q/3582671
linked to: http://stackoverflow.com/q/1268839
type: UnansweredQuestion
tagged with: onload
has title: Browser hangs after uploading large file on client side using javascript
answer count: 0
score: 1
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/44756826
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44753119
has body: I was making a client side javascript application which uploads the file on client side only and process it on client side itself. (IT DOESN'T SEND THE FILE TO SERVER) The code which I have written loads small files on client side easily but hangs the browser on loading Large files(like files of size 100MB). I have put an alert after the file has been loaded(i.e inside onload function). SO even if when I try uploading large files it is giving me the alert, which means that the file has been loaded but when it tries to copy the file text blob saved in a variable to the inner html of a div then the browser gets hanged. I have written the code on JSFIDDLE (http://jsfiddle.net/q0x90jsv/1/) as well as below. HTML code Data will appear here Javascript Code function readFile(evt) { var files = evt.target.files; var file = files[0]; var reader = new FileReader(); // reader.onload = function() { // console.log(this.result); // } reader.readAsText(file) reader.onload = function (e) { alert("FILE LOADED"); var f = reader.result; document.getElementById("sel").innerHTML = f; } } $(document).ready(function () { //adding mouse up listener to get selected text from left pane document.getElementById('myfile').addEventListener('change', readFile, false); }); Additionally when I tried opening the large file(100MB) in browser(using simple FILE->OPEN->BROWSE FILE->OPEN) It got opened easily. Please let me know if there is a way out to accomplish this.
tagged with: javascript

http://stackoverflow.com/q/28278626
tagged with: javascript
has comment: http://stackoverflow.com/comment/44911441
downvote count: 0
linked to: http://stackoverflow.com/q/279170
has comment: http://stackoverflow.com/comment/44911742
has comment: http://stackoverflow.com/comment/44911479
favorite count: 0
has comment: http://stackoverflow.com/comment/44911607
tagged with: ajax
duplicate of: http://stackoverflow.com/q/279170
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44911897
tagged with: utf-8
tagged with: php
answer count: 0
has title: After submitting a form with ajax, my utf-8 is not working, why is that?
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44911576
type: Question
has comment: http://stackoverflow.com/comment/44911385
has body: I have a checkbox, which changes the content of a table when it's clicked. For some reason, my UTF-8 is no longer working after I have submitted the form with ajax. Ajax: function showUser() { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { document.getElementById("table").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?customer="+variable); xmlhttp.send(); } and getuser.php: $customer = intval($_GET['customer']); $connection = mysqli_connect('localhost','root','*********','name'); if (!$connection) { die("Could not connect: " . mysqli_error($connection)); } if($customer == 1) { $searchType= 1; } else { $searchType= 0; } $sql="SELECT * FROM table WHERE type= $searchType"; $result = mysqli_query($connection,$sql); After this I echo a table with content got from the database. In my database there is some customers that has some special characters in their name. Instead of showing them like usual, it only shows ? in place of those special characters. Any help? (sry for my bad english)

http://stackoverflow.com/comment/44719328
score: 0
has text: @UIDesigner: no idea :/
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28174791

http://stackoverflow.com/comment/44765683
comment on: http://stackoverflow.com/a/28198857
type: AnswerComment
has text: @haim770 These all worked but yours seemed the safest. Thanks!
score: 0
type: Comment

http://stackoverflow.com/comment/44844138
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28240874
has text: @DayanMorenoLeon My console.log?

http://stackoverflow.com/q/28153982
has body: I'm working on my first chrome extension. Its a password manager app with some additional functionalities over the chrome default password manager. Now I have a request from client to fetch all the passwords from the chrome password manager and store it in the chrome extension. I have browsed through many stackoverflow posts and other posts online, but none of them answer achieving this in a chrome extension. I know this is definitely achievable as there are third party apps like LastPass, ChromePass which have implemented this. Could somebody please give me some pointers on how to go about with this? I know Chrome stores the password data in DB named 'Login Data' and the password will be stored encrypted which is OS dependent.
linked to: http://stackoverflow.com/q/14426841
has comment: http://stackoverflow.com/comment/44679607
has comment: http://stackoverflow.com/comment/44686751
has comment: http://stackoverflow.com/comment/44698170
score: 2
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44705247
has comment: http://stackoverflow.com/comment/44698286
has comment: http://stackoverflow.com/comment/44697010
tagged with: google-chrome-app
tagged with: angularjs
type: Question
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/44698052
has answer: http://stackoverflow.com/a/28173447
favorite count: 0
has comment: http://stackoverflow.com/comment/44679951
upvote count: 2
has comment: http://stackoverflow.com/comment/44699022
has comment: http://stackoverflow.com/comment/44714661
has comment: http://stackoverflow.com/comment/44696979
tagged with: google-chrome
answer count: 1
has comment: http://stackoverflow.com/comment/44679570
has title: Programatically import passwords from Chrome Password Manager onto Chrome Extension
has comment: http://stackoverflow.com/comment/44679785

windows-runtime
tags question: http://stackoverflow.com/q/28267393
tag name: windows-runtime
type: Tag

http://stackoverflow.com/q/28259739
linked to: http://stackoverflow.com/q/10073894
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44883673
has answer: http://stackoverflow.com/a/28263603
tagged with: twitter-bootstrap
linked to: http://stackoverflow.com/q/78548
has title: How do I hide an element in the shared layout based on the controller in MVC
has comment: http://stackoverflow.com/comment/44877225
accepted answer: http://stackoverflow.com/a/28263603
has body: I have a bootstrap navbar at the top of my page main page and inside it is a text input. I want it hidden until a search is performed and the user sees the results in the results controller . This is inside my bootstrap navbar. &lt;input type="text" class="form-control" placeholder="Search"&gt; For example: Hidden: www.example.com/home/index Visible: www.example.com/results
type: AnsweredQuestion
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44877273
has comment: http://stackoverflow.com/comment/44877104
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/44898877
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/6848055
favorite count: 0

http://stackoverflow.com/q/28185977
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/44740612
has comment: http://stackoverflow.com/comment/44740684
score: 0
has comment: http://stackoverflow.com/comment/44740565
answer count: 1
has title: Angular js ng-repeat work based on id
tagged with: javascript
has comment: http://stackoverflow.com/comment/44740733
type: UnansweredQuestion
has body: I have requirement where i have two table ,i want logic like if id==1 then only ng-repeat works $(#1).(ng-repeat work) something like this eg: &lt;table id="1"&gt; &lt;tr ng-repeat="item in items"&gt; &lt;td&gt;&lt;/td&gt; &lt;/table&gt; &lt;table id="2"&gt; &lt;tr ng-repeat="item in items"&gt; &lt;td&gt;&lt;/td&gt; &lt;/table&gt; I want control something like where id is 1 or 2 there only ng-repeat work.i dont want to change model. Fiddle Link:-http://jsfiddle.net/alokranjan39/7MhLd/575/ Thanks
has answer: http://stackoverflow.com/a/28186066
tagged with: jquery

http://stackoverflow.com/q/28127672
has body: I have a problem with an AJAX request (POST method) with pure Javascript. I have the following function: function ajaxPost(page, fields) { XHR = new XMLHttpRequest(); XHR.open("POST", page, false); XHR.setRequestHeader("content-type", "application/x-www-form-urlencoded"); if(XHR.readyState == 4 &amp;&amp; XHR.status == 200) { return XHR.responseText; } XHR.send(fields); } and the page where I need to do an ajax request I make the following: &lt;script type="text/javascript"&gt; var ajax = ajaxPost("ajax/ajax.php", "var1=bla&amp;var2=blabla"); alert(ajax); &lt;/script&gt; While in ajax/ajax.php: &lt;?php if(isset($_POST['var1') &amp;&amp; isset($_POST['var2'])) { echo var1 . " " . var2; } ?&gt; But the alert displays the value "undefined", where is that wrong?
upvote count: 2
has comment: http://stackoverflow.com/comment/44628731
has comment: http://stackoverflow.com/comment/44628695
has comment: http://stackoverflow.com/comment/44628355
downvote count: 1
has comment: http://stackoverflow.com/comment/44628296
type: Question
has comment: http://stackoverflow.com/comment/44628896
has comment: http://stackoverflow.com/comment/44628324
has comment: http://stackoverflow.com/comment/44628884
tagged with: post
has answer: http://stackoverflow.com/a/28127749
answer count: 1
tagged with: javascript
score: 1
has title: Error in a javascript ajax post
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44628916
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44628835
tagged with: php
has comment: http://stackoverflow.com/comment/44628615

http://stackoverflow.com/a/28130932
has body: You have sn class not subnav. I changed to sn in you code and you can now see styling come at me bro
type: Answer
has comment: http://stackoverflow.com/comment/44634653
has comment: http://stackoverflow.com/comment/44634553
answers question: http://stackoverflow.com/q/28130266
score: 0

http://stackoverflow.com/a/28221010
score: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/28220957
answers question: http://stackoverflow.com/q/28220957
upvote count: 3
has body: You have wrong selector to target elements .showhide from siblings .acc-s-container divs of clicked divs parent.use: function showHide(button){ $(button).next('.showhide').toggle().parent().siblings().find('.showhide').hide(); } Working Demo
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44665757
type: AnswerComment
has text: Ok I understand, one more thing would the css be visibility: hidden or display:none?
comment on: http://stackoverflow.com/a/28146537
type: Comment
score: 0

http://stackoverflow.com/q/28221009
has title: ui-screen-shooter not running
tagged with: ios-ui-automation
has comment: http://stackoverflow.com/comment/44805138
type: Question
has comment: http://stackoverflow.com/comment/44805786
tagged with: ios
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44805629
type: UnansweredQuestion
has body: I am using ui-screen-shooter to try to take localized screen shots, but i am having issues running ./ui-screen-shooter. I've followed all the instructions and think i have all the script files. but i get the following error when i run ./ui-screen-shooter: ./ui-screen-shooter.sh ~/Desktop/screenshots /Users/andyphillips404/Documents/Projects/DoggeryApps/Photo Finish/config-screenshots.sh: line 24: syntax error near unexpected token `(' I am not sure what is wrong. Here is a copy of my config-screenshots.sh: #!/bin/bash # This is an example configuration file to be used with ui-screen-shooter # It is designed to work with the Hello World International application # Please copy to config-screenshots.sh and edit for your needs # LOCALE # ====== # Set the locales here in which your screenshots should be made. # Use format like en-US zh-Hans for filenames compatible with iTMSTransporter # Note: to get the locale names for your existing app: # - Download .itmsp file with iTMSTransporter # - Run `grep locale ~/Desktop/*.itmsp/metadata.xml | grep name | sort -u` export languages="en-US da de es fr it ja nl pt ru zh-Hans zh-Hant” # SIMULATORS # ========== # The simulators we want to run the script against, declared as a Bash array. # Run `instruments -s devices` to get a list of all the possible string values. declare -xa simulators=( "iPhone 6 (8.1 Simulator)", "iPhone 6 Plus (8.1 Simulator)", "iPhone 5 (8.1 Simulator)", "iPhone 4s (8.1 Simulator)" ) Anyone have any idea, guessing the issue is with the declare statement from the error code but can't figure out why....
has answer: http://stackoverflow.com/a/28221374

http://stackoverflow.com/comment/44660751
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28144474
type: Comment
has text: You can do this, but I'd suggest at this point that you hook up a light database and use a message queue instead of constantly checking a file for updates. My personal recommendation would be Redis, it's lightweight and relatively simple for this kind of task.

flux
tag name: flux
tags question: http://stackoverflow.com/q/28179086
type: Tag

http://stackoverflow.com/comment/44704339
has text: It's not possible to differentiate a browser close or a navigation. If you must, make a single-page app and/or load all data via AJAX or similar.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28167051
score: 0

http://stackoverflow.com/q/28182771
answer count: 2
has comment: http://stackoverflow.com/comment/44734977
tagged with: javascript
score: 0
has body: This my code: &lt;script type="text/javascript" language="javascript"&gt; var youtubeimgsrc = document.getElementById('youtubeimg').src; document.write(youtubeimgsrc); &lt;/script&gt; &lt;img src="https://yt3.ggpht.com/-xf7anhq4eRo/AAAAAAAAAAI/AAAAAAAAAAA/wQIFalodFjE/s88-c-k-no/photo.jpg" id="youtubeimg"&gt; Jsfiddle: http://jsfiddle.net/vrnsydLb/ I have to put script code before img but it is not working. I tried onload, it worked but all content was removed in page. Is there any way for work?
has answer: http://stackoverflow.com/a/28183062
has title: Output text before tag
has comment: http://stackoverflow.com/comment/44734842
has comment: http://stackoverflow.com/comment/44734771
type: UnansweredQuestion
tagged with: onload
has answer: http://stackoverflow.com/a/28184005
tagged with: image
type: Question

http://stackoverflow.com/q/28205874
tagged with: add-on
answer count: 0
tagged with: javascript
type: UnansweredQuestion
score: 6
linked to: http://stackoverflow.com/q/42139643
has comment: http://stackoverflow.com/comment/45953457
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44894081
has title: Can node-webkit C++ addon write to ImageData object created in JavaScript context?
type: Question
tagged with: node-webkit
upvote count: 6
tagged with: node.js
tagged with: c++
has comment: http://stackoverflow.com/comment/44900073
has comment: http://stackoverflow.com/comment/71452427
has body: I'm writing a node-webkit addon in C++ that decodes image data and returns an array of pixel data to the caller. The following code (abridged for brevity) works just fine: caller.js var image_data = canvas_context.createImageData(w, h); var addon = require('decoder.node'); var decoder = new addon.Decoder(); var pixel_array = decoder.getPixelArray(); image_data.data.set(pixel_array); canvas_context.putImageData(image_data); decoder.cpp Handle&lt;Value&gt; Decoder::getPixelArray(const Arguments &amp;args) { HandleScope scope; // unwrap self DecoderObj *obj = ObjectWrap::Unwrap&lt;DecoderObj&gt;(args.This()); if (obj == NULL) return scope.Close(Number::New(1)); // get pointer to pixel data PixelPtr *ptr = NULL; uint64_t len = 0; obj-&gt;GetPixelsPtr((PixelPtr*)&amp;ptr, &amp;len); // create javascript native array // from http://luismreis.github.io/node-bindings-guide/docs/returning.html v8::Handle&lt;Value&gt; fun_val = Context::GetCurrent()-&gt;Global()-&gt;Get(String::New("Uint8ClampedArray")); v8::Handle&lt;Function&gt; fun = v8::Handle&lt;Function&gt;::Cast(fun_val); const unsigned argc = 1; Local&lt;Value&gt; argv[argc] = { Local&lt;Value&gt;::New(Uint32::New(len)) }; Local&lt;v8::Object&gt; array = fun-&gt;NewInstance(argc, argv); // populate js native array with pixel ptr data array-&gt;SetIndexedPropertiesToExternalArrayData(ptr, v8::kExternalUnsignedByteArray, len); // return native array to javascript caller return scope.Close(array); } The only problem is when the caller invokes the set() method on the ImageData object. This has proven to be unacceptably slow (i.e. >= 20ms). I assume the slowness is due to a large amount of data being copied from one memory location to another. So I thought I'd try to fix this by passing a reference to the ImageData object into the addon, and then have the addon write directly to the object, thereby eliminating the need for a memory copy. Unfortunately I haven't been able to get this to work. Here's the modified code that d…

http://stackoverflow.com/a/28253330
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28253114
type: Answer
accepted answer of: http://stackoverflow.com/q/28253114
downvote count: 0
has body: The string "\"Beginner\",\"Advanced\"]" is not valid JSON, so no, it will not parse. You either need to stop using JSON (it's really not apparent why you are here) or use a correctly formatted JSON string. In the first case, you would simply pass around JavaScript arrays, and specify your configuration with an array literal: App.initialize({ projects: [{skill: ['Beginner', 'Advanced']}] }); In the second case, you need to produce a valid JSON string in order to parse it: App.initialize({ projectsJson: [{skill: '["Beginner","Advanced"]'}] }); In either case, you can make things far easier on yourself by choosing the correct quotes so that you don't need to escape your internal quotes, and by not needlessly wrapping your object literal keys in quotes.
score: 1

http://stackoverflow.com/comment/44905004
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28274834
has text: how to add jQuery library
type: AnswerComment

http://stackoverflow.com/a/28127679
answers question: http://stackoverflow.com/q/28127607
has body: If you know that the parentheses are always the first and last character, you can use substr to remove them: str.substr(1, str.length - 2) Then you can split on the comma to get the separate values: var str = "(10.207150961819892, 123.7393569946289)"; var parts = str.substr(1, str.length - 2).split(', '); var lat = parts[0]; var lng = parts[1]; // output values in Stackoverflow snippet document.write(lat + '&lt;br&gt;'); document.write(lng + '&lt;br&gt;');
score: 0
type: Answer

http://stackoverflow.com/comment/44622920
type: QuestionComment
has text: @RomanC, is there any way of converting blob to file in javascript?
score: 0
comment on: http://stackoverflow.com/q/28123421
type: Comment

http://stackoverflow.com/a/28203544
answers question: http://stackoverflow.com/q/28202265
accepted answer of: http://stackoverflow.com/q/28202265
score: 0
has body: You are calling a Google server side function instead of the function in the Script tag: &lt;input type="button" value="Add element" onclick="google.script.run.withSuccessHandler(addElement)" /&gt; Should be: &lt;input type="button" value="Add element" onclick="addElement()" /&gt; I see that you are using innerHTML, so you know about that. Mozilla Documentation It looks like you are trying to use a method (append) that isn't available to the Element Object. Maybe you are confusing the UI methods with DOM (Document Object Model). Document Object Model If you want to add an input tag, you could use something like this: function addElement(){ document.getElementById('myForm').innerHTML = "&lt;input type='text' id='inputTwo'&gt;"; } There is also an appendChild method: appendChild method - Microsoft Documentation There is also a createElement method: createElement Method - Mozilla Documentation So, you can use the Document object, or the Element object. Methods of the Document object are: document.createElement() document.removeChild() document.appendChild() document.replaceChild()
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28225782
has comment: http://stackoverflow.com/comment/44814851
has answer: http://stackoverflow.com/a/28225834
answer count: 1
tagged with: arrays
accepted answer: http://stackoverflow.com/a/28225834
tagged with: javascript
tagged with: jquery
has title: How to retrieve data from DOM element and push it into an array?
score: 0
has body: I would like to loop through and retrieve attribute data bound in my select menu options and push the data from each option into an array. My select menu has an id of "List" and the jquery code snippet below binds the value from the input field with id of ip4. $('#List :selected').data({"onHandInv":$("#ip4").val()}) For each option in the select menu, List, there is a value of onHandInv that I would like to retrieve and push into an array. I've tried the following for loop, but it isn't working. Help please? var Inv = []; for (j=0;j&lt;document.getElementById("List").options.length;j++){ Inv.push($("List option")[j]).valueof("onHandInv") }
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/44716027
has text: @Ruddy - Yes, I just noticed that. I'm adding a resize handler.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28173417
score: 0

http://stackoverflow.com/comment/44905861
has text: @DavidFaux: If so, the edit to the answer seems to solve the problem.
type: AnswerComment
comment on: http://stackoverflow.com/a/28273246
score: 0
type: Comment

http://stackoverflow.com/q/28159865
tagged with: javascript
has comment: http://stackoverflow.com/comment/44759427
has body: I am developing a flot chart to include in an existing web site. When I create the chart in an otherwise empty web page, for development purposes, everything renders correctly. But when I add it to the web site, parts of the chart to not display (this applies regardless of the chart type: line, bar or stacked). Here's what does not show: (1) The chart title, which I have done as a top xaxis (2) The xaxis ticks (except for part of the first one) (3) The xaxis (bottom) label (4) The yaxis label, although the yaxis ticks DO appear Also, the yaxis ticks, while they appear, they are off by a half. So instead of 0 being at the lower corner, it is below the x axis, and the next y tick is positioned between 0 and its grid line, etc. So when a bar chart is rendered that has a value of 500, it shows at the 600 level. Also, the the very top of the first xaxis tick also renders. Sometimes I can get an inner vertical scroll to appear and scroll down to see the xaxis ticks, but the first one is higher vertically than the others. I can't see any of the rest of the missing features. I have tried everything that I can think of: (1) Adding padding around the container div (2) setting overflow:auto on that div (3) removing rendering the labels as canvas (4) removing autorotate ticks (which appear only on the x axis) Any help would be appreciated.
tagged with: flot
has comment: http://stackoverflow.com/comment/44763918
has title: Parts of Flot Chart Not Displayed
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44872445
has comment: http://stackoverflow.com/comment/44931120
has comment: http://stackoverflow.com/comment/44736442
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/44696594
has comment: http://stackoverflow.com/comment/44713172
type: Question
has comment: http://stackoverflow.com/comment/44696273

http://stackoverflow.com/comment/44709796
score: 0
type: QuestionComment
has text: The code is working fine for me. Have you checked that the variable you use in your request actually contain data and are not empty?
comment on: http://stackoverflow.com/q/28162866
type: Comment

http://stackoverflow.com/comment/44860736
type: AnswerComment
score: 0
has text: Ok, I tried only replacing `openProject()` to `openProject.call(this)` (and leaving everything else the same as above) and I can see that it's working, but it looks like jQuery is still being called. Is this normal?
type: Comment
comment on: http://stackoverflow.com/a/28249954

http://stackoverflow.com/comment/44650143
type: QuestionComment
type: Comment
score: 1
has text: be careful with uppercase in attributes. angular will read `some-attribute="foo"` as `attrs.someAttribute` in directive code. try simplifying your attribute to lowercase or `template-url`
comment on: http://stackoverflow.com/q/28139250

http://stackoverflow.com/comment/44776014
comment on: http://stackoverflow.com/a/28204858
has text: @zerkms: The `this` binding is only coerced to an object (or even: the global object) in sloppy mode; as per [the spec](http://es5.github.io/#x10.4.3) :-)
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28149186
has title: HTML5 checkValidity says an empty input is valid
downvote count: 1
type: Question
score: 5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/44633902
has answer: http://stackoverflow.com/a/44633902
answer count: 2
has answer: http://stackoverflow.com/a/28149198
tagged with: checkvalidity
has body: Given the following document: &lt;input pattern="[a-z]"/&gt; Without filling in the input, running: document.querySelector('input').checkValidity() Returns true. Since an empty input would not match [a-z], why is HTML5 checkValidity() returning true?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28149198

http://stackoverflow.com/a/28212298
score: 1
has comment: http://stackoverflow.com/comment/44850701
has comment: http://stackoverflow.com/comment/44843184
has comment: http://stackoverflow.com/comment/44825860
answers question: http://stackoverflow.com/q/28211710
has comment: http://stackoverflow.com/comment/44830007
has comment: http://stackoverflow.com/comment/44883765
has comment: http://stackoverflow.com/comment/44828003
has comment: http://stackoverflow.com/comment/44883642
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44806386
type: Answer
has comment: http://stackoverflow.com/comment/44829966
has comment: http://stackoverflow.com/comment/44830907
upvote count: 1
has body: Updated, I tried to apply Stacking elements with Z-index to get the desired effect. I also created a kind of "stack" of images where z-index is changed for the image that was hidden; the most recently hidden element is changed for a smaller z-index value in comparison to other images in the "stack". The code supports multiple images in the photos array, because it creates an individual div for each image. var photos = [{ url: 'https://drscdn.500px.org/photo/97037403/m=900/d924fc03d69a82a604129011300916be' }, { url: 'https://drscdn.500px.org/photo/97037259/m=900/030e1598b7822cd6c41beb4c7a4e466d' }, { url: 'https://drscdn.500px.org/photo/97158643/m=900/4ae40d67ef546341111a32f5176694c8' }]; //z-index, start value -1 //z-index can be either positive or negative value //based on this answer http://stackoverflow.com/a/491105/2048391 var zIndex = -1; //first foto in the array shown/hidden first var visibleIndex = 0; //initialize //by creating div for each image/url for (i = 0; i &lt; photos.length; i++) { var div = document.createElement("div"); div.id = "page-background" + (i + 1); div.setAttribute("class", "page-bg"); div.style.zIndex = zIndex; var url = "url('" + photos[i].url + "')"; div.style.background = "#505D6E " + url + " no-repeat center center fixed"; document.body.appendChild(div); zIndex = zIndex - 1; //and add div id to the photos array photos[i].id = "page-background" + (i + 1); } function changeBackground() { var hideItemIndex = visibleIndex % photos.length; var showItemIndex = (visibleIndex + 1) % photos.length; var hideItemId = "#" + photos[hideItemIndex].id; var showItemId = "#" + photos[showItemIndex].id; //hide current image with animation //after which show the next image with animation $(hideItemId).animate({ opacity: 0 }, "slow", function() { $(showItemId) .animate({ opacity: 1 }, "slow"); //change z-index for the item that was hidden //by moving it to the bottom of the stack $(hideItemId).css("z-index", zIndex); $(hideItemId).css("opacity", 1); });…
has comment: http://stackoverflow.com/comment/44883929
accepted answer of: http://stackoverflow.com/q/28211710

jsp
tags question: http://stackoverflow.com/q/28191457
tags question: http://stackoverflow.com/q/28208853
tags question: http://stackoverflow.com/q/28238672
tags question: http://stackoverflow.com/q/28159243
tags question: http://stackoverflow.com/q/28219711
tags question: http://stackoverflow.com/q/28214193
tags question: http://stackoverflow.com/q/28272637
tags question: http://stackoverflow.com/q/28212504
tags question: http://stackoverflow.com/q/28277443
tags question: http://stackoverflow.com/q/28239181
tags question: http://stackoverflow.com/q/28197846
tags question: http://stackoverflow.com/q/28123393
type: Tag
tags question: http://stackoverflow.com/q/28261863
tags question: http://stackoverflow.com/q/28235059
tags question: http://stackoverflow.com/q/28276313
tags question: http://stackoverflow.com/q/28231655
tags question: http://stackoverflow.com/q/28124028
tag name: jsp
tags question: http://stackoverflow.com/q/28188817
tags question: http://stackoverflow.com/q/28277928
tags question: http://stackoverflow.com/q/28222480
tags question: http://stackoverflow.com/q/28227623
tags question: http://stackoverflow.com/q/28173169
tags question: http://stackoverflow.com/q/28150354
tags question: http://stackoverflow.com/q/28210162

http://stackoverflow.com/a/28249731
has body: In the second function you are ignoring the return value from the reduce method. It will correctly calculate the sum, but you don't use it. Assign the result to the variable as in the first function: array = arrays.reduce(function (total, num) { return total + num; }); However, having the result in the same variable as where the array was makes the code somewhat confusing. You should avoid having a variable change meaning in the middle of the code, so you can use a different variable for the result: function sum(){ var arrays = [1,2,3,4]; var result = arrays.reduce(function (total, num) { return total + num; }); console.log(result); } Side note: The term functional programming is used for languages that are based on functional expressions instead of variable state. Just using a function doesn't mean that you are using functional programming.
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28249698
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28249698

http://stackoverflow.com/a/28181121
type: Answer
answers question: http://stackoverflow.com/q/28180861
score: 0
has body: According to the JQuery api doc this should work: $("#display_post").click(function(){ $("#post_new_table").toggle(); });

http://stackoverflow.com/comment/44938033
has text: Thanks for that. Yes, I had seen this before too. But because I am offering the download in CSV and XLS format too (via the external script [here](http://highslide-software.github.io/export-csv/export-csv.js)), hardcoding the above options hampers the display of CSV/XLS. Ok, I succeeded in manually adding the CSV export ([here the updated fiddle](http://jsfiddle.net/luftikus143/gs7h843n/2/)), but not the XLS export. Any idea how this could be done?
comment on: http://stackoverflow.com/a/28278278
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28240305
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44842792
has body: ar.join() doesn't change ar. This should accomplish what you're looking for, as long as you don't have pipes (|) in your data: console.clear(); var ar = ['one','two','three']; ar[5] = 'five'; console.log(ar); //["one", "two", "three", 5: "five"] ar= ar.join('|').split('|'); console.log(ar); //["one", "two", "three", "", "", "five"]
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44844837
answers question: http://stackoverflow.com/q/28240111
accepted answer of: http://stackoverflow.com/q/28240111
type: Answer

http://stackoverflow.com/a/28178478
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28178434
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28178434
has body: Well, Firefox is correct, there is no element with such an ID. From the MSDN documentation: In IE7 Standards mode and previous modes, this method performs a case-insensitive match on both the ID and NAME attributes, which might produce unexpected results. For more information, see Defining Document Compatibility. And look at your HTML, that seems what is happening: &lt;input type="checkbox" name="skill8" ... /&gt; Possible solutions: Add an id attribute to all the elements you wish to refer to via getElementById. Use getElementsByName instead.
has comment: http://stackoverflow.com/comment/44726211

http://stackoverflow.com/q/28215147
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28215319
type: AnsweredQuestion
has body: Take the following cut down JS Object (JS Fiddle: http://jsfiddle.net/52a4wq0x/1/) - emulating a multidimensional associative array I suppose. var ControlMap = { tb_RosMon: { row: 1, col: 1 }, tb_RosTue: { row: 1, col: 2 }, tb_RosWed: { row: 1, col: 3 }, tb_RosThu: { row: 1, col: 4 }, tb_RosFri: { row: 1, col: 5 }, tb_RosSat: { row: 1, col: 6 }, tb_RosSun: { row: 1, col: 7 }, tb_AbsMon: { row: 2, col: 1 }, tb_AbsTue: { row: 2, col: 2 }, tb_AbsWed: { row: 2, col: 3 }, tb_AbsThu: { row: 2, col: 4 }, tb_AbsFri: { row: 2, col: 5 }, tb_AbsSat: { row: 2, col: 6 }, tb_AbsSun: { row: 2, col: 7 }, ddl_ReasonMon: { row: 3, col: 1 }, ddl_ReasonTue: { row: 3, col: 2 }, ddl_ReasonWed: { row: 3, col: 3 }, ddl_ReasonThu: { row: 3, col: 4 }, ddl_ReasonFri: { row: 3, col: 5 }, ddl_ReasonSat: { row: 3, col: 6 }, ddl_ReasonSun: { row: 3, col: 7 }, tb_AddMon: { row: 4, col: 1 }, tb_AddTue: { row: 4, col: 2 }, tb_AddWed: { row: 4, col: 3 }, tb_AddThu: { row: 4, col: 4 }, tb_AddFri: { row: 4, col: 5 }, tb_AddSat: { row: 4, col: 6 }, tb_AddSun: { row: 4, col: 7 }, Mon_AddReason: { row: 5, col: 1 }, Tue_AddReason: { row: 5, col: 2 }, Wed_AddReason: { row: 5, col: 3 }, Thu_AddReason: { row: 5, col: 4 }, Fri_AddReason: { row: 5, col: 5 }, Sat_AddReason: { row: 5, col: 6 }, Sun_AddReason: { row: 5, col: 7 } } This is basically a map of input id's (tb_RosMon, tb_AbsMon etc) and their row &amp; column within an HTML &lt;table&gt;. I'm trying to add key navigation to the inputs in question (up, down, left &amp; right). i.e. if a user presses the down arrow whilst on tb_AbsTue, I fetch tb_AbsTue's position as follows: var row = ControlMap[SourceID]["row"]; //Returns 2 var col = ControlMap[SourceID]["col"]; //Returns 2 I'll then increment row by 1 (as they pressed down) to give me a destination of row 3 col 2. I then need to search the above object to see if an input (tb_###) exists at row 3 col 2 &amp; return its ID. How could one do that? Plain JS or JQuery would be fine.
linked to: http://stackoverflow.com/q/9907419
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44793932
tagged with: javascript
score: -1
has title: Finding 'Key' in a JS Object based on 'Multiple Values'
has answer: http://stackoverflow.com/a/28215319
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/44658145
has text: WOW, that works great! Thank you! One last question, How can I return an array that every cell is a group from the regex?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28143224
type: AnswerComment

http://stackoverflow.com/comment/44897362
has text: [This](http://stackoverflow.com/a/3076648/2518525) might be of interest
comment on: http://stackoverflow.com/q/28270886
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44766297
comment on: http://stackoverflow.com/a/28198939
has text: No errors are found by firebug or Chrome but now it doesn't validate at all. Now I'm even more confused. I updated the code above to reflect the changes I have made.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28247186
has body: You might want to rethink your link hierarchy/architecture and restructure your links with folders: Tools and have your pages be "index.html" files in those folders, (I am assuming a dynamic page is outside your limitations for now) and for the home page: simply call the index.html there (or what ever it is called) in the link
answers question: http://stackoverflow.com/q/28247130
score: 0
has comment: http://stackoverflow.com/comment/44855098
type: Answer

http://stackoverflow.com/comment/44634315
has text: I added the layout to the OP, you can download and take a look. I'm almost about giving up because it doesn't make sense.
type: Comment
comment on: http://stackoverflow.com/q/28130266
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44884083
comment on: http://stackoverflow.com/q/28263560
has text: guess you do not need (and not want) to run the validation on submit, but before. And IMHO date.addEventListener('input',noWeekends); cannot work, what about date.addEventListener('keyup',noWeekends); ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44724211
type: Comment
has text: Thank you so much once again Everton, that looks like it did the trick.
comment on: http://stackoverflow.com/a/28158232
score: 0
type: AnswerComment

http://stackoverflow.com/a/28182578
has body: A possible solution in ECMA5. var records = [{ "field1": "dogs", "field2": "poodle" }, { "field1": "dogs", "field2": "alsatian" }, { "field1": "dogs", "field2": "chowchow" }, { "field1": "dogs", "field2": "schnauzer" }, { "field1": "cats", "field2": "siamese" }, { "field1": "cats", "field2": "persian" }, { "field1": "fish", "field2": "guppy" }, { "field1": "fish", "field2": "tiger barb" }], x = records.reduce(function (acc, record) { if (!acc[record.field1]) { acc[record.field1] = []; } if (acc[record.field1].indexOf(record.field2) === -1) { acc[record.field1].push(record.field2); } return acc; }, {}), y = Object.keys(x).map(function (key) { return { type: key, breeds: this[key] }; }, x); document.getElementById('out').textContent = JSON.stringify(y, null, 2); &lt;pre id="out"&gt;&lt;/pre&gt;
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28182367

android
tags question: http://stackoverflow.com/q/28131515
tags question: http://stackoverflow.com/q/28220118
tags question: http://stackoverflow.com/q/28222945
tags question: http://stackoverflow.com/q/28141893
tags question: http://stackoverflow.com/q/28181509
tags question: http://stackoverflow.com/q/28140265
tags question: http://stackoverflow.com/q/28205461
tags question: http://stackoverflow.com/q/28253273
tags question: http://stackoverflow.com/q/28139388
tags question: http://stackoverflow.com/q/28222963
tags question: http://stackoverflow.com/q/28278240
tags question: http://stackoverflow.com/q/28203659
tags question: http://stackoverflow.com/q/28123766
tags question: http://stackoverflow.com/q/28232634
tags question: http://stackoverflow.com/q/28205734
tags question: http://stackoverflow.com/q/28226178
tags question: http://stackoverflow.com/q/28227501
tags question: http://stackoverflow.com/q/28231431
tags question: http://stackoverflow.com/q/28188703
tags question: http://stackoverflow.com/q/28165975
tags question: http://stackoverflow.com/q/28168951
tags question: http://stackoverflow.com/q/28207115
tags question: http://stackoverflow.com/q/28230878
tags question: http://stackoverflow.com/q/28273587
tags question: http://stackoverflow.com/q/28146173
tags question: http://stackoverflow.com/q/28211361
tags question: http://stackoverflow.com/q/28197338
tags question: http://stackoverflow.com/q/28138510
tags question: http://stackoverflow.com/q/28148502
tags question: http://stackoverflow.com/q/28249257
tags question: http://stackoverflow.com/q/28184653
tags question: http://stackoverflow.com/q/28243067
tags question: http://stackoverflow.com/q/28125971
tags question: http://stackoverflow.com/q/28252401
tags question: http://stackoverflow.com/q/28167342
tags question: http://stackoverflow.com/q/28267138
tags question: http://stackoverflow.com/q/28204004
tags question: http://stackoverflow.com/q/28171521
tags question: http://stackoverflow.com/q/28138358
tags question: http://stackoverflow.com/q/28253227
tags question: http://stackoverflow.com/q/28181723
tags question: http://stackoverflow.com/q/28241516
tags question: http://stackoverflow.com/q/28180467
tags question: http://stackoverflow.com/q/28232924
tags question: http://stackoverflow.com/q/28243119
tags question: http://stackoverflow.com/q/28225851
tags question: http://stackoverflow.com/q/28235851
tags question: http://stackoverflow.com/q/28259010
tags question: http://stackoverflow.com/q/28156103
tags question: http://stackoverflow.com/q/28125080
tags question: http://stackoverflow.com/q/28145813
tags question: http://stackoverflow.com/q/28129044
tag name: android
tags question: http://stackoverflow.com/q/28197752
type: Tag
tags question: http://stackoverflow.com/q/28209552
tags question: http://stackoverflow.com/q/28275411

http://stackoverflow.com/comment/44638029
score: 0
type: AnswerComment
has text: @JoshCrozier Thank you, the example was very helpful!
comment on: http://stackoverflow.com/a/28132741
type: Comment

http://stackoverflow.com/a/32033065
upvote count: 2
has body: That means webserver is not running. Try running webdriver-manager start --standalone in a new command line window or tab From: https://stackoverflow.com/a/21124867/577977
answers question: http://stackoverflow.com/q/28141168
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28141168
type: Answer
score: 2

http://stackoverflow.com/comment/45088692
comment on: http://stackoverflow.com/q/28209320
type: Comment
type: QuestionComment
has text: The best I can figure is that it is a repaint issue. When you change the text of the option is causes the select to repaint. In the repaint there is an issue where the prop gets reset to the default value.
score: 1

http://stackoverflow.com/q/28210347
accepted answer: http://stackoverflow.com/a/28256233
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
has title: kendo date dialog on click of input box
tagged with: telerik
tagged with: kendo-datepicker
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28256233
type: Question
has body: I have a kendo Date picker it is functioning well. On click of icon in input box I am able to open date dialog and it is working. But I want this dialog should also open in click of input box as well.. Select date: Demo : http://dojo.telerik.com/ Can anyone guide me ?
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui

http://stackoverflow.com/a/28198733
type: Answer
has body: As per my comment above, you need to use a function. var bodyPart = ["face", "foot", "nose", "hand", "head"]; var adjective = ["hairy and", "extremely", "insultingly", "astonishingly"]; var adjectiveTwo = ["stupid", "gigantic", "fat", "horrid", "scary"]; var animal = ["baboon", "sasquatch", "sloth", "naked cat", "warthog"]; var randomInsult = (function() { var bp, a, a2, an; var bp = bodyPart[Math.floor(Math.random() * 5)]; var a = adjective[Math.floor(Math.random() * 4)]; var a2 = adjectiveTwo[Math.floor(Math.random() * 5)]; var an = animal[Math.floor(Math.random() * 5)]; var insult = "Your" + " " + bp + " " + "is more" + " " + a + " " + a2 + " " + "than a" + " " + an + "'s" + " " + bp + "."; alert(insult); }); document.getElementById('test').addEventListener('click', randomInsult, false); Click me
score: 0
answers question: http://stackoverflow.com/q/28198582

http://stackoverflow.com/q/28171521
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28171762
has answer: http://stackoverflow.com/a/28171762
has body: I am trying to create an app using Android Studio which will turn on the bluetooth when there's an incoming call and connect to the given device's name and eventually turn off the bluetooth after the call ends. But I have less ideas about javascripts.
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28171809
tagged with: javascript
tagged with: bluetooth
score: 0
tagged with: android
has title: Is it possible to turn on the bluetooth of an android device programmatically and connect with other
accepted answer: http://stackoverflow.com/a/28171809
tagged with: apk

http://stackoverflow.com/comment/44693304
type: QuestionComment
score: 0
has text: @MikeC I added the require to my grunt.js file, however I am still unclear on how to interact with the module from the client side. I need to submit email address data to the api.
comment on: http://stackoverflow.com/q/28160361
type: Comment

http://stackoverflow.com/comment/44767737
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28200429
has text: This seems to do the trick: https://gist.github.com/typeoneerror/ea854cfa9341f1388c37.
type: AnswerComment

http://stackoverflow.com/comment/44746121
has text: It is simpe. I give you all the code that I use. The above code produces just a table. I want this table sortable if the user clicks the header of the table. It is so simple. It does not get any simpler. It also is an XSLT problem because the Javascript libraries do not work with it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28182477

http://stackoverflow.com/comment/85143003
type: Comment
score: 3
comment on: http://stackoverflow.com/a/46409174
type: AnswerComment
has text: Doesn't work if the function is defined with a method shorthand. `var g = { f() { return 'x'; } }` `g.f.toString() /* "f() { return 'x'; }" */`

global-variables
tags question: http://stackoverflow.com/q/28230240
tags question: http://stackoverflow.com/q/28212067
tags question: http://stackoverflow.com/q/28194172
tag name: global-variables
tags question: http://stackoverflow.com/q/28270971
tags question: http://stackoverflow.com/q/28253164
type: Tag
tags question: http://stackoverflow.com/q/28143697

http://stackoverflow.com/a/28417421
downvote count: 0
answers question: http://stackoverflow.com/q/28122964
type: Answer
score: 1
upvote count: 1
has body: My issue was that I was overwriting my production phone nuber numberSID variable with my test phone number. So the user.numberSID; that I was assigning to a variable was for the Twilio test phone numbers. So, when it was searching for that numberSID, it returned a 404.

http://stackoverflow.com/q/28167265
has comment: http://stackoverflow.com/comment/44704939
has comment: http://stackoverflow.com/comment/44704678
has comment: http://stackoverflow.com/comment/44704784
has answer: http://stackoverflow.com/a/28167570
accepted answer: http://stackoverflow.com/a/28167570
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44704717
has comment: http://stackoverflow.com/comment/44704626
has comment: http://stackoverflow.com/comment/44704818
type: Question
has comment: http://stackoverflow.com/comment/44704656
has comment: http://stackoverflow.com/comment/44705017
tagged with: c#
has comment: http://stackoverflow.com/comment/44704677
has title: JavaScript code behind in c#
tagged with: javascript
has comment: http://stackoverflow.com/comment/44704734
has comment: http://stackoverflow.com/comment/44704676
score: 0
has body: I have the following code in my cs file. private bool ValidateFirst() { StringBuilder sb2 = new StringBuilder(); sb2.Append(@"&lt;script language='javascript'&gt; var bContinue = true;"); sb2.Append(@"bContinue = confirm("); sb2.Append("'some text here'"); sb2.Append(@");"); sb2.Append("if (bContinue) {"); sb2.Append(this.Page.ClientScript.GetPostBackEventReference(this, "OKFinal")); sb2.Append("}&lt;/script&gt;"); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "ConfirmDialog", sb2.ToString()); return false; } So what I wanted here is to display a confirm pop up on the page. The sb2.ToString() is working when I tested it on JSFiddle http://jsfiddle.net/2rbcsvh6/ (_doPostBack event will not work) but on my application, it won't display. The code is inside the screen controller action command. protected void screenController_ActionCommand(object sender, Web.Controls.CancelCommandEventArgs e) { if (e.CommandName == ScreenController.OkCommand) { // this is the method that contains the script if (ValidateFirst) { this.Save(); } } }
has comment: http://stackoverflow.com/comment/44704759
has comment: http://stackoverflow.com/comment/44704648
answer count: 1

http://stackoverflow.com/comment/44898328
has text: You can't with this html. You first need to create Html form and then you don't have to do anything you can just serialise form data and send it to server. The server will receive these selected options in $_GET or $_POST depending upon your method (POST or GET). Better look first on how to create html forms and then how to submit html form through ajax.
comment on: http://stackoverflow.com/q/28271387
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28199688
possible better answer: http://stackoverflow.com/a/28199739
has comment: http://stackoverflow.com/comment/44965844
favorite count: 0
has answer: http://stackoverflow.com/a/28199739
tagged with: html5-canvas
has body: An image is loaded to the fabric canvas using file input and FileReader. We use scaleToWidth and scaleToHeight to have large photos fit to the canvas. When I use choose a large 3.2MB jpeg the image is nicely resized to 1MB which is what we want. We then prepare the data for storage on local indexed db; canvas.toJSON(); // 4.2MB canvas.toDataURL(); // 1MB It seems that the toJSON method stores the original jpeg. Can we reduce the jpeg prior to serialization ? I'd prefer to serialize to JSON so we can use other excellent Fabric features in the future.
upvote count: 2
has title: Reduce size of JSON serialized by fabric.js after image resize
has answer: http://stackoverflow.com/a/28307319
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28307319
tagged with: fabricjs
type: Question
has comment: http://stackoverflow.com/comment/44955721
has comment: http://stackoverflow.com/comment/44954166
answer count: 2
has comment: http://stackoverflow.com/comment/44889058
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44876915

http://stackoverflow.com/comment/44729607
comment on: http://stackoverflow.com/q/28180113
score: 0
has text: http://blog.niftysnippets.org/2010/03/anonymouses-anonymous.html
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28150275
has comment: http://stackoverflow.com/comment/44671763
tagged with: javascript
has comment: http://stackoverflow.com/comment/44674624
has comment: http://stackoverflow.com/comment/44674253
score: 0
has title: Form fields have null values after Edit except the ID
has comment: http://stackoverflow.com/comment/44673699
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap-3
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44674501
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44671898
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/44673800
has body: So,I have a table with an edit button in each row.When edit is clicked,the user is redirected to another page with the fields autopopulated.To achieve this,I am using Knockout binding.But when I Update the properties have only Null values in them,even though the fields are filled.I am using two way buinding,I dont understand what I am doing wrong.Any help would be appreciated folks. HTML Edit Provider Details: FIRST NAME: Enter the first name LAST NAME: Enter the last name CONTACT NUMBER: Enter the Contact Number EMAIL ADDRESS: Enter the Email Address Update Reset JS is as shown var ProviderEdit = function () { var self = this; self.ProviderID = ko.observable(providerData.ProviderID); self.FirstName = ko.observable(providerData.FirstName); self.LastName = ko.observable(providerData.LastName); self.ContactNumber = ko.observable(providerData.ContactNumber); self.ContactEmail = ko.observable(providerData.ContactEmail); var Provider = { ProviderID: self.ProviderID, FirstName: self.FirstName, LastName: self.LastName, ContactNumber: self.ContactNumber, ContactEmail: self.ContactEmail, }; self.Provider = ko.observable(); } $(document).ready(function () { ko.applyBindings(new ProviderEdit()); $("#EditProviderDetailsForm").validate({ onfocusout: function (element, event) { this.element(element); }, onkeyup: function (element, event) { if (event.which === 9 && this.elementValue(element) === '') { return; } else if (element.name in this.submitted) { this.element(element); } }, rules: { FirstName: { required: true, minlength: 2, maxlength: 20 }, LastName: { required: true, minlength: 2, maxlength: 20 }, ContactNumber: { required: true, minlength: 10, maxlength: 10 }, ContactEmail: { required: true, AcceptEmail: true } }, messages: { FirstName: { required: "Please enter your first name",minlength: "Minimum 2 characters required",maxlength: "Maximum 20 characters allowed" }, LastName: { required: "Please enter your last name",minlength: "Minimum 2 characters required",maxlength: …

touch
tags question: http://stackoverflow.com/q/28155500
tags question: http://stackoverflow.com/q/28157474
tags question: http://stackoverflow.com/q/28233175
tags question: http://stackoverflow.com/q/28217554
type: Tag
tags question: http://stackoverflow.com/q/28225452
tags question: http://stackoverflow.com/q/28218888
tags question: http://stackoverflow.com/q/28225932
tag name: touch
tags question: http://stackoverflow.com/q/28237730
tags question: http://stackoverflow.com/q/28269972

scope
tags question: http://stackoverflow.com/q/28188301
tags question: http://stackoverflow.com/q/28255957
tags question: http://stackoverflow.com/q/28134390
tags question: http://stackoverflow.com/q/28149720
tags question: http://stackoverflow.com/q/28240429
tag name: scope
tags question: http://stackoverflow.com/q/28242257
tags question: http://stackoverflow.com/q/28176048
tags question: http://stackoverflow.com/q/28181199
tags question: http://stackoverflow.com/q/28199235
tags question: http://stackoverflow.com/q/28213200
tags question: http://stackoverflow.com/q/28261000
tags question: http://stackoverflow.com/q/28250680
type: Tag
tags question: http://stackoverflow.com/q/28224177
tags question: http://stackoverflow.com/q/28220020
tags question: http://stackoverflow.com/q/28220219
tags question: http://stackoverflow.com/q/28271616
tags question: http://stackoverflow.com/q/28212067
tags question: http://stackoverflow.com/q/28187924

date
tags question: http://stackoverflow.com/q/28240231
tag name: date
tags question: http://stackoverflow.com/q/28149330
tags question: http://stackoverflow.com/q/28227862
tags question: http://stackoverflow.com/q/28167957
tags question: http://stackoverflow.com/q/28176225
tags question: http://stackoverflow.com/q/28176290
tags question: http://stackoverflow.com/q/28162140
tags question: http://stackoverflow.com/q/28154554
type: Tag
tags question: http://stackoverflow.com/q/28193048
tags question: http://stackoverflow.com/q/28231051
tags question: http://stackoverflow.com/q/28206382
tags question: http://stackoverflow.com/q/28177540
tags question: http://stackoverflow.com/q/28233532
tags question: http://stackoverflow.com/q/28247428
tags question: http://stackoverflow.com/q/28237031
tags question: http://stackoverflow.com/q/28171986
tags question: http://stackoverflow.com/q/28211406
tags question: http://stackoverflow.com/q/28242701
tags question: http://stackoverflow.com/q/28210299
tags question: http://stackoverflow.com/q/28265145
tags question: http://stackoverflow.com/q/28172171

http://stackoverflow.com/comment/44859400
type: Comment
score: 0
has text: I don't have access to json file. That way i'm unable to just change everything to look good.
type: AnswerComment
comment on: http://stackoverflow.com/a/28249796

http://stackoverflow.com/comment/44729774
has text: I'm open to other solutions
comment on: http://stackoverflow.com/q/28133952
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44853174
type: QuestionComment
score: 0
has text: Heading home for the weekend. I'll check back on this on Monday.
comment on: http://stackoverflow.com/q/28246202
type: Comment

http://stackoverflow.com/comment/44829583
comment on: http://stackoverflow.com/q/28233018
score: 0
type: Comment
type: QuestionComment
has text: Yes, I want to remove this part with the shape of the polygon to get the first rectangle without the polygon.

http://stackoverflow.com/q/28253120
accepted answer: http://stackoverflow.com/a/28253157
score: 2
type: AnsweredQuestion
has body: I try to send list of object like [{"name":"Vasya"},{"name":"Lila"}] It's my code: $.ajax({ url: url , type: 'POST' , contentType: 'application/json' , data: data , success: function(response) { showPopup(response.successMessage); } }); Where alert(JSON.stringify(data)); shows: [{"name":"Vasya"},{"name":"Lila"}] But when I am checking my request in chrome debug mode the request contains undefined= instead correct data. What I do wrong? Is this syntax incorrect according to JSON?
upvote count: 2
has comment: http://stackoverflow.com/comment/44865080
type: Question
has comment: http://stackoverflow.com/comment/44865022
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has title: How to send json list of objects using jquery?
has answer: http://stackoverflow.com/a/28253157
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44864995
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44865027

http://stackoverflow.com/a/28188238
type: Answer
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/28188209
accepted answer of: http://stackoverflow.com/q/28188209
has body: have no angular expirience but simple string concatination should do the trick : $(cell).append( ' ' + ' {{grid}} ' );

http://stackoverflow.com/a/28190742
score: 1
has body: As simple as that: CKEDITOR.replace( 'textarea', { removePlugins: 'contextmenu,tabletools' } ); If it does not help you, you must include a valid sample to reproduce the issue because something exotic is going on in your setup.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28183505
has comment: http://stackoverflow.com/comment/44770684
downvote count: 0

http://stackoverflow.com/comment/44764903
type: AnswerComment
type: Comment
has text: I'm interested in the jQuery method, could you explain a little bit more please?
comment on: http://stackoverflow.com/a/28192806
score: 0

http://stackoverflow.com/q/28245586
has answer: http://stackoverflow.com/a/28246485
has comment: http://stackoverflow.com/comment/44852422
has comment: http://stackoverflow.com/comment/44852272
has comment: http://stackoverflow.com/comment/44852322
has comment: http://stackoverflow.com/comment/44852627
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have a problem with my site on which I am trying to clone a div to add it to every nth article. (http://trollfutbol.tumblr.com/) I have added a script that adds adWrap div to every 7th article. $('article:nth-child(7n)').replaceWith('.adWrap').clone(); And it does clone it and it adds the ad to the 7th but then the ad won't re-add itself to the 14th article etc. It only adds the wrapping. Any ideas? the html is basically regenerating infinite times (as many posts I will have) ad iframe
has answer: http://stackoverflow.com/a/28246295
has comment: http://stackoverflow.com/comment/44852287
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44852178
has comment: http://stackoverflow.com/comment/44851943
has comment: http://stackoverflow.com/comment/44852390
has comment: http://stackoverflow.com/comment/44851989
has title: Why doesn't the .clone copy my div?
type: UnansweredQuestion

http://stackoverflow.com/q/28236608
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44834469
has answer: http://stackoverflow.com/a/28236739
has answer: http://stackoverflow.com/a/28236844
downvote count: 0
score: 1
has body: Pls help me how to open div smoothly.I have add script and html code, its working perfectly but div open suddenly with jerk. I want to open my div "#mapsec" smoothly. function showhide() { var div = document.getElementById("mapsec"); if (div.style.display !== "none") { div.style.display = "none"; } else { div.style.display = "block"; } } HTML CODE Visit us (Map)
type: Question
has answer: http://stackoverflow.com/a/28236899
tagged with: javascript
tagged with: jquery
has title: How to open div smoothly
has answer: http://stackoverflow.com/a/28236691
upvote count: 1
has answer: http://stackoverflow.com/a/28236701
favorite count: 0

http://stackoverflow.com/a/28172025
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44714603
downvote count: 0
has comment: http://stackoverflow.com/comment/44714004
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28171973
has body: Add e.preventDefault(); $('.checkbox-select').click(function (e) { var checked_length = $(this).has(".checked").length; if( checked_length == 0 ) { $(this).find('[type=checkbox]').addClass('checked'); $(this).find('[type=checkbox]').prop('checked', true); $(this).find('label').css({"font-style": "italic"}); $(this).css("background-color", "#6CCACD"); } else { $(this).find('[type=checkbox]').removeClass('checked'); $(this).find('[type=checkbox]').prop('checked', false); $(this).css("background-color", "#67517A"); $(this).find('label').css({"font-style": ""}); } e.preventDefault(); }); Also make your label non-seletable: label { -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -khtml-user-select: none; /* webkit (konqueror) browsers */ -ms-user-select: none; /* IE10+ */ } Link to jsfiddle Your click is happening twice due to a mechanism called Event Bubbling and Capturing. It means that if you fire an event of a parent it's children will also fire that even if they have that handler attached to them. Read more about here if you like
accepted answer of: http://stackoverflow.com/q/28171973
has comment: http://stackoverflow.com/comment/44713455
upvote count: 2

http://stackoverflow.com/comment/44717700
has text: `$(this).attr('id') === this.id`
comment on: http://stackoverflow.com/a/28174289
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/44747283
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28188888
type: Comment
has text: Yes, i used alert to display the saved sessionID. It displays 2002,2003 or 2004 depening on which of the persons I use to log in.

http://stackoverflow.com/comment/44787834
comment on: http://stackoverflow.com/q/28204806
type: QuestionComment
type: Comment
has text: @MrZalib: well, I think a better mental picture is that those "classical" languages are the exceptions. in most languages, == does what you expect it to do: string comparison.
score: 0

http://stackoverflow.com/a/28262682
has comment: http://stackoverflow.com/comment/44882740
answers question: http://stackoverflow.com/q/28262477
has comment: http://stackoverflow.com/comment/44882380
has body: You can calculate total height of children elements if you clone parent container and set the height to auto: var accupiedHeight = $('.blue').clone().css('height', 'auto').appendTo('body').height(); Demo: http://jsfiddle.net/gf1Ljh8u/3/ This way it will look pretty concise. However I would still prefer looping version as it's more comprehensive. var accupiedHeight = 0; $('.blue').children().each(function() { accupiedHeight += this.scrollHeight; }); Demo: http://jsfiddle.net/gf1Ljh8u/4/
has comment: http://stackoverflow.com/comment/44882473
has comment: http://stackoverflow.com/comment/44882327
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44882552
score: 2
accepted answer of: http://stackoverflow.com/q/28262477

http://stackoverflow.com/comment/44618392
has text: Thank you! And is it true that the single command in your answer is faster than the dual commands in my question?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28122163
type: Comment

http://stackoverflow.com/comment/44786548
comment on: http://stackoverflow.com/q/28210730
has text: @rohinichaudhary please add the new code to your question (without removing the old code) so that we can see what you have now.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28233532
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28235765
has comment: http://stackoverflow.com/comment/44829224
has comment: http://stackoverflow.com/comment/44829687
tagged with: date
has answer: http://stackoverflow.com/a/28233990
type: Question
tagged with: function
has title: Add a variable number to a date in Java script
tagged with: javascript
has answer: http://stackoverflow.com/a/28234663
has body: I have read a few articles but nothing seems to the point. I have created a form that records a reservation date (when a user wants to reserve a game) and the number of days they hope to borrow it for. I want to add this to the reservation date to get the date the game must be returned by. I have wrapped up my code so far into a function so that I can call it using an onclick method. What should this code look like to work properly? Almost forgot - to make life hard my date is written like this YYYY-MM-DD function ReturnDate(){ var reservation_begin = document.getElementById('reservation_start').value; var loan_period = document.getElementById('requested_days').value; var reservation_end = document.getElementById('return_date'); var dateResult = reservation_begin + loan_period; return_date.value = dateResult; } USING the Suggestions made by Linus I made the following alterations but had trouble with the formatting of the return date. e.g Setting the reservation date to 2015-01-03 gave me the result of 2015-0-32 for the return date function ReturnDate(){ var reservation_begin = document.getElementById('reservation_start').value; var loan_period = document.getElementById('requested_days').value; var resDate = new Date(reservation_begin); alert(resDate) var period = loan_period; var output = document.getElementById('return_date'); resDate.setDate(resDate.getDate() + period); alert(period) //return_date.value = resDate.getFullYear() + "-" + (resDate.getMonth() + 1) + "-" + resDate.getDate(); return_date.value = resDate.getFullYear() + "-" + resDate.getMonth() + "-" + (resDate.getDate() +1); }
has comment: http://stackoverflow.com/comment/44829680
score: 0
has comment: http://stackoverflow.com/comment/44836119
has answer: http://stackoverflow.com/a/28234145
accepted answer: http://stackoverflow.com/a/28233990
has comment: http://stackoverflow.com/comment/44829896
answer count: 4
possible better answer: http://stackoverflow.com/a/28234145
has comment: http://stackoverflow.com/comment/44829349
has comment: http://stackoverflow.com/comment/44829207

http://stackoverflow.com/comment/44714935
type: AnswerComment
score: 0
type: Comment
has text: To clarify, I could programatically alter the the pages if that is possible, but I can't go in and add script tags or make other changes by hand. The pages I am loading are not mine, there are potentially tens of thousands of them and millions of resource load attempts.
comment on: http://stackoverflow.com/a/28165888

http://stackoverflow.com/comment/44642708
has text: A plain JS array of objects will give you pretty much the same functionality as a Java ArrayList.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28135244
score: 1

http://stackoverflow.com/comment/73540861
type: Comment
has text: SSL/TLS can be used in that case, to ensure that token is safe and secure. Otherwise IMO this idea is most practical.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30307732

http://stackoverflow.com/a/28187048
score: 0
type: Answer
has body: you should update value in element each time it changes: (function count(){ var counter=0, $container = $('#counter'); $(".next-button").click(function() { $container.text(++counter); }); $(".previous").click(function() { $container.text(--counter); }); })();
answers question: http://stackoverflow.com/q/28187010

http://stackoverflow.com/comment/74559965
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29788621
has text: yeah...gamil & analytics and webmasters in trouble mode.. not loading because of same issue.... well thanks it solved my issue

http://stackoverflow.com/comment/100185762
has text: @phillyslick Yes it does. The given answer throws an error when written in Typescript. I provided a solution to that error.
type: AnswerComment
comment on: http://stackoverflow.com/a/54955392
type: Comment
score: 2

http://stackoverflow.com/q/28189045
possible better answer: http://stackoverflow.com/a/28189592
has body: I am using jquery datatables to make my table searchable. I have a dropdown that filters a gender column: $("#genderDrop").on("change", function(e) { var gender = $(this).val(); formTable.column(2).search(gender).draw(); }); this works fine, but now I want to be able to remove the filter when the user selects "all" from the dropdown. Here is my attempt: $("#genderDrop").on("change", function(e) { var gender = $(this).val(); if (gender != "all") { formTable.column(2).search(gender).draw(); } else { formTable.column(2).search("").draw(); } }); Instead of removing the filter this just searches for an empty string, but I can't work out how to change this so it removes the filter. I also tried: formTable.column(2).search("*").draw(); and &nbsp; formTable.column(2).search().draw(); but without any success.
answer count: 3
tagged with: datatables
downvote count: 0
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/28191474
type: AnsweredQuestion
score: 2
has title: jquery datatables: how to clear column search filter
has answer: http://stackoverflow.com/a/28189592
has answer: http://stackoverflow.com/a/28191474
has answer: http://stackoverflow.com/a/47898580
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28172377
type: AcceptedAnswer
type: Answer
has body: The reason it isn't working is because you are checking the values before you have set them. There's a couple of other problems too, but if you take the call off your body tag: &lt;body onload="javascript:ringerTime()"&gt; to &lt;body&gt; Then correct the function call in your script at the bottom and move the ringer call to the end: window.onload = function() { clock(); document.getElementById("p1").checked = true; document.getElementById("nday").checked = true; ringerTime(); }; That should fix it. Here's a working fiddle.
accepted answer of: http://stackoverflow.com/q/28172104
answers question: http://stackoverflow.com/q/28172104
score: 0

templates
tags question: http://stackoverflow.com/q/28180166
tags question: http://stackoverflow.com/q/28203065
tag name: templates
tags question: http://stackoverflow.com/q/28279005
type: Tag
tags question: http://stackoverflow.com/q/28260839
tags question: http://stackoverflow.com/q/28195801
tags question: http://stackoverflow.com/q/28278953
tags question: http://stackoverflow.com/q/28151121
tags question: http://stackoverflow.com/q/28157923
tags question: http://stackoverflow.com/q/28149573

dojox.charting
tags question: http://stackoverflow.com/q/28183817
tag name: dojox.charting
type: Tag

http://stackoverflow.com/q/28154796
has comment: http://stackoverflow.com/comment/44681442
has comment: http://stackoverflow.com/comment/44681314
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28154871
accepted answer: http://stackoverflow.com/a/28154871
tagged with: caching
type: Question
possible better answer: http://stackoverflow.com/a/44234008
has title: XMLHttpRequest: How to force caching?
has comment: http://stackoverflow.com/comment/44681059
has comment: http://stackoverflow.com/comment/44681063
has answer: http://stackoverflow.com/a/44234008
tagged with: javascript
upvote count: 11
tagged with: ajax
has comment: http://stackoverflow.com/comment/44681027
answer count: 3
has answer: http://stackoverflow.com/a/68061957
has comment: http://stackoverflow.com/comment/44681112
favorite count: 0
has comment: http://stackoverflow.com/comment/44681128
score: 11
tagged with: xmlhttprequest
has body: I'm newer to XMLHttpRequests since I've previously used jQuery's AjAX method. However I need to work in a web worker and now I have to use the classic XMLHttpRequest for performance issues. I'm trying to rebuild the cache-property from jquery. If cache should be disabled I add this: xhr.setRequestHeader("Cache-Control", "no-cache"); But what header should I set if I want to force caching (not prevent)?

http://stackoverflow.com/comment/44913777
score: 1
has text: Where is that applied? Currently using apache?
type: QuestionComment
comment on: http://stackoverflow.com/q/28277443
type: Comment

http://stackoverflow.com/comment/44693177
comment on: http://stackoverflow.com/a/28160965
type: AnswerComment
score: 0
has text: @JuanMendes No, it only requires a reference to the function.
type: Comment

http://stackoverflow.com/a/44929439
type: Answer
has body: ActiveXObject is available only on IE browser. So every other useragent will throw an error On modern browser you could use instead File API or File writer API (currently implemented only on Chrome)
answers question: http://stackoverflow.com/q/28242741
score: 0

http://stackoverflow.com/q/28157554
tagged with: jquery-mobile
has body: I make a website in php at backend and HTML,CSS at frontend.Now the requirement is to make it compatible for also mobile.I am thinking to use JqueryMobile but I am confuse that same layout work for both or make different for both. Is layout make by JqueryMobile cover both ends?Is I make separately JqueryMobile layout?
tagged with: javascript
tagged with: jquery
has title: Is JqueryMobile layout run on both web and mobile
tagged with: jquery-plugins
score: 0
accepted answer: http://stackoverflow.com/a/28157720
has answer: http://stackoverflow.com/a/28157731
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5048695
has answer: http://stackoverflow.com/a/28157720
possible better answer: http://stackoverflow.com/a/28157731
type: Question
answer count: 2
tagged with: jquery-ui

http://stackoverflow.com/q/28224122
score: 0
has title: Hide with css vs JS create element vs ajax
has body: I want to hide some divs that display photo title and other details about a photo if a photo doesn't exists (404) and then show again these divs when a user click on another photo in page ex. in related photos section. I have used css to hide this divs and then js to show them again. I have considered hiding with css, creating elements with JavaScript and displaying html using ajax. Is there a better way to do this without using non semantic HTML? <?php if(PHOTO::exists($_GET["photo"])) { ?> <?php echo $photo->get_title(); ?> <?php echo $photo->get_time();?> <?php echo $photo->get_views(); ?> <?php } ?> so if photo doesn't exists these divs (#title_wrap, #time_views) will not be shown but when the user clicks a photo in the related section these divs need to be shown and updated with the new info loaded via AJAX. So whats the best way to show and hide these divs?
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28224305
tagged with: ajax
has comment: http://stackoverflow.com/comment/44813097
has comment: http://stackoverflow.com/comment/44813864
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44814048
has comment: http://stackoverflow.com/comment/44813903
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44814260
has comment: http://stackoverflow.com/comment/44814499
has comment: http://stackoverflow.com/comment/44814153
has comment: http://stackoverflow.com/comment/44816912
type: Question
has answer: http://stackoverflow.com/a/28224305
has comment: http://stackoverflow.com/comment/44812736
has comment: http://stackoverflow.com/comment/44813213
tagged with: javascript
has comment: http://stackoverflow.com/comment/44813028
has comment: http://stackoverflow.com/comment/44813677

http://stackoverflow.com/comment/44946523
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28242783
has text: @jonmrich , make jsfiddle. I can't reproduce your issue - http://jsfiddle.net/philip100/5sf4ejzk/ - seems to work fine for me... Are you sure your `all_data ` is set before you call `element.DataTable()` ?

http://stackoverflow.com/comment/44676971
type: QuestionComment
has text: Hi Mark I have tried this on Chrome 40, FF32 and IE11 it does not work in any, could the fact that we are testing in JSFIDDLE affect it.
comment on: http://stackoverflow.com/q/28152401
type: Comment
score: 0

http://stackoverflow.com/a/28132207
downvote count: 0
score: 1
upvote count: 1
has body: You have class="hidden" on the &lt;td&gt; instead of on the &lt;input&gt;, but you are hiding and showing the &lt;input&gt;. You want to hide/show the &lt;input&gt;, not the &lt;td&gt;, so move class="hidden" to the &lt;input&gt;. This still does not completely fix the "jumpy" behavior. Instead of hiding and showing the &lt;input&gt;, you could change its visibility style. That way you can hide it, but it will still occupy the same amount of space. HTML: &lt;td&gt; &lt;input type="text" name="Other" value="" style="visibility: hidden;" /&gt; &lt;/td&gt; JavaScript: if (selectedValue == 'Other') { $(this).closest('td').next('td').find('input').css({ visibility: 'visible' }); } else { $(this).closest('td').next('td').find('input').css({ visibility: 'hidden' }); } Of course, you could also set a minimum width on the &lt;td&gt; so it would occupy the same space even when the &lt;input&gt; is hidden. Here is a jsfiddle that does that with the &lt;input&gt; in the same &lt;td&gt; as the drop-down. Disabling/enabling, instead of hiding/showing, would be another alternative. One more thing, if you have multiple rows with the &lt;select&gt; element, you should not give it an id value because then multiple elements will have the same id. Use class instead of id.
answers question: http://stackoverflow.com/q/28132064
type: Answer

http://stackoverflow.com/comment/44895003
score: 1
comment on: http://stackoverflow.com/q/28269445
has text: It is fortunate because it encourages weird techniques (which makes already bad code even worse). In the given example your `display()` function should just accept a `person` argument then you run it as `display(person1);` Perfectly clear and readable.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28147197
type: Question
has title: Insert HTML at specific position JQuery
score: 3
has body: My HTMl is like this my html-1 my html-2 my html-3 my html-4 And I want to insert a new HTML in between my html-4 and my html-3. means the second last position. How can I make this using JQuery? I have done something like this $('#addmore').click(function () { var newData = My new HTML, I will get here $('.col-lg-6').append(newData); }); But this insert the new HTML to the last position. I want it to be inserted at the second last position always. Expected output my html-1 my html-2 my html-3 my html-new one my html-4
has answer: http://stackoverflow.com/a/28147238
upvote count: 3
has answer: http://stackoverflow.com/a/28147532
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28148407
tagged with: http://stackoverflow.com/tag/html
answer count: 4
possible better answer: http://stackoverflow.com/a/28147238
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28147262
accepted answer: http://stackoverflow.com/a/28147262

http://stackoverflow.com/q/28243106
answer count: 3
downvote count: 0
tagged with: meteor
has answer: http://stackoverflow.com/a/29078113
favorite count: 0
tagged with: velocity
linked to: http://stackoverflow.com/q/27952903
possible better answer: http://stackoverflow.com/a/29078113
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/27952903
has body: I'm using the mike:mocha package and I'm trying to figure out how to disable testing. There are times when I have to demo the app I'm working on in my local machine. For those situations, I would like to run the application without the green dot on the top right.
has answer: http://stackoverflow.com/a/28243574
tagged with: unit-testing
type: Question
has title: How to turn off Velocity unit testing in Meteor?
accepted answer: http://stackoverflow.com/a/28243574
tagged with: javascript
tagged with: mocha.js
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/31600704

http://stackoverflow.com/q/28152476
favorite count: 0
has title: Google Maps Add Multiple Circles
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28153296
downvote count: 1
type: Question
answer count: 2
tagged with: google-maps
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28228956
has body: I want to know what its the best way to add differents option that shows ranges of distances .I made this Range of distance (Circle) I generate the range using circle var circle = new google.maps.Circle({ map: this.map, radius: 16093, // 10 miles in metres 16093 fillColor: '#E6E6E6', fillOpacity: 0.0 , strokeOpacity : 0.1, strokeWeight: 1, strokeWidth:1 }); circle.bindTo('center', marker_cat, 'position'); That js show how to add a circle range of 10 miles , and now i want to add other circles showing others types of range like 20 miles. Could someone tell me where i can found a tutorial to add differents circles showed or hidden depending his properties?

http://stackoverflow.com/a/28153439
has comment: http://stackoverflow.com/comment/44678310
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28153289
type: Answer
answers question: http://stackoverflow.com/q/28153289
has comment: http://stackoverflow.com/comment/44679852
downvote count: 0
has comment: http://stackoverflow.com/comment/44678256
score: 1
has comment: http://stackoverflow.com/comment/44678654
has body: You could use Date#toUTCString(). This will return a string with the date in UTC timezone, which naturally will ignore daylight savings time.
has comment: http://stackoverflow.com/comment/44679330

http://stackoverflow.com/a/28222290
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28212069
type: Answer
has body: LLVM itself has been compiled, but a while ago. It would take some effort to port it now. It's also fairly large, which can be a problem in browsers. You would also need to port parts of emscripten, which are written in python. Overall this is all possible, but would take nontrivial effort.
accepted answer of: http://stackoverflow.com/q/28212069
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44828478

http://stackoverflow.com/comment/44717234
comment on: http://stackoverflow.com/q/28173949
score: 0
type: QuestionComment
type: Comment
has text: You need to write your index view that takes the response from that private service. What template rendering engine are you using?

http://stackoverflow.com/comment/44795741
score: 0
type: AnswerComment
has text: for debugging there is an annoying little bug (that was fixed in VS 2013 update 2 I have update 1) that prevents breakpoints from being hit if the JS is in a .cshtml file instead of a .js file.
comment on: http://stackoverflow.com/a/28209192
type: Comment

http://stackoverflow.com/a/28145739
has body: You must have some sort of a database. A popular one is MySQL. Remember, javascript is browser-side (client-side) language, and so it is not capable of saving data. (without using HTML5 storage or cookie). If you want to save it using cookie or html5 storage, look: http://www.w3schools.com/html/html5_webstorage.asp http://www.w3schools.com/js/js_cookies.asp
score: 0
answers question: http://stackoverflow.com/q/28145699
type: Answer

http://stackoverflow.com/q/28219724
has title: How to set Text font in RaphaelJS
type: AnsweredQuestion
has body: I have a small RaphaelJS script which makes use of Text to display text on the screen. This text is dynamic - it is updated frequently. I want to set the font of the text. I have downloaded a Cufon .js font file to my liking, and used the code below to set the font. except, it doesn't work! ...The font is unchanged throughout. The colour is set, along with font-size, position etc. But not the actual font itself. If I Print the text instead of using Text the font works fine. But I don't want to do that - it needs to be dynamic. var text = paper.text(200,245,"--:--"); var paper = new Raphael( 0, 0, 600, 400) ; var font = paper.getFont("FontName"); text.attr({ "font-size": 25, font: "FontName", "font-weight": 400, fill: lcdDisplayColour }); function updateText() { /** . . . **/ var newText = "some new text"; text.attr({text: ""+dClockText}); } In the HTML file I have: &lt;script src="raphael-min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="nameOfCufonFile.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="myScript.js" type="text/javascript"&gt;&lt;/script&gt; I have also tried: text.attr({ "font-size": 25, font: font, ... text.attr({ "font-size": 25, "font-family": "FontName", ... text.attr({ "font-size": 25, "font-family": font, ...
tagged with: fonts
score: 1
tagged with: raphael
type: Question
has answer: http://stackoverflow.com/a/28220977
tagged with: javascript
tagged with: printing
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28220977
favorite count: 0
upvote count: 1

http://stackoverflow.com/q/28199215
has comment: http://stackoverflow.com/comment/44765100
type: Question
has comment: http://stackoverflow.com/comment/44765486
has title: How can I use callback to make JavaScript wait to run a part of a code?
tagged with: javascript
tagged with: callback
tagged with: ajax
score: 0
has body: I have a series of 3 functions that all have AJAX calls that are dependent on each other. The first one is the JSP load and the AJAX chain call: function loadJSP(yearmonth){ $(".container_12").empty(); $(".container_12").load("jsp/demotable.jsp", function(){ loadPage(yearmonth).done(function(){ $('table').dataTable({ "ordering": false, "initComplete": function () { $(".ui-toolbar").hide(); $( "p" ).removeClass( "myClass yourClass" ) } }); $(".loading").hide(); $("#tabs-1").show(); }) }); } Now the actual ajax call is a callback chain: function loadPage(yearmonth){ return (loadMeses(yearmonth).done(loadDados)); } Since the first call gives the months available in a selecet box, the second part needs to know what is the most recent month before loading the data. This chain works fine. The load data part only runs after the available months ajax call is completed. The problem is that the lines $(".loading").hide(); $("#tabs-1").show(); runs BEFORE the table is completed. Meaning that it shows an empty table before adding the data. This is the load data function: function loadDadoss (){ setAJAXcharConn (); var source = "/intl/servlet/apps.test.HTMLtest?param=&amp;p1=test2&amp;p2=201412"; return ($.getJSON(source,function(result){ $.each(result, function(i, field){ for(foo = 3;foo &lt; 8;foo++){ var preparedField = accounting.formatMoney(field[foo] , "", 2, ".", ","); $('#'+i).append('&lt;td&gt;'+preparedField); } }); }) )} Am I missing something about callbacks here?
duplicate of: http://stackoverflow.com/q/5436327
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5436327
answer count: 0

http://stackoverflow.com/a/28221266
has comment: http://stackoverflow.com/comment/44830611
answers question: http://stackoverflow.com/q/28213465
downvote count: 0
has body: In order to achieve what you are asking about, you need to understand what is going on under-the hood and how the browser actions you need to log are sent and executed. Here is a very brief high-level overview. Interactions between a webdriver, selenium server and a browser are happening through the JSON Wire Protocol - JSON over HTTP: See also: Protractor: How It Works. In other words, finding an element, sending keys to an element, click etc are, basically, sent as HTTP requests that could be monitored and logged, see Monitoring JSON wire protocol logs. For instance, here are the Chrome service logs: [2.389][INFO]: COMMAND FindElement { "sessionId": "b6707ee92a3261e1dc33a53514490663", "using": "css selector", "value": "input" } [2.389][INFO]: Waiting for pending navigations... [2.389][INFO]: Done waiting for pending navigations [2.398][INFO]: Waiting for pending navigations... [2.398][INFO]: Done waiting for pending navigations [2.398][INFO]: RESPONSE FindElement { "ELEMENT": "0.3367185448296368-1" } This is exactly what, for example, BrowserStack is doing. They are parsing the raw logs and producing a user-friendly report of all actions performed: In protractor, the closest functionality to what you are asking about, is being currently developed under a timeline plugin: configure plugins section in your protractor config: plugins: [{ path: 'node_modules/protractor/plugins/timeline/index.js', outdir: 'timelines' }], run tests open timelines/index.html report and see: Basically, it parses the webdriver's "client" logs and builds a time frame highlighting the commands that were sent during a test session. This is something you can use as a starting point, explore the source code of the plugin.
has comment: http://stackoverflow.com/comment/44828119
has comment: http://stackoverflow.com/comment/44821335
upvote count: 3
has comment: http://stackoverflow.com/comment/44827831
has comment: http://stackoverflow.com/comment/44829999
type: Answer
score: 3

http://stackoverflow.com/a/28145583
type: Answer
has body: You need to select the element by id using getElementById: function removing(id){ alert(id); document.getElementById(id).remove(); } But, though I would suggest you to use like @AmitJoki answered for you.
answers question: http://stackoverflow.com/q/28145543
score: 0

http://stackoverflow.com/a/28203156
has body: Once I gave the checkbox elements unique ID's, it worked.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28202489
downvote count: 0
score: 1

http://stackoverflow.com/a/28238547
has body: When you declare a variable without the keyword var, it becomes global. Add var before you declare the variables in for...in loop. for (var propOne in namingScheme) { DivNamingPushArray.push(propOne); for (var propTwo in namingScheme[propOne]) { DivNamingPushArray.push(namingScheme[propOne][propTwo]) } } When a variable becomes global, or part of window, it can be accessed anywhere. So, always use var to keep the variables in scope and thereby avoiding the pollution of global scope. After you've called init, propOne and propTwo have become global variables and therefore can be accessed anywhere. As to DivNamingPushArray, declare it one-level higher, so it will be visible to other functions or try to use module pattern.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28238472
has comment: http://stackoverflow.com/comment/44838348

http://stackoverflow.com/comment/44728027
type: QuestionComment
comment on: http://stackoverflow.com/q/28179311
type: Comment
has text: @user2524908 I would like to select those last two classes `c-unknown` is unknown because it's dynamically created. I need to be able to select those two classes no matter what `c-unknown` ends up becoming. @rafaeldefazio `c-unknown` is an unknown class. It will be dynamically created so I won't have the class name. This is not a duplicate to the question you posted.
score: 0

http://stackoverflow.com/q/28153954
has title: Angularjs app not bootstrapping without module
has comment: http://stackoverflow.com/comment/44679449
tagged with: angularjs-scope
type: Question
has answer: http://stackoverflow.com/a/28153969
tagged with: javascript
score: 0
answer count: 1
has body: I am new to angularjs and this might sound very silly but I want to know why my angularjs app won't bootstrap without making a module even though egghead.io and several tutorials showing otherwise. Here is my HTML template {{greeting.text}}, World And the controller.js file which DOESN'T WORKS function HelloController($scope) { $scope.greeting = { text: 'Hello' }; } When i register the module [and naming the ng-app as 'hello' ofcourse] and write a controller it works angular.module('hello', []).controller('HelloController', function($scope) { $scope.greeting = { text: 'Hello' }; }); I just want to know the reason for this behavior. Thanks in anticipation.
tagged with: angularjs
type: UnansweredQuestion
tagged with: model-view-controller
has comment: http://stackoverflow.com/comment/44679421
linked to: http://stackoverflow.com/q/28152801

http://stackoverflow.com/q/28123925
tagged with: jquery-scrollify
has answer: http://stackoverflow.com/a/31765054
has comment: http://stackoverflow.com/comment/92429445
upvote count: 5
has title: Scrollify section scroll with overflow
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/59265329
tagged with: javascript
tagged with: jquery
score: 4
has body: I am trying to use the script Scrollify (https://github.com/lukehaas/Scrollify) but I have sections that are longer than the user's screen, which means you first have to scroll down to see that contents' content. Scrollify, however, doesn't let this happen and will just immediately scroll to the new section. Is there a way to modify Scrollify and/or use another script that will accomplice what I would like it to do?
has answer: http://stackoverflow.com/a/28153758
has comment: http://stackoverflow.com/comment/106483661
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: scroll
downvote count: 1
has comment: http://stackoverflow.com/comment/44621449
has comment: http://stackoverflow.com/comment/44621426

http://stackoverflow.com/a/28266981
type: AcceptedAnswer
score: 0
has body: Solved this by initialising my visitor object by setting the content-type. Something Safari doesn't seem to do on its own: var ua = require('universal-analytics'); var accountId = 'UA-XXXXX-XX'; var visitor = ua(accountId, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, });
type: Answer
answers question: http://stackoverflow.com/q/28217900
accepted answer of: http://stackoverflow.com/q/28217900

http://stackoverflow.com/q/28127535
has comment: http://stackoverflow.com/comment/44628426
has comment: http://stackoverflow.com/comment/44628280
favorite count: 0
has comment: http://stackoverflow.com/comment/44628148
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44628390
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44628112
has answer: http://stackoverflow.com/a/28127819
has body: I have searched for an answer to my problem and not sure why my ng-click is not firing the ng-show message for me. I have my controller function: $scope.showLogoutMessage = function() { $scope.logoutmsg = true; }; My Login page html: You have been logged out. Then I fire this ng-show from a different jsp page: Log Out I have logged out messages in my controller and the value 'logoutmsg' is being set fine but just won't display my message for some reason. Anyone have any ideas?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44628261
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44628190
has title: AngularJS ng-click not displaying ng-show message
score: 1

http://stackoverflow.com/q/28219769
favorite count: 0
tagged with: twitter-bootstrap
has body: I would like to know how to load the Google Drive Picker window after a user clicks on a button. I easily implemented Dropbox's Chooser API with the code provided on their website. Now, the following "Hello World" application code, provided by Google at https://developers.google.com/picker/docs/index, did not work. I added my API key and Client ID, and then, instead of at the bottom, I tried to apply the code on a Bootstrap button, with and it didn't work. My question is: Is there a better example of Google Picker's API working on a button click?
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/34681920
score: 1
has comment: http://stackoverflow.com/comment/44815811
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/7094430
has title: Google Picker API -- Button click event
tagged with: google-picker

http://stackoverflow.com/comment/44658796
comment on: http://stackoverflow.com/q/28143353
score: 0
type: Comment
type: QuestionComment
has text: one issue is that by then clicking back from page A, it would take you to page C which is weird...

http://stackoverflow.com/comment/44791597
score: 0
type: QuestionComment
has text: if( $(this).find("input").is(":focus") ) ... this if-condition inside #geomodal on.function will return true if any of its input has focus
type: Comment
comment on: http://stackoverflow.com/q/28213683

http://stackoverflow.com/comment/44781115
has text: Just to add to that, I guess there may not be a way to include the font within the html such that chrome (or other browsers) will grab the file explicitly when using File>Save?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28185514

http://stackoverflow.com/comment/44906168
comment on: http://stackoverflow.com/a/28275757
has text: Cool! But why is that? What's the difference between the two?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28165728
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28165846
type: Question
has body: I'm using PJAX, so my html content is from AJAX, which means my elements are dymanic, I couldn't use $('input').on('change') (unless I use it every time I got the new content from AJAX ) My idea is using $(document).on() so I can keep tracking the events, but how do I detect something is on change when I using $(document).on()?
answer count: 1
tagged with: javascript
tagged with: event-handling
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28165846
tagged with: onchange
has title: Detect all the change events based on document

http://stackoverflow.com/q/28126298
accepted answer: http://stackoverflow.com/a/28126435
has comment: http://stackoverflow.com/comment/44625655
has comment: http://stackoverflow.com/comment/44625656
has comment: http://stackoverflow.com/comment/44625664
has title: Are the following JavaScript syntactical elements operators?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28126355
has body: Are the following JavaScript syntactical elements operators? . // e.g. myObject.foo; return // e.g. return 'foo'; [] // e.g. myObject['foo]; Definition of operator found on the interweb: ...an operator is a program element that is applied to one or more operands in an expression or statement. This might imply that return in: return 'foo'; ...is an operator with 'foo' being the operand. Clearly this is a statement (fitting with the definition).
has comment: http://stackoverflow.com/comment/44625748
has answer: http://stackoverflow.com/a/28126435
type: Question
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28126355
tagged with: javascript
has comment: http://stackoverflow.com/comment/44625657

http://stackoverflow.com/comment/44831591
type: Comment
type: QuestionComment
has text: How can you benefit from the laziness of lodash chaining when using the modules?
comment on: http://stackoverflow.com/q/28221165
score: 0

http://stackoverflow.com/comment/44700410
type: QuestionComment
type: Comment
has text: Although either side of `NaN==NaN` contains the same value and their type is `Number` but they are not same. According to ECMA-262, either side of `==` or `===` contains `NaN` then it will result false value. you may find a details rules in here- http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
score: 0
comment on: http://stackoverflow.com/q/28164872

http://stackoverflow.com/a/28253314
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28253283
has comment: http://stackoverflow.com/comment/44865371
answers question: http://stackoverflow.com/q/28253283
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44865455
has body: Your button is a div styled as a bootstrap button, but it do not retains HTML anchors (links) functionality. What you need to do is defining an anchor and style it as a button : inspect There is also a {{#linkTo}} block helper in iron:router that you can use like this : {{#linkTo class="btn btn-sm" route="speaker"}}inspect{{/linkTo}}

http://stackoverflow.com/a/38559152
answers question: http://stackoverflow.com/q/28238628
downvote count: 0
has comment: http://stackoverflow.com/comment/70115263
type: Answer
has body: I'm posting that answer because the accepted answer is not correct - it confuses the Socket.IO upgrade from long-polling AJAX to WebSocket with the WSS protocol "Connection: Upgrade" request. The issue is not that the WebSocket connection starts as HTTP and gets upgraded to WebSocket - how could it not? - but that Socket.IO starts with a long-polling AJAX connection even on browsers supporting WebSocket, and only upgrades it later after exchanging some traffic. It's very easy to see in the developer tools of Firefox or Chrome. The author of the question is correct in his observations. The "upgrade" in Socket.IO doesn't refer to the HTTP to WSS protocol upgrade as is often misunderstood but to the upgrade of Socket.IO connection from long-polling AJAX connection to WebSocket. If you start with WebSocket already (which is not the default) then upgrade false has no effect because you don't need to upgrade. If you start with polling and disable upgrade then it stays that way and doesn't upgrade to WebSocket. See answers by arnold and Nick Steele if you want to avoid starting with long-polling. I will explain what is going on in more detail. This is what I observed in my experiments with simple WebSocket and Socket.IO apps: WebSocket 2 requests, 1.50 KB, 0.05 s From those 2 requests: HTML page itself connection upgrade to WebSocket (The connection upgrade request is visible on the developer tools with a 101 Switching Protocols response.) Socket.IO 6 requests, 181.56 KB, 0.25 s From those 6 requests: the HTML page itself Socket.IO's JavaScript (180 kilobytes) first long polling AJAX request second long polling AJAX request third long polling AJAX request connection upgrade to WebSocket Details WebSocket results that I got on localhost: Socket.IO results that I got on localhost: Test yourself I published the code on npm and on GitHub, you can run it yourself: # Install: npm i -g websocket-vs-socket.io # Run the server: websocket-vs-socket.io and follow instrictions. To uni…
upvote count: 29
score: 29

http://stackoverflow.com/q/28232190
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28232375
tagged with: class
has title: replace onclick action to display inline output
score: 0
type: UnansweredQuestion
has body: i want to change the behavior of the button in this function $STRING .= 'user_login. '" class="btn btn-info btn-lg">'.$CORE->_e(array('auction','41')).''; to when clicked to display the output of this function $data = get_user_meta( $authorID, 'cellno', true); if(strlen($data) > 0){ echo " <a href='phone:".$data."' rel='nofollow' target='_blank' "; so that when " class="btn btn-info btn-lg" is clicked it will display the phone number inside it, for now it shows contact author, and opens a new page to the author page. thanks everybody
tagged with: php
type: Question
tagged with: if-statement

http://stackoverflow.com/q/28152198
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44675988
has comment: http://stackoverflow.com/comment/44675646
has answer: http://stackoverflow.com/a/28152449
type: Question
has title: Get id of Table row with specific class Javascript
has comment: http://stackoverflow.com/comment/44675750
score: -1
has comment: http://stackoverflow.com/comment/44675994
has comment: http://stackoverflow.com/comment/44675931
has answer: http://stackoverflow.com/a/28152352
has comment: http://stackoverflow.com/comment/44675833
upvote count: 2
has comment: http://stackoverflow.com/comment/44675812
downvote count: 3
has comment: http://stackoverflow.com/comment/44675730
tagged with: javascript
has answer: http://stackoverflow.com/a/28152374
favorite count: 0
has answer: http://stackoverflow.com/a/28152347
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44676029
has comment: http://stackoverflow.com/comment/44675873
answer count: 4
has comment: http://stackoverflow.com/comment/44675925
has body: I need to get the id value of each row in my table that has the class selected. I need to be able to do this in javascript; not jquery. This should return an array: [1,3] Any help is appreciated. Thanks.

http://stackoverflow.com/a/28197020
has comment: http://stackoverflow.com/comment/85879750
has comment: http://stackoverflow.com/comment/85837994
has comment: http://stackoverflow.com/comment/85840345
upvote count: 2
has comment: http://stackoverflow.com/comment/85794464
type: Answer
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28196901
has body: For immutability you need Object.freeze, not Object.seal Freezing a prototype only prevents the prototype instance itself from being mutated. It does not affect ancestors, which may have internal state that change the frozen object's behavior. Similarly descendants are not frozen, they merely face restrictions on defining properties that exist on the frozen prototype (similar to non-configurable properties). And even that restriction can be hacked around (don't do that). And its ancestors might also be stateful For such simple things I would recommend simply trying them out on the console and/or reading the docs

http://stackoverflow.com/q/28265253
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44887915
has comment: http://stackoverflow.com/comment/44892881
type: Question
has title: The shortest way of using the same event on different Objects
has comment: http://stackoverflow.com/comment/44887089
has comment: http://stackoverflow.com/comment/44904964
score: 0
upvote count: 1
downvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28265285
tagged with: javascript
favorite count: 0
has body: I have several JavaScript Objects (explicit Raphael.js paths), on which I want to apply one event. (e.g.: ".mouseover()") example: var p = Raphael(1, 1, 600, 600); var x = p.path("M100 100 L 300 100") //first raphael.js path var y = p.path(("M100 200 L 300 200") //second raphael.js path var z = p.path(("M100 300 L 300 300") //third raphael.js path var doStuff = function () { //doStuff }; x.mouseover(doStuff); y.mouseover(doStuff); z.mouseover(doStuff); Question: Is there a way to shorten this, so that you need to write .click(doStuff) only once. JSFiddle example: http://jsfiddle.net/utg3k5mo/ Thank You
has comment: http://stackoverflow.com/comment/44887104
has answer: http://stackoverflow.com/a/28265285

http://stackoverflow.com/q/28251903
type: Question
linked to: http://stackoverflow.com/q/6125683
answer count: 1
tagged with: node.js
score: 4
has body: The situation is very simple: I have a node.js application and want it to be able to call functions from my networking library written in golang. As far as I understand there are numerous wrappers around c/c++ code in node, can I create a one around my golang library? There is a tool gopy http://gopy.qur.me/extensions/install.html which solves this problem for python, but I was unable to found something similar for node.js
upvote count: 4
tagged with: network-programming
tagged with: dll
has answer: http://stackoverflow.com/a/28279602
tagged with: javascript
tagged with: go
type: AnsweredQuestion
downvote count: 0
has title: Is there a way to create bindings for golang library for node.js?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28279602

http://stackoverflow.com/comment/44814629
comment on: http://stackoverflow.com/a/28225700
has text: What @alex said. But several things - first of all, a numeric id is not valid, and also more than one of the same id is not valid.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44837012
comment on: http://stackoverflow.com/q/28237813
has text: @pointy Okay, btw it was not what i asked. Thanks anyway.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44796377
has text: Not between them, try to put it after the playlist div
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28216187
type: Comment

http://stackoverflow.com/q/28126462
has answer: http://stackoverflow.com/a/28130374
accepted answer: http://stackoverflow.com/a/28130374
tagged with: javascript
has body: I'm trying to make a Google Map that only shows the Netherlands. But when I use zoom level 6 it shows Belgium and Germany as well and when I use zoom level 7 it zooms too far in that it doesn't show the complete country. How can I make The Netherlands show only, and not germany and belgium (or at least a very tiny part of them). Currently it looks something like this:
tagged with: google-maps-api-3
has title: Country specific zoom level in Google Maps API
downvote count: 2
tagged with: google-maps-api-2
answer count: 1
favorite count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/44627433
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44627411
type: Question
tagged with: google-maps

http://stackoverflow.com/q/28141777
accepted answer: http://stackoverflow.com/a/28160220
tagged with: firefox-addon-sdk
type: AnsweredQuestion
has title: firefox bootstrap addon: install event is not executed
score: 0
type: Question
possible better answer: http://stackoverflow.com/a/28149920
has answer: http://stackoverflow.com/a/28149920
tagged with: firefox
has answer: http://stackoverflow.com/a/28160220
tagged with: javascript
has comment: http://stackoverflow.com/comment/44685408
answer count: 2
tagged with: firefox-addon
has body: I'm trying to create a bootstrapped addon that just sets the new tab url at install to a new value and resets it to the old one when it gets uninstalled. Here is my bootstrap.js. I think the install function throws an exception because require is not defined, but I'm not sure if the debugger executes the code I write in Scratchpad in the right scope. I read somewhere that the api is the same for bootstrapped extensions as the with the add-on sdk, so the require should be fine. If this is not the case, could you please direct me to a page that describes the code I can use in the bootstrap.js, I didn't find anything :( function startup(data, reason){ } function shutdown(data, reason){ } function install(data, reason){ var prev_new_tab_url = require("sdk/preferences/service").get("browser.newtab.url"); var data = require("sdk/self").data; var url = data.url("startpage.html"); require("sdk/preferences/service").set("browser.newtab.url", url); var ss = require("sdk/simple-storage"); ss.storage.prev_new_tab_url = prev_new_tab_url; } function uninstall(data, reason){ var ss = require("sdk/simple-storage"); var prev_new_tab_url = ss.storage.prev_new_tab_url; require("sdk/preferences/service").set("browser.newtab.url", prev_new_tab_url); }
has comment: http://stackoverflow.com/comment/44691590
has comment: http://stackoverflow.com/comment/44691052

http://stackoverflow.com/q/28248981
has comment: http://stackoverflow.com/comment/44858103
has answer: http://stackoverflow.com/a/28249046
has body: I have a button that allows authentication from twitter, everything works properly, but the only issue is that i wish to open the login-twitter.php page on a different tab, i tried using window.open in place of header but it didn't work. can anyone tell how it can be done <?php ob_start(); session_start(); if (isset($_SESSION['id'])) { header("location: u_tasks.php"); } if (array_key_exists("login", $_GET)) { $oauth_provider = $_GET['oauth_provider']; if ($oauth_provider == 'twitter') { header("Location: login-twitter.php"); } } ?> <? echo " "; echo " Go To Twitter "; echo " "; ?>
tagged with: javascript
has answer: http://stackoverflow.com/a/28249085
has title: open a link in a different tab
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28249046
possible better answer: http://stackoverflow.com/a/28249085
type: Question
tagged with: php
score: 0
answer count: 2

http://stackoverflow.com/comment/44675934
has text: I asked some friends how I could do something like this post the answer to help other people when they search for something similar and they told me to do it like this, because when I was trying to do this there were no posts on stack about it that worked like I wanted it too so I just put this here to help other people I even say so in the question that I'm not asking just putting this here to help others... is this not the correct way to do it?
comment on: http://stackoverflow.com/a/28152264
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44814433
comment on: http://stackoverflow.com/a/28225386
has text: How will it execute in FIFO order?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28159418
has body: It'll be null because no parameter by that name is being sent with the Ajax request. Despite being started by an onsubmit event, $.get() doesn't have any automatic knowledge of the &lt;form&gt;. It's up to you to gather or specify any parameters to be included with the request using the data parameter. $.get('QueryHelper', { querytext: 'foo bar' }, function (res) { // ... }); Provided you have a reference to the &lt;form&gt; or its inputs, you can use .serialize() to prepare the fields' names and values as data. &lt;form onsubmit="query(this); return false;" method="get"&gt; &lt;!-- ^^^^ --&gt; function query(form) { // ^^^^ $.get('QueryHelper', $(form).serialize(), function (res) { // ^^^^^^^^^^^^^^^^^^^ // ... }); }
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28159243
type: Answer
has comment: http://stackoverflow.com/comment/44690398
has comment: http://stackoverflow.com/comment/44691296
has comment: http://stackoverflow.com/comment/44690967
score: 1
accepted answer of: http://stackoverflow.com/q/28159243
upvote count: 1
has comment: http://stackoverflow.com/comment/44691343

http://stackoverflow.com/comment/44695562
comment on: http://stackoverflow.com/a/28161853
score: 1
type: AnswerComment
type: Comment
has text: but suppose there were 10 of this class in a page. the inner selector may not even be the right one, whereas `this` will always be the element that event occured on and is more readable as well

http://stackoverflow.com/q/28180825
has comment: http://stackoverflow.com/comment/44730752
score: 1
has answer: http://stackoverflow.com/a/28180865
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/44730696
accepted answer: http://stackoverflow.com/a/28180865
favorite count: 0
has comment: http://stackoverflow.com/comment/44730708
has title: Can I assign an HTML string to the innerHTML property of a HTML DOM node?
has body: I want to populate html elements from a given string and this seems to not update the html inside the dynamic-content div: In index.html: In index.js: var dynamicContentNode = document.getElementById('dynamic-content'); dynamicContentNode.innerHTML = ' oh hai '; Did I just not test this well? Edit: I was assigning to innerHtml NOT innerHTML
upvote count: 1
has comment: http://stackoverflow.com/comment/44730753
has comment: http://stackoverflow.com/comment/44730718
has comment: http://stackoverflow.com/comment/44730931
type: AnsweredQuestion

http://stackoverflow.com/comment/44784292
type: Comment
comment on: http://stackoverflow.com/a/28209620
type: AnswerComment
score: 0
has text: let me change it if you need so.

http://stackoverflow.com/comment/44872860
type: AnswerComment
type: Comment
has text: Try to remove float: left on the red div ;) Its less logic maybe but its simplier. And you will save a bit of bits :D
comment on: http://stackoverflow.com/a/28257260
score: 0

http://stackoverflow.com/q/28233163
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28233266
has body: The question might not be clear but I can't figure out a better question to elaborate. I am trying to highlight a table row using ng-class and using conditions. Below is my code: &lt;tr ng-class="{selectSuccess: selectedRows.indexOf(rowData.entity_id) &gt; -1, danger: rowData.total_received &lt; rowData.total_sold, info: rowData.total_received &gt; rowData.total_sold}"&gt; In my code as you can see there are three conditions and three classes. danger and info classes are added on page load as they become true but selectSuccess which becomes true when I select a row so I need to know if there is any possibility to add important to this selectSuccess. I have tried adding important via css but that did not work. Or I need to know if I can make the other condition to false when I click on a row. Note: If you want I can add the whole code but only need to know if I can toggle the class and that is why provided only the main code.
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28233266
type: Question
tagged with: javascript
has title: Agularjs ng-class:remove class if other condition becomes true
score: 0

http://stackoverflow.com/comment/44910804
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28278291
has text: Have you included `jquery.js` and put your code in DOMReady handler? `$(function() { /* code here */ });`

http://stackoverflow.com/q/28223610
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Load animated gif after all other files on page load
tagged with: animated-gif
score: 0
tagged with: pageload
accepted answer: http://stackoverflow.com/a/28223711
answer count: 1
has comment: http://stackoverflow.com/comment/44810368
has body: I have a pretty massive animated gif (several mb!), and I don't want to hold up the rest of the elements from loading on the page before loading the gif. What technology/technique would you use to do this? I'm not asking for code here, just to be pointed in the right direction... if it's jQuery, or... something else, maybe? I'd love to know what best practices are with something like that.
tagged with: javascript
has answer: http://stackoverflow.com/a/28223711

reactjs
tags question: http://stackoverflow.com/q/28143193
tags question: http://stackoverflow.com/q/28197336
tags question: http://stackoverflow.com/q/28170605
tags question: http://stackoverflow.com/q/28250103
tags question: http://stackoverflow.com/q/28263404
tags question: http://stackoverflow.com/q/28205317
tags question: http://stackoverflow.com/q/28160302
type: Tag
tags question: http://stackoverflow.com/q/28244204
tags question: http://stackoverflow.com/q/28268835
tags question: http://stackoverflow.com/q/28159744
tags question: http://stackoverflow.com/q/28218814
tags question: http://stackoverflow.com/q/28162860
tags question: http://stackoverflow.com/q/28129165
tags question: http://stackoverflow.com/q/28192595
tags question: http://stackoverflow.com/q/28246497
tags question: http://stackoverflow.com/q/28205649
tag name: reactjs
tags question: http://stackoverflow.com/q/28192711
tags question: http://stackoverflow.com/q/28145290
tags question: http://stackoverflow.com/q/28173737
tags question: http://stackoverflow.com/q/28275775
tags question: http://stackoverflow.com/q/28146748
tags question: http://stackoverflow.com/q/28252768
tags question: http://stackoverflow.com/q/28159631
tags question: http://stackoverflow.com/q/28234922
tags question: http://stackoverflow.com/q/28265840
tags question: http://stackoverflow.com/q/28199973
tags question: http://stackoverflow.com/q/28162686
tags question: http://stackoverflow.com/q/28179330
tags question: http://stackoverflow.com/q/28172896
tags question: http://stackoverflow.com/q/28241912
tags question: http://stackoverflow.com/q/28122656
tags question: http://stackoverflow.com/q/28252703
tags question: http://stackoverflow.com/q/28151067
tags question: http://stackoverflow.com/q/28129270
tags question: http://stackoverflow.com/q/28269669
tags question: http://stackoverflow.com/q/28154071
tags question: http://stackoverflow.com/q/28220017

http://stackoverflow.com/comment/44910920
type: Comment
score: 4
comment on: http://stackoverflow.com/q/28278394
type: QuestionComment
has text: where is the variable coming from?

http://stackoverflow.com/a/28265180
score: 0
has comment: http://stackoverflow.com/comment/44888382
type: Answer
answers question: http://stackoverflow.com/q/28264835
has body: Change to this contentType: "application/json" }).done(function() { $(".send-message").click(function() { var nameOfUser = $(this).prev('h1').text(); //alert(nameOfUser); }); ) Here is the JSFiddle to show how this change works

http://stackoverflow.com/comment/45059388
score: 0
has text: Hi and welcome to stack overflow. It's not clear what you want. You'd like to change the background's class - but you haven't told us what you are seeing instead. Is there an error?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28184212

anonymous-function
tags question: http://stackoverflow.com/q/28131017
type: Tag
tag name: anonymous-function
tags question: http://stackoverflow.com/q/28268338
tags question: http://stackoverflow.com/q/28138295

http://stackoverflow.com/q/28149680
score: 1
has answer: http://stackoverflow.com/a/28262757
upvote count: 1
tagged with: fancybox-2
type: Question
has body: I'm using 'fancy box' and I'm trying to change my url to be the url of the fancy box, so I try to use History.pushState(). but it makes error The error: Uncaught SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'about:blank' cannot be created in a document with origin 'http://localhost:28587' My code: var _url = window.location.href; setInterval(function () { if (($(".fancybox-iframe").length &gt; 0)) { if(window.location.href != $('.fancybox-iframe').contents().get(0).location.href) { history.pushState(null, null, $('.fancybox-iframe').contents().get(0).location.href); } } else { if(window.location.href != _url) { history.pushState(null,null, _url); } } }, 80); I'd search it and didn't find an answer, please help me or Suggest me better solution for doing that. (I found this:Javascript history.PushState not working? but I didnt understand what wrong in my code from the answer) Edit: and another problem is that when i press "back" in browser the url is change but not actually loaded, why??
tagged with: pushstate
linked to: http://stackoverflow.com/q/20079704
tagged with: javascript
has comment: http://stackoverflow.com/comment/44752635
answer count: 1
downvote count: 0
tagged with: url
tagged with: jquery
has title: history.pushState error using fancybox "Failed to execute 'pushState' on 'History': A history "
favorite count: 0
has comment: http://stackoverflow.com/comment/44861850
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44869069

http://stackoverflow.com/comment/44786364
score: 0
type: Comment
has text: hi thanks code lover but now I get the error msy syntax error missing ; before statement echo ' ';
comment on: http://stackoverflow.com/a/28209956
type: AnswerComment

http://stackoverflow.com/comment/44731061
comment on: http://stackoverflow.com/a/28180865
type: AnswerComment
score: 0
type: Comment
has text: Snippets are quite young here. What do you mean it doesn't work? The first one is supposed to fail, while the other two work fine.

http://stackoverflow.com/a/51180386
answers question: http://stackoverflow.com/q/28158764
score: 0
type: Answer
has body: You can try this, with this code each time you type on the input1 you get the same value on the input2 Value 1 Value 2

http://stackoverflow.com/comment/44870746
type: Comment
type: QuestionComment
has text: Did you try it like `WebService.HelloWorld()`?
comment on: http://stackoverflow.com/q/28256164
score: 0

http://stackoverflow.com/q/28277443
has comment: http://stackoverflow.com/comment/44909580
has title: Forcing AJAX call to be HTTPS from HTTPS Page
tagged with: javascript
upvote count: 13
has comment: http://stackoverflow.com/comment/44910544
has comment: http://stackoverflow.com/comment/44915387
answer count: 1
downvote count: 0
tagged with: mixed-content
tagged with: jsp
has comment: http://stackoverflow.com/comment/44910152
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44913777
linked to: http://stackoverflow.com/q/20518653
has answer: http://stackoverflow.com/a/28278784
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28278784
score: 13
has body: Currently making an AJAX call from a HTTPS jsp to call in data from another jsp page. We are however getting a Mixed content issue: Mixed Content: The page at 'https://etc/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://etc/path/to/other/page.jsp'. This request has been blocked; the content must be served over HTTPS. How do you force an AJAX call to call over HTTPS? The AJAX call looks like the following: var url = "/path/to/other/page.jsp"; $.ajax({ type: "POST", url: url, data: {data: data}, dataType: "html", timeout: 4000, success: function(html) { /* Code on Success */ } }, error: function(request, status, error) { /* Code on Failure } }); I could understand if I was trying to make a call from HTTPS to HTTP, but I don't want to. I want to force this to call the JSP using HTTPS is all, so I can avoid the Mixed Content issue. Thank you in advance! /* EDIT */ Interestingly I put in the variable URL an absolute path: var url = "https://etc/path/to/other/page.jsp"; And I got the same issue. Something is forcing this AJAX call to be HTTP?
type: Question
linked to: http://stackoverflow.com/q/6114436

http://stackoverflow.com/comment/44635044
comment on: http://stackoverflow.com/q/28130568
score: 0
type: Comment
type: QuestionComment
has text: Yes, you should use roles for that

http://stackoverflow.com/comment/116057947
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28194039
has text: In the next steps you'll probably check the integer result itself such as `if (age >= 0)` because you probably don't want negative integer here, and there 'NaN' won't pass and you'll be safe again.
score: 0

file
type: Tag
tags question: http://stackoverflow.com/q/28153131
tag name: file
tags question: http://stackoverflow.com/q/28195678
tags question: http://stackoverflow.com/q/28193510
tags question: http://stackoverflow.com/q/28121859
tags question: http://stackoverflow.com/q/28209628
tags question: http://stackoverflow.com/q/28207770
tags question: http://stackoverflow.com/q/28156622
tags question: http://stackoverflow.com/q/28195447

http://stackoverflow.com/comment/44819535
score: 0
type: Comment
has text: apologies, getElementById does return one element.
comment on: http://stackoverflow.com/a/28228227
type: AnswerComment

http://stackoverflow.com/comment/44903802
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28273606
has text: Thanks. I just stuck it right into the footer.php file right before the close of the body and it all works. Now I should just be able to merge it all into 1 .js file, and just put: `<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/mycode.js"> ` before the right?
score: 0

http://stackoverflow.com/comment/80389368
comment on: http://stackoverflow.com/a/28225991
score: 0
type: Comment
type: AnswerComment
has text: I have the same problem but was unable to understand your answer - any help? I asked my question here: https://stackoverflow.com/questions/46717683/xeditable-select2-dropdown-w-ajax-source-displaying-empty-after-submitting

http://stackoverflow.com/q/28231924
has body: I have a custom renderer for summing the columns in my handsontable. The values are only shown when a cell is edited, but not when the table loads with its initial data. Is there some event to load the initial rendering? Or am I calling the renderer incorrectly? hot = new Handsontable(container, { data: data, colHeaders: col_headers, rowHeaders: row_headers, colWidths: 110, rowHeights: 30, startRows: row_count, maxRow: row_count, maxCols: col_headers.length, columns: column_types, cells: function(row, col, prop){ if (row === row_count - 1) { this.renderer = sumRenderer; var cellProperties = {}; cellProperties.readOnly = true; } return cellProperties; } }); var sumRenderer = function (instance, td, row, col, prop, value) { var total = 0; for (ii = 0; ii &lt; row; ii++) { total += instance.getDataAtCell(ii, col); }; value = total; Handsontable.renderers.NumericRenderer.apply(this, arguments); };
answer count: 1
tagged with: web
score: 1
favorite count: 0
upvote count: 2
has title: Custom renderer not applied on Table render handsontable
has answer: http://stackoverflow.com/a/28232259
type: AnsweredQuestion
tagged with: handsontable
downvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28232259

http://stackoverflow.com/a/46781183
score: 0
type: Answer
has body: I know this is old, but for anyone who google lands here in/after 2017, try this: Promise.any is a bluebird construct. It returns the first thing to resolve. If you want to wait for both, the correct method is Promise.all. Try something like this: var isLoaded = function (browser) { var waitForJS = waitForElement(browser, By.css('body.js')); var waitForMobile = waitForElement(browser, By.css('#mobile_landing_page')); return Promise.all([waitForJS, waitForMobile]); }; // Then use like this: isLoaded(browser) .then((elemCheck) =&gt; { const hasBodyJsTag = elemCheck[0] const hasMobileTag = elemCheck[1] console.log('Elem Status:', elemCheck) })
answers question: http://stackoverflow.com/q/28172243

asynchronous
tags question: http://stackoverflow.com/q/28217794
tags question: http://stackoverflow.com/q/28261780
tags question: http://stackoverflow.com/q/28261000
tags question: http://stackoverflow.com/q/28210730
tags question: http://stackoverflow.com/q/28194853
type: Tag
tags question: http://stackoverflow.com/q/28262247
tags question: http://stackoverflow.com/q/28233358
tags question: http://stackoverflow.com/q/28205139
tag name: asynchronous
tags question: http://stackoverflow.com/q/28260140
tags question: http://stackoverflow.com/q/28134974
tags question: http://stackoverflow.com/q/28180547
tags question: http://stackoverflow.com/q/28122252
tags question: http://stackoverflow.com/q/28274741
tags question: http://stackoverflow.com/q/28266855
tags question: http://stackoverflow.com/q/28146254
tags question: http://stackoverflow.com/q/28215832
tags question: http://stackoverflow.com/q/28241032
tags question: http://stackoverflow.com/q/28204388
tags question: http://stackoverflow.com/q/28219222
tags question: http://stackoverflow.com/q/28167572
tags question: http://stackoverflow.com/q/28245302
tags question: http://stackoverflow.com/q/28146988
tags question: http://stackoverflow.com/q/28177160
tags question: http://stackoverflow.com/q/28219550
tags question: http://stackoverflow.com/q/28252104
tags question: http://stackoverflow.com/q/28240383
tags question: http://stackoverflow.com/q/28221469
tags question: http://stackoverflow.com/q/28231643
tags question: http://stackoverflow.com/q/28253758
tags question: http://stackoverflow.com/q/28218364
tags question: http://stackoverflow.com/q/28198750
tags question: http://stackoverflow.com/q/28202960
tags question: http://stackoverflow.com/q/28185798

http://stackoverflow.com/q/28261785
has body: I am attempting load an array of genres, for use as select values. Multiple selects can be created using an addSelect action. Here's how I load the data. genreStrings: function() { var array = []; this.store.findAll("genre").then(function(genres){ genres.forEach(function(genre){ array.push(genre.get('combinedName')); }); }); return array; }.property(), And then it's used in the template like so. {{view "select" content=genreStrings value=genre.name prompt="Select a Genre" }} The problem I face is that the first select that loads as the page loads has no values, whilst each subsequent one, added by using the addSelect action has the values as expected. I have tried .on('init') but this still isn't working. How can I get these values to be set for the first select?
type: UnansweredQuestion
has title: Ember loading values on controller load
score: 0
has answer: http://stackoverflow.com/a/28262381
type: Question
tagged with: ember-data
tagged with: javascript
tagged with: ember.js
answer count: 1

http://stackoverflow.com/comment/44772841
has text: You should probably delete the question since it wouldn't help anyone on stack! Very specific
type: Comment
comment on: http://stackoverflow.com/a/28202930
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44683325
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28155909
type: AnswerComment
has text: Thank you for your most excellent answer. Any ideas why copying the script element does not work?

http://stackoverflow.com/q/28205278
type: UnansweredQuestion
has body: Anybody run into a JavaScript error when trying to run Twitter For Web widgets.js on Internet Explorer 8 (IE8)? If so, do you know how to fix this or how to handle it gracefully? CODE Just adding this block of code, which loads the widgets.js file throws an error on IE8: &lt;script&gt; window.twttr = (function (d, s, id) { var t, js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src= "https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } }); }(document, "script", "twitter-wjs")); &lt;/script&gt; I got this snippet at: https://dev.twitter.com/web/javascript/loading ERROR in IE8 Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Timestamp: Thu, 29 Jan 2015 00:54:28 UTC Message: Script error Line: 0 Char: 0 Code: 0 URI: https://platform.twitter.com/widgets.js That was not helpful, but in the Developer tool, under Script I get the following message: (X) Expected identifier widgets.js, line 1 character 29036 I also investigated and found that Twitter stopped fully supporting IE7 last year (2014) and is stopping support for IE8 early in January 2015. I'm not sure if this is why their widgets.js causes an error or not, but I still need to figure out what the best way is to load this script without throwing an error on IE8. Thank you!
has answer: http://stackoverflow.com/a/30661727
tagged with: internet-explorer-8
has title: Twitter widgets.js throws JavaScript error "Expected identifier" on IE8
tagged with: twitter
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/44776305
has comment: http://stackoverflow.com/comment/44776522
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28283384
favorite count: 0
linked to: http://stackoverflow.com/q/10964966
tagged with: twitter-widget

http://stackoverflow.com/comment/44708465
has text: Still you can upvote . That's not matter with the reputation i guess @KieranHanna
comment on: http://stackoverflow.com/a/28169284
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28219030
answers question: http://stackoverflow.com/q/28216360
has comment: http://stackoverflow.com/comment/44829781
upvote count: 9
type: Answer
has comment: http://stackoverflow.com/comment/44889101
has comment: http://stackoverflow.com/comment/90778858
downvote count: 0
has comment: http://stackoverflow.com/comment/97142521
has body: I had the same issue. One probable cause is that the coordinates are changed due to the image resizing (explicitly or implicitly) at client side. After selection, you need to fix the ratio: $('#img1').Jcrop({ onSelect: function (coords) { // fix crop size: find ratio dividing current per real size var ratioW = $('#img1')[0].naturalWidth / $('#img1').width(); var ratioH = $('#img1')[0].naturalHeight / $('#img1').height(); var currentRatio = Math.min(ratioW, ratioH); $('#x').val(Math.round(coords.x * currentRatio)); $('#y').val(Math.round(coords.y * currentRatio)); $('#w').val(Math.round(coords.w * currentRatio)); $('#h').val(Math.round(coords.h * currentRatio)); } }); If you need them (which doesn't seem so), don't forget to fix also x2 and y2. Additionally, selectors could be optimized.
score: 9
has comment: http://stackoverflow.com/comment/44823832

http://stackoverflow.com/comment/117664378
type: AnswerComment
comment on: http://stackoverflow.com/a/29331955
type: Comment
has text: Assuming you have a `multiplier` of 2, doesn't that make scrolling with the mouse wheel twice as fast as normal? Doesn't this confuse the user?
score: 0

http://stackoverflow.com/comment/44889960
type: AnswerComment
comment on: http://stackoverflow.com/a/28266743
type: Comment
has text: New line is created but the cursor does not move and a text will be written on the first line.
score: 0

http://stackoverflow.com/comment/44709655
has text: @all Dropdown should hide when i mouseover on anchor second time. Not on mouseleave.
score: 0
comment on: http://stackoverflow.com/q/28169758
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28226400
answers question: http://stackoverflow.com/q/28226180
score: 0
type: Answer
has body: Try applying this to $scope var app = angular.module('ido.controllers', []); app.controller("HeaderCtrl", function($scope) { angular.extend($scope, { HelpButtonVisible: false, HideHelpButton: function() { $scope.HelpButtonVisible = false; }, ShowHelpButton: function() { $scope.HelpButtonVisible = true; } }); }) Help Always attach events and values to $scope. You only have access to the $scope. When you use the scope, there is never any need to use .$digest() or .$apply(). Only when you break out of the $scope.

http://stackoverflow.com/a/28146689
downvote count: 0
has body: At best, your current approach would be relying on a precise and consistent implementation of promise .then() handlers such they never allowed other queued events to process before they were called. At worst, you would definitely have a chance at missing events. If you look at Benjamin's jsFiddle and run it in both Chrome and Firefox, you will see that Firefox misses an event (I don't see a missing event in Chrome). What is clear is that your current design is simply not a safe design because it relies on implementation details (that may or may not be well specified and may or may not be implemented perfectly even if specified) that your code simply does not need to depend on. Whether or not some spec says that this might or should work, this is a brittle design that does not need to be susceptible to this issue. What would make more sense is to base your design on a constantly installed event listener so there is no way you can ever miss an event. It is probably still possible to use promises with that type of design, but as others have pointed out that is rarely (if ever) a preferred design pattern because promises are not designed for repeated events so you have to continue to create new promises after each event and you will generally find that just using a classic callback for an event handler is a much cleaner way of doing things and takes none of the risks that your current approach is taking. For example, your proposed code could simply be replaced with this: window.addEventListener('message', function(e) { // the synchronous code you mentioned to process the event }); which is simpler and is guaranteed to not have any vulnerability to missing messages that your code might have. This code is also more consistent with general design patterns for event driven code in common use for a wide variety of events (such as click events that you mentioned).
has comment: http://stackoverflow.com/comment/44665053
upvote count: 3
has comment: http://stackoverflow.com/comment/44665114
answers question: http://stackoverflow.com/q/28146276
type: Answer
score: 3

http://stackoverflow.com/q/28131219
has comment: http://stackoverflow.com/comment/44635033
favorite count: 0
has comment: http://stackoverflow.com/comment/44635042
accepted answer: http://stackoverflow.com/a/28131257
has comment: http://stackoverflow.com/comment/44635055
has title: Understanding RequireJS: What exactly is passed to the anonymous function?
tagged with: requirejs
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28131257
downvote count: 0
tagged with: javascript
answer count: 1
has body: I am trying to wrap my head around using RequireJS for my web projects. For testing, I've written two mini functions: multiply.js ;function multiply(x, y) { return parseInt(x) * parseInt(y); } substract.js ;function substract(x, y) { return parseInt(x) - parseInt(y); } Everything loads flawlessly, so I am definitely on the right track, but there are still some things I don't understand. main.js looks like this: define(['substract', 'multiply'], function(one, two) { console.log('substract(8, "4") --&gt; ' + substract(8, "4")); console.log('multiply(10, 10) --&gt; ' + multiply(10, 10)); }); The functions all work, but alert(typeof(one)); tells me it's undefined. I know this question is probably pretty basic, but why is it undefined &amp; what is passed to the anonymous function?

http://stackoverflow.com/comment/44833064
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28218621
has text: Sorry Hugo, I've completely misread the question. Excuse my drivel above - I'll edit the answer...

http://stackoverflow.com/comment/44896520
type: AnswerComment
comment on: http://stackoverflow.com/a/28270399
has text: Then AJAX alone is not your friend.
type: Comment
score: 0

http://stackoverflow.com/a/28156601
upvote count: 2
type: Answer
score: 2
has body: Here's what's happening. First - create an anonymous function (or IIFE) that accepts three parameters (pageName, $, and undefined) (function(pageName, $, undefined) {... When the function is called, pass in window.pageName (unless it's null or undefined, then pass in an empty object) as the first parameter, then pass in jQuery as the second parameter. The third parameter is not passed in intentionally as a way to declare a local variable within the function that is undefined. ...}(window.pageName = window.pageName || {}, jQuery)); So, window.pageName becomes the local variable pageName, jQuery becomes the local variable $ and undefined is a variable that exists just as a shortcut so you don't have to check typeof someVariable === 'undefined' throughout the function. Instead, you can now perform a check like someVariable === undefined. All of this is done without cluttering up the global space which is why you're seeing it throughout the code you're working on. I hope this helps clear it up a bit for you. You should probably read more on Immediately Invoked Function Expressions (IIFE) or (how it was called when I learned - Self Executing Anonymous Functions). There are a ton of resources out there about this topic.
answers question: http://stackoverflow.com/q/28156454
downvote count: 0

http://stackoverflow.com/q/28172955
has comment: http://stackoverflow.com/comment/44715715
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44715622
has answer: http://stackoverflow.com/a/28173417
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44715523
has title: jQuery animate position using calc as value (subtract px from percentage)
has comment: http://stackoverflow.com/comment/44715284
type: Question
has body: Bit of a confusing title but the question is can we take pixels away from a percentage inside .animate? I have created an example below. $(document).ready(function() { // Set the percentage off loading(); }); function loading() { var num = 0; for (i = 0; i &lt;= 100; i++) { setTimeout(function() { $('.follower').animate({ left: num + "%" }, 40, "linear"); num++; }, i * 50); }; } .track { width: 90%; height: 40px; background: #999; border-radius: 10px; margin: 0 auto; position: relative; } .follower { width: 60px; height: 20px; border: 1px solid; border-radius: 10px; background: #222; position: absolute; top: 54px; left: 100%; } .follower:after { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #222; position: absolute; top: -8px; left: 0; right: 0; margin: auto; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="track"&gt; &lt;div class="follower"&gt;&lt;/div&gt; &lt;/div&gt; You can see .follower is working as intended but I need that little point above it to start where .track starts and to finish where .track ends. So I have to take half of .follower width of the percentage it has moved in the jQuery but I cannot find a way to do this. I have looked around and there are ways using .css etc but nothing when using .animate. How how we take pixels from a percentage in jQuery when using .animate?
score: 1
possible better answer: http://stackoverflow.com/a/28173417
has answer: http://stackoverflow.com/a/28173557
accepted answer: http://stackoverflow.com/a/28173557
answer count: 2
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28263996
has body: I'd probably solve it by adding a :not(.clicked) to the selector, and adding that class when you add the input. E.g.: $('#elements').on('click', '.items:not(.clicked)', function () { $(this).addClass("clicked"); // ...your current handling... }); But you could solve it by checking for the existence of the field, provided the input or textarea you're adding is the only one the paragraph will have: $('#elements').on('click', '.items', function () { if (!$(this).find("input, textarea")[0]) { // ...your current handling... } }); Or actually jQuery extends CSS to provide :has and to allow :not to have more complex contents, so in theory this would work: $('#elements').on('click', '.items:not(:has(input)):not(:has(textarea))', function () { // ...your current handling... }); ...but that selector is getting a bit unwieldy...
answers question: http://stackoverflow.com/q/28263967
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44884795
has comment: http://stackoverflow.com/comment/44884831
upvote count: 1

http://stackoverflow.com/comment/44740929
comment on: http://stackoverflow.com/a/28185965
score: 0
type: Comment
type: AnswerComment
has text: I did this: lpad(d.getHours() %12, 2) and it worked. thanks for helping Eric I appreciate it. :)

http://stackoverflow.com/a/33665918
answers question: http://stackoverflow.com/q/28122737
score: 0
type: Answer
has body: You can do that, by this way.. I made a folder called 'assets' in public folder then I just use asset() function and called my CSS and JS file. BTW: This is for Laravel-5

http://stackoverflow.com/a/28148475
has comment: http://stackoverflow.com/comment/44672915
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/44674976
has comment: http://stackoverflow.com/comment/44674964
has comment: http://stackoverflow.com/comment/44668534
has comment: http://stackoverflow.com/comment/44668578
has comment: http://stackoverflow.com/comment/44672420
type: Answer
has comment: http://stackoverflow.com/comment/44672784
has comment: http://stackoverflow.com/comment/44668664
has body: Instead of doing all these, you can either use $(el).append() or $(el).prepend() for inserting the tag! $("#k673f4141ea127b").append('2003'); Or, If I understand correctly, you wanna wrap the final 2003 with a span.annotation right? If that's the case, you can do: $("#k673f4141ea127b").contents().eq(1).wrap(''); Fiddle: $(document).ready(function() { $("#k673f4141ea127b").contents().eq(1).wrap(''); }); Publication date (collection): 2003
has comment: http://stackoverflow.com/comment/44668374
answers question: http://stackoverflow.com/q/28148432
has comment: http://stackoverflow.com/comment/44669405
has comment: http://stackoverflow.com/comment/44671392
has comment: http://stackoverflow.com/comment/44668406
has comment: http://stackoverflow.com/comment/44675243
has comment: http://stackoverflow.com/comment/44674781
has comment: http://stackoverflow.com/comment/44668713
upvote count: 4

http://stackoverflow.com/q/28175785
accepted answer: http://stackoverflow.com/a/28176706
possible better answer: http://stackoverflow.com/a/45826016
has comment: http://stackoverflow.com/comment/44722295
upvote count: 6
linked to: http://stackoverflow.com/q/14846466
has comment: http://stackoverflow.com/comment/44720760
has comment: http://stackoverflow.com/comment/44721153
has comment: http://stackoverflow.com/comment/57821360
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/46364807
has comment: http://stackoverflow.com/comment/44720657
has comment: http://stackoverflow.com/comment/44722142
has answer: http://stackoverflow.com/a/28175924
has answer: http://stackoverflow.com/a/28176706
has comment: http://stackoverflow.com/comment/44722177
answer count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/45826016
score: 6
favorite count: 0
has title: UI-Router and resolve, unknown provider in controller
tagged with: angularjs
has body: I am using resolve in my UI-Router .state() call. In my controller I can access the values no problem, but it is throwing an error as follows: $injector/unpr?p0=ctrlOptionsProvider%20%3C-trlOptions The following code throws the error but allows me to access the variable ctrlOptions just fine: .state('new_user', { url: "/user/new", templateUrl: "views/user/new.html", data: {pageTitle: 'New User'}, controller: "UserController", resolve: { ctrlOptions: ['$stateParams', function($stateParams) { return { view: 'new_user', } }], deps: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load({ name: 'MetronicApp', insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' files: [ '../../../assets/global/plugins/bootstrap-datepicker/css/datepicker3.css', '../../../assets/global/plugins/select2/select2.css', '../../../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js', '../../../assets/global/plugins/select2/select2.min.js', ] }); }] } }) MetronicApp.controller('UserController', ['$rootScope', '$scope', '$http', '$stateParams', 'ctrlOptions', function($rootScope, $scope, $http, $stateParams, ctrlOptions, $timeout) {} Any idea how to fix this? Thanks
type: Question

http://stackoverflow.com/comment/44619086
type: Comment
comment on: http://stackoverflow.com/a/28122430
type: AnswerComment
has text: worked as a charm, the this keyword is something I had not considered :) Thou I met one issue, it wont close, the previous opened menu. Say I open the first submenu, and want to go back to the mainsubmenu(first ul), and open another submenu. I will try and figure it out, seems I am only missing one big IF command :) If clicked elsewhere, close, If clicked on another li, then close.. Is this also something for addEventListener?
score: 0

http://stackoverflow.com/q/28200686
has title: automatic jquery alert on post resquest from python
score: 0
has comment: http://stackoverflow.com/comment/44767559
has body: I want to create a page index.php that should automatically (without refreshing) pop an alert containing post data each time a post request is made to post.php. The scripts send.py and post.php work perfectly and return each time {"key":"i"}, but index.php shows nothing. What's the problem with my code? Index.php &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; $.ajax({ type: "GET", url: "post.php", dataType: "json", success: function(data){ alert(data.key); } }); post.php &lt;?php echo json_encode($_POST); ?&gt; send.py import urllib2, urllib import time for i in range(3): mydata=[('key',i)] mydata=urllib.urlencode(mydata) path='http://localhost/post.php' req=urllib2.Request(path, mydata) req.add_header("Content-type", "application/x-www-form-urlencoded") page=urllib2.urlopen(req).read() print page time.sleep(5)
type: UnansweredQuestion
tagged with: python
tagged with: php
has comment: http://stackoverflow.com/comment/44767849
answer count: 0
has comment: http://stackoverflow.com/comment/44767687
type: Question
has comment: http://stackoverflow.com/comment/44767814
has comment: http://stackoverflow.com/comment/44767722
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44876907
comment on: http://stackoverflow.com/q/28256021
has text: change ` ` to ` ` ad deploy to an emulator or device
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44730705
comment on: http://stackoverflow.com/q/28178558
type: QuestionComment
type: Comment
has text: I tested your link and it's working fine on firefox, chrome and opera ! For your case, you don't need a crossdomain.xml file because the player and its loaded content are in the same domain. So could you give us more details about the problem when it's fired using the browser network logging tab ?
score: 0

http://stackoverflow.com/comment/44658131
type: QuestionComment
has text: That *should* work. You forgot to close `$(document).ready(function() { ... });` though. If the elements are dynamically generated, use [event delegation](http://learn.jquery.com/events/event-delegation/).
comment on: http://stackoverflow.com/q/28143235
score: 0
type: Comment

http://stackoverflow.com/comment/44813176
type: Comment
comment on: http://stackoverflow.com/a/28224305
has text: I can help you if you update your question with both your source code. This will include your html, css, JavaScript and PHP
type: AnswerComment
score: 0

http://stackoverflow.com/q/28124028
has comment: http://stackoverflow.com/comment/44621685
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/44621718
has title: How on trigger onBlur before form submit
score: 8
favorite count: 0
upvote count: 8
has answer: http://stackoverflow.com/a/28124056
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28124296
tagged with: forms
possible better answer: http://stackoverflow.com/a/28124279
has body: I have some input box in which I am having onBlur function called for validation. The problem I am facing is that when I directly click on submit button without tabbing out from the input box, form is getting submitted before onBlur function call and the validation is not happening. Can someone suggest a workaround here. I am using javascript and JQuery in my JSP page.
type: Question
has answer: http://stackoverflow.com/a/28124279
has comment: http://stackoverflow.com/comment/44631263
tagged with: jsp
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28124056

http://stackoverflow.com/comment/44818664
score: 0
type: Comment
type: QuestionComment
has text: Thanks for all the answers - I used JQuery and ajax as suggested and it has worked for me - simple when you know how! '$.ajax({ type: "POST", url: "/cgi-bin/hello.py", data: {status: standby} });'
comment on: http://stackoverflow.com/q/28222705

http://stackoverflow.com/comment/44656120
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28139295
has text: Okay you were right, it was all good. The reason I couldn't get it working was my links were not using ajax and thus clicking one refreshed the menu. As a result, 'members' was always active cause that was default. Face palm.

http://stackoverflow.com/comment/44870317
has text: @onesomeday - Please check the fiddle http://jsfiddle.net/s8a7m1hk/1/ , can we say this is the final breakdown? if not final, further breakdown? If yes, we can infer that all function declarations are broken down in to function expressions. Please correct me if i am wrong
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28255466
type: Comment

http://stackoverflow.com/a/28180065
has comment: http://stackoverflow.com/comment/44729614
has comment: http://stackoverflow.com/comment/44729373
has body: You can surround razor expressions in quotes ' or " to have them output into a javascript block. If you need the type to be preserved properly, you can use methods like parseInt() or parseFloat() to do so. Example: var stuff = { value1 : '@val1', value2 : [ parseInt('@val2'), parseInt('@val3') ] }; If you need to left side of the assignment to be variable, you will probably need to build a json string and then parse that into the object. Something like this, my quotes might be off. var stuffJson = '{"@value1" : "@val1", "@value2" : "[ @val2, @val3 ]" }'; var stuff = JSON.parse(stuffJson); If you're doing this a lot, you might want to consider using the Json() method in your controller to help you build these more easily. You could build a dictionary of key / value and have that output json: public virtual ActionResult GetStuff() { string value1 = "key1", value2 = "key2", val1 = "str1", val2 = "str2", val3 = "str3"; var dict = new Dictionary&lt;string, object&gt; { { value1, val1}, { value2, new List&lt;string&gt; { val2, val3} }, }; return Json(dict, JsonRequestBehavior.AllowGet); } Output: {"key1":"str1","key2":["str2","str3"]}
type: Answer
answers question: http://stackoverflow.com/q/28179650
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44729570
has comment: http://stackoverflow.com/comment/44757271
has comment: http://stackoverflow.com/comment/44730734
has comment: http://stackoverflow.com/comment/44729412
downvote count: 0

http://stackoverflow.com/comment/44805031
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28220957
has text: Side note: You're already using `jQuery`, so don't add the event handler in the markup. You can register it when the `document` is `ready`: `$('.showHide').on('click', ... )`
score: 0

http://stackoverflow.com/q/28279076
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: adsense-api
has title: I want to adsense code right side js base embed player in blogger template
type: UnansweredQuestion
tagged with: iframe
tagged with: adsense
type: Question
has body: I have tried but the script code looks like &lt;script&gt;// &lt;![CDATA[ $(function() { if($("#bigframe").length&gt;0){ vartitle=$(".single-post-title").text(); $("#titlevid").text(title); var bigvideo = $("#bigframe").attr("src"); var videotag = '&lt;iframe src="'+bigvideo+'"id="covervideo" frameborder="0"&gt;&lt;/iframe&gt;'; $(videotag).appendTo("#myvideo"); $("#bigframe").remove(); } else { $("#myvideo").remove(); } });// ]]&gt;&lt;/script&gt; The website is here http://www.ytclips.in/2015/01/uttama-villain-kamal-haasan.html I have adjusted that frame center to left using css in blogger can anyone help me add adsense to right of that player blogger template here.. https://drive.google.com/file/d/0ByvUiH6qnOlJUXdOaVp6VHpjRUE/edit
has answer: http://stackoverflow.com/a/28279355
answer count: 1

http://stackoverflow.com/comment/70434410
comment on: http://stackoverflow.com/a/28165677
type: Comment
has text: thank you very much my good sir, placing it before did the job for me
score: 1
type: AnswerComment

http://stackoverflow.com/a/28232198
score: 1
has body: You can only have one start-run pair per casper instance. start resets all the steps before, so everything that was in the queue is gone. In startQuery, you can change casper.start to casper.thenOpen and remove casper.run completely.
answers question: http://stackoverflow.com/q/28231400
type: Answer
accepted answer of: http://stackoverflow.com/q/28231400
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28232160
answers question: http://stackoverflow.com/q/28231655
has comment: http://stackoverflow.com/comment/44827439
score: 0
has body: This javascript function will escape all special characters.. function addslashes(str) { return (str + '') .replace(/[\\"']/g, '\\$&amp;') .replace(/\u0000/g, '\\0'); } Credits: http://phpjs.org/functions/addslashes/
type: Answer

asp.net-mvc-4
tags question: http://stackoverflow.com/q/28138918
tags question: http://stackoverflow.com/q/28191459
tags question: http://stackoverflow.com/q/28226495
tags question: http://stackoverflow.com/q/28159867
tag name: asp.net-mvc-4
tags question: http://stackoverflow.com/q/28167227
tags question: http://stackoverflow.com/q/28215832
type: Tag
tags question: http://stackoverflow.com/q/28230247
tags question: http://stackoverflow.com/q/28125258
tags question: http://stackoverflow.com/q/28222785
tags question: http://stackoverflow.com/q/28125875
tags question: http://stackoverflow.com/q/28275173
tags question: http://stackoverflow.com/q/28187944
tags question: http://stackoverflow.com/q/28133041
tags question: http://stackoverflow.com/q/28199517
tags question: http://stackoverflow.com/q/28274841
tags question: http://stackoverflow.com/q/28144805

http://stackoverflow.com/a/38320664
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28272954
has body: i think you are asking to pass value into databse enter digit : Person info will be listed here... as this progrm is to show the details of the user but there is error in the code in passing the value

http://stackoverflow.com/comment/47741495
score: 2
type: AnswerComment
type: Comment
has text: My gmail and inbox and google developer site etc have been giving me trouble all day. I disabled that and bam. She works. Dono what google is up to. Dono if its just a coincidence that there was a chrome update today as well?
comment on: http://stackoverflow.com/a/29788621

http://stackoverflow.com/q/28276936
tagged with: php
has answer: http://stackoverflow.com/a/28278513
has comment: http://stackoverflow.com/comment/44910190
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44910397
has comment: http://stackoverflow.com/comment/44909673
score: 0
tagged with: java
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44909739
tagged with: arrays
accepted answer: http://stackoverflow.com/a/28278513
tagged with: javascript
has body: I want to populate this google map - chart with the cities from the db, and the number of users from each city. In order to do this, I have used the following code: &lt;? $query_city_users = "SELECT DISTINCT(city) FROM users WHERE approved = 1"; $city_users = mysql_query($query_city_users, $con) or die(mysql_error()); while ($row_city_users = mysql_fetch_assoc($city_users)) { $query_users_from_city = "SELECT * FROM users WHERE approved = 1 AND city= '".$row_city_users['city']."'"; $users_from_city = mysql_query($query_users_from_city, $con) or die(mysql_error()); $totalRows_users_from_city = mysql_num_rows($users_from_city); ?&gt; &lt;?=$row_city_users['city'] ?&gt; - &lt;?=$totalRows_users_from_city ?&gt; &lt;br&gt; In PHP this outputs ok... it echoes the list of the cities and how many users are in each city. The problem encountered is in my Charts Script attempt to populate with the data from the queries above. &lt;!------ MAP CHARTS-------&gt; &lt;script type='text/javascript' src='https://www.google.com/jsapi'&gt;&lt;/script&gt; &lt;script type='text/javascript'&gt; google.load('visualization', '1', {'packages': ['geochart']}); google.setOnLoadCallback(drawMarkersMap); function drawMarkersMap() { var data = google.visualization.arrayToDataTable([ ['City', 'Users Number'], ['&lt;?=$row_city_users['city'] ?&gt;', '&lt;?=$totalRows_users_from_city ?&gt;'] ]); var options = { region: 'IT', displayMode: 'markers', colorAxis: {colors: ['lightblue', 'blue'], backgroundColor: 'blue', keepAspectRatio: 'true', } }; var chart = new google.visualization.GeoChart(document.getElementById('italy')); chart.draw(data, options); }; &lt;/script&gt; &lt;? } // end while ?&gt; Using this code, the map only outputs a single city from the array... I know I have missed something in the code, so please help... My question would be how to properly populate the google chart with the arrays I have queried? PS. I've read related questions on stackoverflow but they didn't help me with this …
has comment: http://stackoverflow.com/comment/44910455
has title: How to properly populate the Google Chart (Map) with arrays instead of values
answer count: 1
has comment: http://stackoverflow.com/comment/44910732
has comment: http://stackoverflow.com/comment/44910765

http://stackoverflow.com/comment/44690421
score: 0
comment on: http://stackoverflow.com/q/28159244
type: Comment
type: QuestionComment
has text: @NewDev Sorry if i was confusing, I am making an SPA that has one index page, that utilizes multiple modules. But I can't utilize the routes from each of these modules on my index view, as I can't have more than one module per view.

http://stackoverflow.com/a/28201231
type: Answer
score: 0
has body: $ngRoute is what you need to accomplish this. Here are ngRoute Docs
answers question: http://stackoverflow.com/q/28200889

http://stackoverflow.com/comment/44798286
type: QuestionComment
type: Comment
has text: @JoeButler if you take out the "g" modifier, it won't be strange anymore.
comment on: http://stackoverflow.com/q/28217372
score: 0

http://stackoverflow.com/comment/72480035
has text: Yep, that's what I basically do, just without the mocha-prepare module, I set it up manually.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/42671728

http://stackoverflow.com/comment/44911693
has text: Thank you @Ian. That is cool. How can we use the below code to round if there is any decimals?: if (dec || dec === 0) { if (dec > 1) dec = 1; else if (dec < 0) dec = 0; } else dec = false; function r(num) { if (dec !== false) return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); else return num; }
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28270661

http://stackoverflow.com/comment/44622403
comment on: http://stackoverflow.com/q/28124380
has text: Please always include the relevant code snippets you have written.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44651056
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28139365
has text: @songdogtech It appears to work in the fiddle you provided. http://jsfiddle.net/07bkgqvs/ It's worth pointing out that not all the `li` elements have the class `.not-click` as you can see, it was working for 2 of the elements.
score: 0

http://stackoverflow.com/a/28216521
type: AcceptedAnswer
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/28216483
accepted answer of: http://stackoverflow.com/q/28216483
has body: If you add the class "needsclick" to an element, then fastclick won't try and do its special magic. My El
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/44796351
has comment: http://stackoverflow.com/comment/44796316

http://stackoverflow.com/a/28128119
type: Answer
has body: jQuery method show works over display css property. It is equivalent to call .css( "display", "block"). Since you are using visibility property, method show has no effect on changing this so it remains hidden. I see 2 options to fix this: use .css( "visibility", "visible") instead of .show() replace style="visibility: hidden;" by style="display: none" on your input markup
has comment: http://stackoverflow.com/comment/44629585
score: 0
has comment: http://stackoverflow.com/comment/44629488
answers question: http://stackoverflow.com/q/28128001

http://stackoverflow.com/q/28229705
answer count: 1
tagged with: c#
has comment: http://stackoverflow.com/comment/44822395
tagged with: asp.net-mvc
has body: Can anyone tell me why this pics of code is not refreshing the view in every 1 sec @Html.DisplayNameFor(model => model.Employees.Name) @Html.DisplayNameFor(model => model.RequestTypes.RequestTypeName) @Html.DisplayNameFor(model => model.Comments) @Html.DisplayNameFor(model => model.Inserted_Date) Action @foreach (var item in Model) { @Html.DisplayFor(modelItem => item.Employees.Name) @Html.DisplayFor(modelItem => item.RequestTypes.RequestTypeName) @Html.DisplayFor(modelItem => item.Comments) @Html.DisplayFor(modelItem => item.Inserted_Date) @Html.ActionLink("Edit", "Edit", new { id = item.Id }) | @Html.ActionLink("Details", "Details", new { id = item.Id }) | @Html.ActionLink("Delete", "Delete", new { id = item.Id }) } @section Scripts { } Controller Action Method: // GET: RequestApprovals public async Task<ActionResult> Index() { var requestApprovals = db.RequestApprovals.Include(r => r.Employees).Include(r => r.RequestTypes); return View(await requestApprovals.ToListAsync()); } I have a _Layout.cshtml file in my shared folder if i use meta tag inside layout page it refresh all the view that use that _Layout.cshtml but i want only one view that contains above code should refresh. I tried above code but it is not working for me. please suggest me what i should do ?
has answer: http://stackoverflow.com/a/28230328
linked to: http://stackoverflow.com/q/2787679
downvote count: 0
has comment: http://stackoverflow.com/comment/44822281
tagged with: javascript
type: UnansweredQuestion
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44822367
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44822182
has title: Refresh a view in mvc
type: Question
has comment: http://stackoverflow.com/comment/44822257
favorite count: 0
has comment: http://stackoverflow.com/comment/44822322
upvote count: 1

http://stackoverflow.com/comment/44765110
score: 0
has text: Ya, i agree to u Matt.. We can include some user info too. As i understood the question, it's about sending unique number from web page to database. So i believe this approach should be suffice..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28199100

http://stackoverflow.com/q/28176613
downvote count: 2
has title: How can I customize Window.Confirm() dialog in Javascript?
upvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44722409
favorite count: 0
has comment: http://stackoverflow.com/comment/44722331
has body: var val= confirm("Are you sure to cancel?"); By default, the above line of code will bring a popup with two choices, Ok, Cancel and Ok will be the default choice. I want change the default choice to be Cancel and I would like to swap the both button's position. So Cancel will be displaying first and Ok comes later. How can I achieve this?
has comment: http://stackoverflow.com/comment/44722384
linked to: http://stackoverflow.com/q/6937761
has answer: http://stackoverflow.com/a/28176700
accepted answer: http://stackoverflow.com/a/28176700
has comment: http://stackoverflow.com/comment/44722347
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/6937761
type: Question
has comment: http://stackoverflow.com/comment/44722333
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44722441

http://stackoverflow.com/comment/44654223
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28141263
has text: I know you are unable to fetch the value of the list using PHP - I have looked an answer to this for hours on end with no result. If I'm correct it is possible using AJAX.
type: Comment

http://stackoverflow.com/q/28211915
tagged with: javascript
has body: I'm trying to connect the Google client API to display Google Analytics Data on my website. So i use this tutorial to try to connect the client API : https://developers.google.com/api-client-library/javascript/start/start-js i followed all the instructions, i made a OAuth Client on Google Developper Console. here my code : Authorize // Step 1: Load JavaScript client library but it dont work, and i have no idea of what is the problem, i get this error : 401. That’s an error. Error: invalid_client The OAuth client was not found. Request Details immediate=false response_type=token scope=https://www.googleapis.com/auth/plus.me redirect_uri=postmessage proxy=oauth2relay509775948 state=658721539|0.1255556678 origin=http://localhost include_granted_scopes=true client_id='MY SECRED KEY' authuser=0 That’s all we know. If anyone have a solution, it should be very nice ;) thanks in advance.
has answer: http://stackoverflow.com/a/28215857
has comment: http://stackoverflow.com/comment/44787990
has comment: http://stackoverflow.com/comment/44789237
answer count: 1
favorite count: 0
tagged with: oauth
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44788219
tagged with: google-analytics-api
has comment: http://stackoverflow.com/comment/44789187
tagged with: google-analytics
has title: OAuth Google Analytics Client API javascript
score: 1
upvote count: 1
type: Question
tagged with: google-client
downvote count: 0

http://stackoverflow.com/comment/44644530
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28136212
has text: but the value of name is not dynamically added when accessed in "mee" controller..

http://stackoverflow.com/comment/44779720
has text: provide full html and javascript code as validateFrm() is missing in JS
type: QuestionComment
comment on: http://stackoverflow.com/q/28206959
type: Comment
score: 0

http://stackoverflow.com/comment/44851803
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28242510
has text: This produced: GET http://127.0.0.1:3000/checkbox.json net::ERR_EMPTY_RESPONSE Also, the "npi_checks" is an historical relic was changed to "checkbox"
score: 0

http://stackoverflow.com/comment/44867044
has text: I really like this answer. Thank you. I love how many options programming provides to find solutions to the same problem.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28253707
type: Comment

http://stackoverflow.com/comment/44699132
score: 0
type: Comment
has text: ok so instead of listing the view we have to find inside the directive the view has been changed..?? With the help of $destroy.
comment on: http://stackoverflow.com/a/28164140
type: AnswerComment

http://stackoverflow.com/comment/44636428
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28131894
has text: IDs must be unique. I see you are doing a loop with the same IDs.
score: 0

http://stackoverflow.com/q/28169502
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/44708621
has answer: http://stackoverflow.com/a/28169578
accepted answer: http://stackoverflow.com/a/28169578
tagged with: javascript
tagged with: jquery
has title: Prevent image transparent inside a transparent div
upvote count: 3
answer count: 3
has comment: http://stackoverflow.com/comment/44708538
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has body: you can see my problem on this image : as you can see, the div is transparent and it effected the img es inside it . this is my html code: &lt;div id="cselect" style="position: absolute; top: 99px; left: 37px; display: block;"&gt; &lt;div class="cnvptr"&gt; &lt;img src="uploadfabrics/14606171783156.jpg" &gt; &lt;/div&gt; &lt;div class="cnvptr"&gt; &lt;img src="uploadfabrics/16292373497271.jpg" &gt;&lt;/div&gt; &lt;/div&gt; these are css codes: #cselect { padding: 15px; width: 90%; padding: 2%; background: black; opacity: 0.5; position: relative; } .cnvptr { background: black; opacity: 1 !important; width: auto; display: inline-block; } I put a div around each image with class cnvptr, it has black background but It doesn't work . How can I make image backgrounds not transparent? Thanks
has answer: http://stackoverflow.com/a/28170662
downvote count: 0
possible better answer: http://stackoverflow.com/a/28169611
type: Question
has answer: http://stackoverflow.com/a/28169611

http://stackoverflow.com/a/28140043
has body: You are looking for the modulo operator which returns the remainder of division. var x = val % 3; The only difference is that you'll want to add 3 to the value if it's 0 (as 3 % 3 == 0) var x = val % 3; if (val == 0) val = 3; You could make this code more generic / useful by using a function. function looped_number(number, limit) { var val = number % limit; if (val == 0) val = limit; return val; } You can also make the above code more concise by using the logical || operator. function looped_number(number, limit) { return number % limit || limit; }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44651758
accepted answer of: http://stackoverflow.com/q/28140010
type: Answer
answers question: http://stackoverflow.com/q/28140010
score: 2
upvote count: 3
downvote count: 1

http://stackoverflow.com/comment/44906431
type: AnswerComment
score: 0
type: Comment
has text: Well, strange, but I got the same result.
comment on: http://stackoverflow.com/a/28275723

http://stackoverflow.com/comment/44866750
score: 0
type: Comment
type: QuestionComment
has text: It was suggested by a friend, I don't really understand how it helps @poke
comment on: http://stackoverflow.com/q/28254023

http://stackoverflow.com/a/28260919
type: AcceptedAnswer
has body: to save session to server you need to convert it to plain object which can be passed to json.Stringify. session="+ editor.session in your example simply calls session.toString which is same as session.getValue var filterHistory = function(deltas){ return deltas.filter(function (d) { return d.group != "fold"; }); } sessionToJSON = function(session) { return { selection: session.selection.toJSON(), value: session.getValue(), history: { undo: session.$undoManager.$undoStack.map(filterHistory), redo: session.$undoManager.$redoStack.map(filterHistory) }, scrollTop: session.getScrollTop(), scrollLeft: session.getScrollLeft(), options: session.getOptions() } } sessionFromJSON = function(data) { var session = require("ace/ace").createEditSession(data.value); session.$undoManager.$doc = session; // workaround for a bug in ace session.setOptions(data.options); session.$undoManager.$undoStack = data.history.undo; session.$undoManager.$redoStack = data.history.redo; session.selection.fromJSON(data.selection); session.setScrollTop(data.scrollTop); session.setScrollLeft(data.scrollLeft); return session; }; now to get state of the session do var session = editor.session var sessionData = sessionToJSON(session) $.ajax({ type: "POST", url: "aaaaa.php", cache: false, timeout: 10000, data: JSON.stringify(sessionData) }); and to restore it from the server var session = sessionFromJSON(JSON.parse(ajaxResponse)) editor.setSession(session)
upvote count: 9
has comment: http://stackoverflow.com/comment/44883242
answers question: http://stackoverflow.com/q/28257566
has comment: http://stackoverflow.com/comment/93612926
type: Answer
has comment: http://stackoverflow.com/comment/44880076
accepted answer of: http://stackoverflow.com/q/28257566
downvote count: 0
has comment: http://stackoverflow.com/comment/44884515
has comment: http://stackoverflow.com/comment/44883447
has comment: http://stackoverflow.com/comment/93593972
score: 9
has comment: http://stackoverflow.com/comment/44879335
has comment: http://stackoverflow.com/comment/44879326
has comment: http://stackoverflow.com/comment/44879233

http://stackoverflow.com/q/28134281
has answer: http://stackoverflow.com/a/28134921
has comment: http://stackoverflow.com/comment/44641407
tagged with: string
favorite count: 0
tagged with: string-formatting
tagged with: regex
has body: I'm completely new to regular expressions in JavaScript and this is probably the first time I'm using it, I wanted to know how to get the values before and after a colon or hash and store their values into a variables like this: var str = 'name[:|#]result'; // before and after values var trigger = 'name'; var value = 'result'; // logs: name result console.log(trigger + ' ' + value);
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28134921
has title: JavaScript regular expressions anything before match
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28134295
type: Question
has comment: http://stackoverflow.com/comment/44640832
tagged with: javascript
has answer: http://stackoverflow.com/a/28134295
score: 0
answer count: 2

http://stackoverflow.com/comment/44802495
has text: I have been using the whatsapp web app, and the recording indicator has gone after I finish my recording. :(
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28218554
score: 1

http://stackoverflow.com/a/28246229
has comment: http://stackoverflow.com/comment/44854001
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28245795
type: Answer
has body: Any function, when called, will introduce a new scope, in this case, when Machine gets called at your line Machine.apply(this, arguments), you're introducing a new scope. Every and any function defined inside that scope will have access to every variables inside their own scope, and the outer scope (variables defined inside Machine) So technically, CoffeeMachine doesn't have access to self, Machine's enable and disable functions do however, and CoffeeMachine has access to those functions.

http://stackoverflow.com/a/28150094
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28150035
answers question: http://stackoverflow.com/q/28150035
type: Answer
has body: Wrong Typo: It is "center" and not "centre". html5 canvas text canvas text Your browser does not support the canvas element.
score: 0

http://stackoverflow.com/a/28168811
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28168259
has body: Prototype object has a built in property called constructor.First see this image from chorme console than i will discuss In your code B.prototype = new A(); =>this statement sets B's prototype to a instance of A.So B's prototype object has it's constructor property assigned to A(); console.log(userObj.constructor // it will show A.But it is not true Remember it is not userObj's constructor.The constructor you get is from prototype obj. console.log(userObj instanceof A); // true, How this can be true? As userObj is a instance of B.And B inherits from A.So userObj is also a instance of A.But you can manipulate the constructor property set to B using B.prototype.constructor=B;
upvote count: 1
score: 1

http://stackoverflow.com/comment/45302583
has text: @David I tried that and it didn't work :(
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28166833

http://stackoverflow.com/q/28153317
tagged with: javascript
has comment: http://stackoverflow.com/comment/44679971
answer count: 1
has body: I know this question has been asked multiple times on SO, but I couldn't find any answer I've got a directive that is responsible of file uploads. Here is the code of my directive : var directive = { restrict: 'AE', scope: { settings: '=' }, controller: 'fileUploaderCtrl', replace: true, template: ' \ \ Uploads in progress \ \ KB\ {{file.sizeUploaded()}}\ \ \ \ \ \ \ \ \ \ \ \ ' } [...] And into my controller, I have the following code : $scope.remove = function (index) { debugger; $scope.selectedFiles.splice(index, 1); $scope.sendUpdatedModel(); } What I've tried : As far as my ng-click is inside a ng-repeat, I was wondering if it was not related to scope inheritance. I've tried this, with the same results (working in chrome but not in firefox) ng-click="$parent.remove($index)" I've also modified the controller function that way : function remove(index) { $scope.selectedFiles.splice(index, 1); $scope.sendUpdatedModel(); } $scope.remove = remove; It was also working on chrome, but not in firefox note that I don't have any error in the console. At this point, I have no idea what I can check/do to understand this bug
has title: ng-click not working in firefox
favorite count: 0
has comment: http://stackoverflow.com/comment/44679509
tagged with: angularjs
score: 6
has answer: http://stackoverflow.com/a/28154366
accepted answer: http://stackoverflow.com/a/28154366
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/44679778
tagged with: firefox
upvote count: 6

http://stackoverflow.com/comment/44682885
type: Comment
type: QuestionComment
has text: I have great success with this, http://www.datatables.net/ - it's open source and I am not affiliated with them in any way so I dont think this is spam.
comment on: http://stackoverflow.com/q/28155805
score: 0

http://stackoverflow.com/comment/44634784
type: Comment
comment on: http://stackoverflow.com/a/28131078
has text: I want to run function after I add new object from pts to test
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44737175
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28183686
has text: In other words, I forgot to specify that I needed the column names above each column.
type: AnswerComment

http://stackoverflow.com/comment/44894122
has text: @AtikurRahman, did you understand the answer? Did it address your question?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28243563

http://stackoverflow.com/comment/47314772
type: QuestionComment
has text: Did you try to add the viewSwitcher to your gallery view with different query hook?
comment on: http://stackoverflow.com/q/28212862
score: 0
type: Comment

http://stackoverflow.com/a/28250600
score: 6
answers question: http://stackoverflow.com/q/28250520
has body: Try this, HTML JavaScript function onChangeTest(textbox) { console.log("New value: " + textbox.value + "\n" + "Old value: " + textbox.oldvalue); } Reference
downvote count: 0
type: Answer
upvote count: 6

http://stackoverflow.com/a/28228866
accepted answer of: http://stackoverflow.com/q/28228731
downvote count: 0
has body: First some syntax error var isVisible[i] = true; nope, to declaring an array you cannot do this. Furthermore, I think you want only one isVisible array instance across the loop. So I think you should do this var isVisible = []; for(var i = 0; i&lt;LEDs.length; i++){ isVisible[i] = true; Next is a common trap about closure. You create a closure as event listener on click. However, the i captured by the closure is bound to the context of the for-loop. In other words, i in the closure will change as i changes in the loop. So you need to define other factory function to limit the context of i, or to fix it. function createListener(i) { return function (evt){ if(isVisible[i]){ contents[i].classList.add('hidden'); isVisible[i] = false; }else{ contents[i].classList.remove('hidden'); isVisible[i] = true; } }; } Here's a working one. http://jsfiddle.net/vnbwmbL7/
has comment: http://stackoverflow.com/comment/44820761
answers question: http://stackoverflow.com/q/28228731
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28237957
type: Answer
has comment: http://stackoverflow.com/comment/44837161
has body: Just add opacity: 0; to the initial element and opacity: 1; to the animation. However, you need to retain the opacity after the animation ends. So the animation-fill-mode: forwards; comes to help. Update: using transform: translate(100%); thanks to @Luca Detomi Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode ONE TWO THREE
has comment: http://stackoverflow.com/comment/44838978
score: 0
has comment: http://stackoverflow.com/comment/44840811
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28237667
answers question: http://stackoverflow.com/q/28237667

http://stackoverflow.com/comment/44771293
score: 0
type: Comment
has text: ouch getting an error like that `Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: []`
type: AnswerComment
comment on: http://stackoverflow.com/a/28189050

http://stackoverflow.com/comment/44693664
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28161169
has text: First line is css of jQuery UI.You can load it anywhere.
type: AnswerComment

http://stackoverflow.com/q/28217125
possible better answer: http://stackoverflow.com/a/28217166
favorite count: 0
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28217529
has comment: http://stackoverflow.com/comment/44797795
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44797757
tagged with: alert
linked to: http://stackoverflow.com/q/988363
has body: I have the below section of code where I want to display how many orders have been added if conditions of the $orderstat are met. The alert works but not with the $orderstat variable inside it. Can anyone see what I am doing wrong? Thanks in advance! session_start(); $orderstat = $_SESSION['orderstat']; if ( $orderstat == "1" || $orderstat == "2" || $orderstat == "3" || $orderstat == "4") { echo '&lt;script language="javascript"&gt;'; **echo 'alert('&lt;?php echo $orderstat; ?&gt;' + "order/s successfully added to Job")';** echo '&lt;/script&gt;'; } session_destroy();
score: -1
accepted answer: http://stackoverflow.com/a/28217529
has answer: http://stackoverflow.com/a/28217166
has title: Javascript alerts and using php variables in javascript
answer count: 2
upvote count: 0
tagged with: javascript

http://stackoverflow.com/a/57682075
upvote count: 11
score: 11
has body: Updated Originally, I implemented Kangax's solution using regex, however, as several pointed out, there were some false positives and gotcha situations, indicating that we need a slightly more thorough approach. With that in mind, I took a moment to look through the latest ES spec to work out a complete method. In the following exclusionary solution, we detect syntax for all non-arrow functions which have the function JS type. We also ignore comments and line breaks, which accounts for the bulk of the regex. Provided the JS engine conforms to ES spec, the following should work in all scenarios: /** Check if function is Arrow Function */ const isArrowFn = (fn) =&gt; (typeof fn === 'function') &amp;&amp; !/^(?:(?:\/\*[^(?:\*\/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*(?:(?:(?:async\s(?:(?:\/\*[^(?:\*\/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*\s*)?function|class)(?:\s|(?:(?:\/\*[^(?:\*\/)]*\*\/\s*)|(?:\/\/[^\r\n]*))*)|(?:[_$\w][\w0-9_$]*\s*(?:\/\*[^(?:\*\/)]*\*\/\s*)*\s*\()|(?:\[\s*(?:\/\*[^(?:\*\/)]*\*\/\s*)*\s*(?:(?:['][^']+['])|(?:[&quot;][^&quot;]+[&quot;]))\s*(?:\/\*[^(?:\*\/)]*\*\/\s*)*\s*\]\())/.test(fn.toString()); /* Demo */ const fn = () =&gt; {}; const fn2 = function () { return () =&gt; 4 } isArrowFn(fn) // True isArrowFn(fn2) // False Problem? If you have any issues, leave me a comment, and I'll work out a revised solution. Be sure to leave a comment under this answer, however. I don't monitor this page, so I won't see it if you say something doesn't work as a separate answer.
has comment: http://stackoverflow.com/comment/123789180
has comment: http://stackoverflow.com/comment/126898309
downvote count: 0
answers question: http://stackoverflow.com/q/28222228
has comment: http://stackoverflow.com/comment/126878202
type: Answer
has comment: http://stackoverflow.com/comment/123894478

http://stackoverflow.com/comment/44624151
has text: I'm sorry to bother again, but I am still looking for some other details to completely mimic *Fiddle 1* some more. --- The legend can be removed by adding `enabled:false,` inside `legend: {`...`}`, the title can be removed by changing the text in `title: {`...`}` to `text: '',` the x-axis name can be removed by changing the text in `yAxis: {`...`}` to `text: '',`. --- But I haven't found out how to remove the **x-axis measure numbers** below the chart. Neither how to remove the **y-axis name** "*Fruits*", since this seems coupled with the series name on mousehover (which I want to keep).
type: Comment
comment on: http://stackoverflow.com/a/28125065
type: AnswerComment
score: 0

http://stackoverflow.com/q/28228432
possible better answer: http://stackoverflow.com/a/28228541
answer count: 4
has answer: http://stackoverflow.com/a/28228541
has comment: http://stackoverflow.com/comment/44819935
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44820197
accepted answer: http://stackoverflow.com/a/28228529
has body: The following is the code function add() { var counter = 0; this.num = 0; function plus (){ return counter +=1;} plus(); return counter; } console.log(add.num); //outputs :undefined Function name can be treated as reference of a function object, so the num is the property of add function object, the outputs could have been 0. But the result is not like so, why? If i change the code to: function add() { var counter = 0; this.num = 0; function plus (){ return counter +=1;} plus(); return counter; } var obj = new add(); console.log(obj.num); //outputs : 0 it works correctly. Can anyone explain this? Many many many thanks.
type: Question
has comment: http://stackoverflow.com/comment/44819996
has comment: http://stackoverflow.com/comment/44819953
has answer: http://stackoverflow.com/a/28228987
has comment: http://stackoverflow.com/comment/44820164
tagged with: javascript
has title: Why cannot use function name to retrieve property in JavaScript?
score: 0
linked to: http://stackoverflow.com/q/3127429
has comment: http://stackoverflow.com/comment/44820198
has comment: http://stackoverflow.com/comment/44820188
has answer: http://stackoverflow.com/a/28228529
has comment: http://stackoverflow.com/comment/44819931
has comment: http://stackoverflow.com/comment/44820228
has answer: http://stackoverflow.com/a/28228472

http://stackoverflow.com/comment/44913323
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28278251
has text: Removing the while loop stops the javascript from changing the content in all browsers
score: 0

http://stackoverflow.com/comment/44797208
score: 1
has text: @Stack0verflow: Yes it is, because it would be privileged to access the constructor's local `name` *variable* directly (not only the "public" `.name` property)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28216666

http://stackoverflow.com/comment/44860209
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28250150
has text: @T.J.Crowder, ah yes, it is an element. In general the code looks problematic.

http://stackoverflow.com/comment/44619115
has text: dataTables has nothing to do with bootstrap . Use `columns.render` ...numerous approaches here https://datatables.net/reference/option/columns.render
comment on: http://stackoverflow.com/q/28122503
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28144896
downvote count: 0
answers question: http://stackoverflow.com/q/28144740
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28144740
score: 2
has body: You could use a regex to match valid class names starting with fa-. //A string you want to extract the classes from. var exampleString = 'fa-deviantart[]fa-diamond[]'; //Extract the class names using a regex into an array. var classList = exampleString.match(/fa\-[a-zA-Z0-9\-_]*/g); //Create a new string from the array of matched classes. alert(classList.join(' '));

http://stackoverflow.com/q/28204637
upvote count: 2
accepted answer: http://stackoverflow.com/a/28204713
has answer: http://stackoverflow.com/a/28204773
has comment: http://stackoverflow.com/comment/44775726
has comment: http://stackoverflow.com/comment/44776965
has title: Why would one not put CSS directly into HTML?
possible better answer: http://stackoverflow.com/a/28204820
has comment: http://stackoverflow.com/comment/44776994
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28204820
has answer: http://stackoverflow.com/a/28204980
has comment: http://stackoverflow.com/comment/44775160
score: 1
has comment: http://stackoverflow.com/comment/44775213
answer count: 6
has comment: http://stackoverflow.com/comment/44775246
has comment: http://stackoverflow.com/comment/44786754
has comment: http://stackoverflow.com/comment/44775182
has comment: http://stackoverflow.com/comment/44799906
has body: Situation: I have a website that is served dynamically. In order to optimize the website's speed, all the CSS and javascript is put directly into the HTML document. Pros: It cuts back on web requests Less files need to be downloaded Faster webpage download Cons: Possible caching issue So apart from the caching part, is there a reason not to do this?
has answer: http://stackoverflow.com/a/28204713
tagged with: javascript
has comment: http://stackoverflow.com/comment/44776812
has comment: http://stackoverflow.com/comment/44775178
favorite count: 0
has answer: http://stackoverflow.com/a/28204791
has answer: http://stackoverflow.com/a/28204694
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44775177
tagged with: css
has comment: http://stackoverflow.com/comment/44786230
has comment: http://stackoverflow.com/comment/44775202
type: AnsweredQuestion

http://stackoverflow.com/a/28236938
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28236889
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4
has body: You're not referencing this correctly in the function. You need to wrap it with $() to turn it into a jQuery object, both to set css and get the height... $(function() { var staticOffset = 66; var previousHeight = null; // initialization $(".timeline-tidy li").each(function() { if (previousHeight) { // exclude the first element var heightOffset = previousHeight - staticOffset; $(this).css('margin-top', heightOffset * -1); // negative margin } previousHeight = $(this).height(); }); }); However, since you're doing it more than once I'd recommend creating a local reference to it, like this... $(function() { var staticOffset = 66; var previousHeight = null; // initialization $(".timeline-tidy li").each(function() { var $this = $(this); if (previousHeight) { // exclude the first element var heightOffset = previousHeight - staticOffset; $this.css('margin-top', heightOffset * -1); // negative margin } previousHeight = $this.height(); }); });
answers question: http://stackoverflow.com/q/28236889

http://stackoverflow.com/a/28278889
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28278726
has body: How can you move uploaded file, which is on server with Javascript, which runs on client's machine? No, you can't do that.
score: 0
has comment: http://stackoverflow.com/comment/44991442
has comment: http://stackoverflow.com/comment/44993782
type: Answer

http://stackoverflow.com/comment/44776412
type: Comment
comment on: http://stackoverflow.com/a/28204372
has text: You can't declare random variables there, you're in the middle of an object's definition.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44852245
type: AnswerComment
type: Comment
has text: @KTE, you can also review the [SO Tag Wiki page](http://stackoverflow.com/tags/jquery-validate/info) for all the links and basic info, not to mention looking at the code in [the thousands of other SO questions tagged with jQuery Validate](http://stackoverflow.com/search?q=%5Bjquery-validate%5D+hasaccepted%3Ayes).
comment on: http://stackoverflow.com/a/28245378
score: 0

http://stackoverflow.com/q/28134186
tagged with: javascript
has title: Ruby on Rails: how to set size of number_field
has comment: http://stackoverflow.com/comment/44640861
has answer: http://stackoverflow.com/a/28134198
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/44640763
answer count: 4
has body: Could someone show me how to set the size of number_field in rails? I tried this but it doesn't work: &lt;%= f.number_field :status, size: "10", ... but this works: &lt;%= f.text_field :name, size: "10", ... Thanks
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28134198
has answer: http://stackoverflow.com/a/58664951
possible better answer: http://stackoverflow.com/a/54430039
score: 16
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/54430039
downvote count: 1
has comment: http://stackoverflow.com/comment/44640903
has comment: http://stackoverflow.com/comment/44640874
has answer: http://stackoverflow.com/a/77242740
upvote count: 17
type: Question

http://stackoverflow.com/comment/44695667
comment on: http://stackoverflow.com/q/28162210
type: Comment
type: QuestionComment
score: 1
has text: have you tried wrapping it in doc ready then?.....

http://stackoverflow.com/comment/44805859
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69840/discussion-between-user2242044-and-pawel-psztyc).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28220721

http://stackoverflow.com/comment/44886918
has text: The full ISO8601 format (IIRC) is expecting a capital letter "T" in between the date and time portions of that string.
comment on: http://stackoverflow.com/q/28265145
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28223899
answers question: http://stackoverflow.com/q/28223423
has body: Install Emmet plugin "emmet-sublume" for sublime text: https://github.com/sergeche/emmet-sublime then use the following keyboard sequence: ⇧⌃T / Ctrl+Alt+J More emmet shortcut keys can be find here Emmet website: http://emmet.io/
score: 1
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/28183463
answers question: http://stackoverflow.com/q/28183051
has comment: http://stackoverflow.com/comment/44736388
upvote count: 1
has comment: http://stackoverflow.com/comment/44736406
has body: Not sure that you really need filter for this, is fairly easy to this calc without one: Your #1 price:
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44736417
type: Answer
has comment: http://stackoverflow.com/comment/44736453

http://stackoverflow.com/comment/44786651
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28211152
has text: This may work, however, when the user has a textarea on their site for let's say a newsletter or something, users cannot fill in their email to subscribe, because your function will focus the wrong element all the time.

regex
tags question: http://stackoverflow.com/q/28197170
tags question: http://stackoverflow.com/q/28126345
tags question: http://stackoverflow.com/q/28232582
tags question: http://stackoverflow.com/q/28231558
tags question: http://stackoverflow.com/q/28209989
tags question: http://stackoverflow.com/q/28171802
tags question: http://stackoverflow.com/q/28248747
tags question: http://stackoverflow.com/q/28184385
tags question: http://stackoverflow.com/q/28129272
tags question: http://stackoverflow.com/q/28143125
tags question: http://stackoverflow.com/q/28262347
tags question: http://stackoverflow.com/q/28128474
tags question: http://stackoverflow.com/q/28254572
tags question: http://stackoverflow.com/q/28226852
tags question: http://stackoverflow.com/q/28263005
tag name: regex
tags question: http://stackoverflow.com/q/28197581
tags question: http://stackoverflow.com/q/28142938
tags question: http://stackoverflow.com/q/28226233
tags question: http://stackoverflow.com/q/28217372
tags question: http://stackoverflow.com/q/28127794
tags question: http://stackoverflow.com/q/28159867
tags question: http://stackoverflow.com/q/28227482
tags question: http://stackoverflow.com/q/28136553
tags question: http://stackoverflow.com/q/28145458
tags question: http://stackoverflow.com/q/28123447
tags question: http://stackoverflow.com/q/28263709
tags question: http://stackoverflow.com/q/28134281
tags question: http://stackoverflow.com/q/28249138
tags question: http://stackoverflow.com/q/28220273
tags question: http://stackoverflow.com/q/28207513
tags question: http://stackoverflow.com/q/28266598
tags question: http://stackoverflow.com/q/28256958
tags question: http://stackoverflow.com/q/28168844
tags question: http://stackoverflow.com/q/28187300
tags question: http://stackoverflow.com/q/28188807
tags question: http://stackoverflow.com/q/28133845
tags question: http://stackoverflow.com/q/28230080
tags question: http://stackoverflow.com/q/28212368
tags question: http://stackoverflow.com/q/28170141
tags question: http://stackoverflow.com/q/28176592
tags question: http://stackoverflow.com/q/28202748
tags question: http://stackoverflow.com/q/28173263
tags question: http://stackoverflow.com/q/28139371
tags question: http://stackoverflow.com/q/28185680
tags question: http://stackoverflow.com/q/28260659
tags question: http://stackoverflow.com/q/28226830
tags question: http://stackoverflow.com/q/28142292
tags question: http://stackoverflow.com/q/28193633
tags question: http://stackoverflow.com/q/28167107
tags question: http://stackoverflow.com/q/28163149
tags question: http://stackoverflow.com/q/28265580
tags question: http://stackoverflow.com/q/28226851
tags question: http://stackoverflow.com/q/28183907
tags question: http://stackoverflow.com/q/28273684
tags question: http://stackoverflow.com/q/28271771
tags question: http://stackoverflow.com/q/28262715
tags question: http://stackoverflow.com/q/28232987
tags question: http://stackoverflow.com/q/28136301
tags question: http://stackoverflow.com/q/28195451
tags question: http://stackoverflow.com/q/28251992
tags question: http://stackoverflow.com/q/28248960
tags question: http://stackoverflow.com/q/28236586
tags question: http://stackoverflow.com/q/28126797
tags question: http://stackoverflow.com/q/28240940
tags question: http://stackoverflow.com/q/28123438
tags question: http://stackoverflow.com/q/28142246
tags question: http://stackoverflow.com/q/28123552
tags question: http://stackoverflow.com/q/28212542
tags question: http://stackoverflow.com/q/28221031
tags question: http://stackoverflow.com/q/28264361
tags question: http://stackoverflow.com/q/28144740
tags question: http://stackoverflow.com/q/28204074
tags question: http://stackoverflow.com/q/28186270
tags question: http://stackoverflow.com/q/28135072
tags question: http://stackoverflow.com/q/28204183
tags question: http://stackoverflow.com/q/28225522
tags question: http://stackoverflow.com/q/28216952
tags question: http://stackoverflow.com/q/28161069
tags question: http://stackoverflow.com/q/28194897

http://stackoverflow.com/q/28199258
type: Question
has comment: http://stackoverflow.com/comment/44765186
tagged with: javascript
tagged with: asp.net
answer count: 3
has answer: http://stackoverflow.com/a/28199475
has title: How to pass parameters from Aspx to Javascript
linked to: http://stackoverflow.com/q/7047191
has answer: http://stackoverflow.com/a/28211258
possible better answer: http://stackoverflow.com/a/28199418
has answer: http://stackoverflow.com/a/28199418
score: 0
has body: My question is quite simple, I have a website developed in Asp.Net. I wan't to pass a parameter from server (aspx file) to client (javascript file). Lets say I have a asp:Button, and when OnClientClick event fires I want to call javascript function with parameter from the server. Let simplify the example, and lets say this is my webpage: div text here... <asp:Button runat="server" text="click1" OnClientClick='<%= "alert(" + this.divID.ClientID + "); return false;" %>' /> <asp:Button runat="server" text="click2" OnClientClick="alert('<%= this.divID.ClientID %>'); return false;" /> The first button throw an client side error. The 2nd button alert the string "<%= this.divID.ClientID %>" and not the actual value. What I'm missing??
type: AnsweredQuestion
tagged with: c#
has comment: http://stackoverflow.com/comment/44765193
accepted answer: http://stackoverflow.com/a/28211258

http://stackoverflow.com/q/28208512
tagged with: ios
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/47220012
tagged with: javascript
favorite count: 0
has title: How to get the connected wifi network name
has body: I have build hybrid application for IPAD, using cordova. I need to get the name of connected current wifi network. I have gone through couple of plugins of cordova which couldn't help me out. Can anyone let me know how to achieve this by cordova plugin or javascript plugin.
has comment: http://stackoverflow.com/comment/78972700
tagged with: objective-c
linked to: http://stackoverflow.com/q/10967511
upvote count: 12
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/31182536
type: Question
linked to: http://stackoverflow.com/q/5198716
score: 12
has comment: http://stackoverflow.com/comment/44781790

http://stackoverflow.com/comment/96167245
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/33310429
has text: Excellent work ! Thx. In my case i refer to ```https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js``` therefore to be able to connect to my websocket i just used ```var url = 'http://localhost:8080'; var socket = io.connect(url,connectionOptions);``` and got my Status 101 =)
score: 1

http://stackoverflow.com/comment/44802238
type: AnswerComment
has text: I've edited my answer with the way I use $resource inside a factory and $q. I hope it will suit you.
comment on: http://stackoverflow.com/a/28218972
type: Comment
score: 0

http://stackoverflow.com/comment/44792808
type: AnswerComment
score: 0
type: Comment
has text: In your example, why does it work when you add [] in the second parameter in module but when I remove it doesn't work?
comment on: http://stackoverflow.com/a/28214413

http://stackoverflow.com/a/28236116
has body: if you can access the store you can simply do the following. var gridList= store.query(); console.log(JSON.stringify(gridList)); if you can show me more code i can help you more.
has comment: http://stackoverflow.com/comment/44841613
score: 1
has comment: http://stackoverflow.com/comment/44842639
accepted answer of: http://stackoverflow.com/q/28235082
has comment: http://stackoverflow.com/comment/44841305
has comment: http://stackoverflow.com/comment/44840091
has comment: http://stackoverflow.com/comment/44903076
has comment: http://stackoverflow.com/comment/44836263
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28235082
type: Answer
has comment: http://stackoverflow.com/comment/44838810
has comment: http://stackoverflow.com/comment/44836164
has comment: http://stackoverflow.com/comment/44838529
has comment: http://stackoverflow.com/comment/44836066
upvote count: 1
has comment: http://stackoverflow.com/comment/44836432

http://stackoverflow.com/comment/44664667
comment on: http://stackoverflow.com/q/28146402
score: 0
has text: hmmm, feel strange that even if your php is not called, those are variables, how can the error be "undefined function"?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44701694
has text: @Tomalak: I felt that I have placed the problematic area. Should I put code for other files here or lesser??
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28165606
type: QuestionComment

http://stackoverflow.com/comment/44944190
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28262274
has text: Do you mean `api` config of proxy ? see http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.proxy.Rest-cfg-api

http://stackoverflow.com/comment/44830877
score: 0
comment on: http://stackoverflow.com/a/28233146
has text: I am trying to learn thats why clearing my doubts. so you mean $(linkshref[i]) is fetching contentid
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/44762183
type: AnswerComment
comment on: http://stackoverflow.com/a/28197863
type: Comment
has text: Why split by `=` if you're doing nothing but joining them back together by `=`?
score: 1

http://stackoverflow.com/comment/44785543
score: 0
comment on: http://stackoverflow.com/a/28197645
type: Comment
type: AnswerComment
has text: I add console.log("end of jquery") at the end of jquery file,it work (pirnt at console of web page) but jquery's method can't use

http://stackoverflow.com/q/28228284
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28228888
upvote count: 1
type: Question
has body: I am using highcharts and jquery to create a dynamically updating graph. I'd like to pull in the peak value that is visible on the graph into a html table, but am not sure how I would do this and am looking for some help on this. I've created a JSFiddle file at: http://jsfiddle.net/s9kmsygn/
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28228888
tagged with: highcharts
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
has title: using dynamic data from highcharts in a html table

http://stackoverflow.com/a/28123979
has body: You have some typos, here is corrected. Also don't forget to initialize units_html if you didn't do it: for (i = 0; i &lt; num_units; i++) { units_html += '&lt;tr&gt;&lt;td&gt;&lt;input type="text" name="unit_name'+ i + '"&lt;/td&gt;&lt;/tr&gt;'; } for (i = 0; i &lt; num_units; i++) { units_html += "&lt;tr&gt;&lt;td&gt;&lt;input type='text' name='unit_name'" + i + "&gt;&lt;/td&gt;&lt;/tr&gt;"; }
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28123945
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28123945
has comment: http://stackoverflow.com/comment/44621584

http://stackoverflow.com/a/28149252
has comment: http://stackoverflow.com/comment/44670590
accepted answer of: http://stackoverflow.com/q/28149196
has comment: http://stackoverflow.com/comment/44670342
has comment: http://stackoverflow.com/comment/44670238
has comment: http://stackoverflow.com/comment/44670164
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44670293
has comment: http://stackoverflow.com/comment/44669901
has comment: http://stackoverflow.com/comment/44670280
type: Answer
score: 11
has comment: http://stackoverflow.com/comment/44670133
has body: In the first case, true is type converted to numeric 1 and compared to 23. Obviously 1 != 23 even though both 1 and 23 would evaluate to true. In the second, !23 is evaluated to false, then !false is evaluated as true and that is == true. The trick is that the type conversion goes from boolean to numeric even though it should intuitively be the other way around.
upvote count: 11
has comment: http://stackoverflow.com/comment/44670048
answers question: http://stackoverflow.com/q/28149196
has comment: http://stackoverflow.com/comment/44670097
has comment: http://stackoverflow.com/comment/44670076

http://stackoverflow.com/a/28261714
has comment: http://stackoverflow.com/comment/44881348
has comment: http://stackoverflow.com/comment/44891218
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44891232
score: 0
has comment: http://stackoverflow.com/comment/44894798
has body: When you add the marker by using the var-keyword the variable will not be accessible later, the call of setMap fails(and stops the further script-execution) because of the undefined variable. Example using a single marker(marker will be stored as property of the map): google.maps.event.addListener(map, "click", function(event) { //closure for the map var that=this; //only create a single marker if(!this.marker){ var input = document.getElementById("location_name"); this.marker = new google.maps.Marker({draggable:true,title:input.value}); google.maps.event.addListener(this.marker,'dblclick',function(){ this.setMap(null); }); //update title google.maps.event .addDomListener(input, 'change', function(){ that.marker.setTitle(this.value); } ); } //update position this.marker.setOptions({map : this, position : event.latLng }); });
answers question: http://stackoverflow.com/q/28261525
accepted answer of: http://stackoverflow.com/q/28261525
type: Answer
has comment: http://stackoverflow.com/comment/44880703
has comment: http://stackoverflow.com/comment/44880948

http://stackoverflow.com/comment/44849790
has text: @indubitablee rip from the dom...code remains meaning if you view source, you can see everything in the hidden div.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28243923

http://stackoverflow.com/comment/45059133
has text: it is update [jsfiddle](http://jsfiddle.net/jfabfab/u6aej3Lf/5/) for you to play with. I have also posted an answer with a few tips
comment on: http://stackoverflow.com/a/28184041
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44857489
type: Comment
has text: I've updated my `checkUser.js` already. However, returning a false value doesn't stop the web page from going to `StaffRegAuth.jsp`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28238745

access-control
tag name: access-control
tags question: http://stackoverflow.com/q/28217900
type: Tag

http://stackoverflow.com/comment/44711039
comment on: http://stackoverflow.com/a/28170542
has text: This looks good. Never seen `Connections` around, I'll look into that, thanks!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28126772
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/44626596
tagged with: angularjs
linked to: http://stackoverflow.com/q/24901104
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44628563
answer count: 0
type: Question
has title: View per model/scope object - ui-router / angularjs
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/44626580
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44626537
has body: Is it possible to have a view per model , ie an edit view for an item, and only that view to be shown for this specific model? I have a list of tasks, like a todo list. When I click an add button I want an edit view to be shown only for that list and not for every other list I have. Sorry for my English and possible ignorance on terminology. I am new to Angularjs My code: index.html {{list.name}} {{task.description}} {{task.completed}} {{task.priority_id}} app.js $stateProvider.state('home', { url: '/', templateUrl: 'views/home.html', controller: 'HomeCtrl', resolve: { notes: ['NotesLoader', function(NotesLoader){ return NotesLoader(); }], lists: ['ListsLoader', function(ListsLoader){ return ListsLoader(); }] } }); $stateProvider.state('home.newTask', { url: 'list/:id/task/create', views: { 'newTask@home': { templateUrl: 'views/home.newTask.html', controller: 'NewTaskCtrl' } } }); With this code when I click to add a new task the newTask view will be shown on every list and not on the list I clicked. That's to be expected because inside to my ng-repeat I have so when I go to newTask state every ui-view with the name newTask will be shown. Is there any way to achieve it only for the model that's was clicked ?

http://stackoverflow.com/comment/44787825
has text: @JamesDonnelly i explained the changes.thanks dude :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28211664
type: Comment

http://stackoverflow.com/a/29078198
accepted answer of: http://stackoverflow.com/q/28177568
answers question: http://stackoverflow.com/q/28177568
type: AcceptedAnswer
downvote count: 0
score: 9
type: Answer
has body: You're using a Material Bar chart (See the relevant documentation here.) See the comment at the end of the documentation paragraph : The Material Charts are in beta. The appearance and interactivity are largely final, but the way options are declared is not. If you are converting a Classic Bar Chart to a Material Bar Chart, you'll want to replace this line: chart.draw(data, options); ...with this: chart.draw(data, google.charts.Bar.convertOptions(options)); So if you want your standard options taken into account you need to wrap them with google.charts.Bar.convertOptions(). Have a try, it works great. See a jsfiddle of it here.
upvote count: 9

http://stackoverflow.com/q/28156249
has answer: http://stackoverflow.com/a/28156808
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44685747
has comment: http://stackoverflow.com/comment/44683798
score: 1
has comment: http://stackoverflow.com/comment/44685433
tagged with: media-queries
has comment: http://stackoverflow.com/comment/44683781
has body: The Code below is for a header that expands and shrinks accordingly based on scrolling position. The script itself is fine, but in the mobile version the expansion feature isn't necessary, so I was wanting to disable this based on screen size, similarly to how css can be changed and disabled with media-queries. I was wanting to disable the execution of this code based on screen size: $(document).ready(function() { var pageWidth = $(window).width(); var scroll = getCurrentScroll(); var shrinkHeader = 300; $(window).scroll(function() { var scroll = getCurrentScroll(); if ( pageWidth &gt; 800 &amp;&amp; scroll &gt;= shrinkHeader ) { $('.nav_container').addClass('shrink'); } else { $('.nav_container').removeClass('shrink'); } }); function getCurrentScroll() { return window.pageYOffset || document.documentElement.scrollTop; } }); I have updated the code *****With the addition of the window width script it works, but it is still pretty buggy. when it falls under 800 window width size the code doesn't execute (as intended), but the css of the expanded header remains as default (i guess), when it should be the css of the smaller header (removeClass ('shrink')
type: Question
has comment: http://stackoverflow.com/comment/44685658
has answer: http://stackoverflow.com/a/28157086
downvote count: 0
tagged with: header
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44683799
favorite count: 0
has comment: http://stackoverflow.com/comment/44685867
answer count: 3
has comment: http://stackoverflow.com/comment/44685977
has answer: http://stackoverflow.com/a/28157230
has title: Jquery Media Query
has comment: http://stackoverflow.com/comment/44684480

http://stackoverflow.com/comment/44638633
type: Comment
type: QuestionComment
has text: @ps0604 As I said in my question, I agree that a directive is probably "better" but I just don't know how to do it. And I suspect it will be tricky to integrate with angular-selectize. If it's not as hard to do as I think I'm open to it. I'll leave the datepicker discussion for another time.
comment on: http://stackoverflow.com/q/28132939
score: 0

http://stackoverflow.com/comment/73527859
type: Comment
has text: @Caio Kawasaki - could you kindly provide a code example of how you're achieving this? I'm stuck on this issue but can't work out what you mean from 'put the image as the background for itemSelector'.
comment on: http://stackoverflow.com/a/29944458
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44800472
comment on: http://stackoverflow.com/q/28218395
score: 0
has text: Are you able to run code before that code? Or must it be after?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28212061
has comment: http://stackoverflow.com/comment/44795221
has comment: http://stackoverflow.com/comment/44797824
has comment: http://stackoverflow.com/comment/44798175
has body: Bind event in link function which will give access to angular compiled directive element. Directive .directive('windowExit', function($window) { return { restrict: 'AE', link: function(element, attrs){ var myEvent = $window.attachEvent || $window.addEventListener, chkevent = $window.attachEvent ? 'onbeforeunload' : 'beforeunload'; /// make IE7, IE8 compatable myEvent(chkevent, function (e) { // For &gt;=IE7, Chrome, Firefox var confirmationMessage = ' '; // a space (e || $window.event).returnValue = "Are you sure that you'd like to close the browser?"; return confirmationMessage; }); } }; }); HTML &lt;body window-exit&gt;&lt;/body&gt;
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44789168
answers question: http://stackoverflow.com/q/28197316
has comment: http://stackoverflow.com/comment/44793945
upvote count: 1
has comment: http://stackoverflow.com/comment/44794321
has comment: http://stackoverflow.com/comment/44796662
has comment: http://stackoverflow.com/comment/44794431
type: Answer

http://stackoverflow.com/comment/45800775
type: QuestionComment
comment on: http://stackoverflow.com/q/28183444
has text: >nodemon 27 Feb 16:20:32 - [nodemon] v1.3.7 27 Feb 16:20:32 - [nodemon] to restart at any time, enter `rs` 27 Feb 16:20:32 - [nodemon] watching: *.* 27 Feb 16:20:32 - [nodemon] starting `node ./bin/www` [express-ntlm] No Authorization header present GET /search 401 5ms [express-ntlm] No domaincontroller was specified, all Authentication messages are valid. challenge.toString('base64') = TlRMTVNTUAACAAAAAAAAAAAoAAABggAAASNFZ4mrze8AAAAAA AAAAA== GET /search 401 2ms
score: 0
type: Comment

addeventlistener
tags question: http://stackoverflow.com/q/28225452
tags question: http://stackoverflow.com/q/28159425
tags question: http://stackoverflow.com/q/28217437
tags question: http://stackoverflow.com/q/28274752
tags question: http://stackoverflow.com/q/28200117
tag name: addeventlistener
type: Tag

http://stackoverflow.com/q/28134685
answer count: 1
score: 0
has comment: http://stackoverflow.com/comment/44641493
tagged with: javascript
type: UnansweredQuestion
has body: I am working with a form which uses Javascript for a process. When i try to read the textbox value in form with PHP, It's not showing output. My code is HTMLCode is Number of Questions: Go Javascript is PHP Code is <?php if (isset($_POST['qscount'])){ echo $_POST['qscount']; } ?> I want to use this qscount value in another php page. How to get this textbox value in PHP and use it in another page ?
has answer: http://stackoverflow.com/a/28134713
type: Question
has title: PHP code not working in a Form which is used for javascript
tagged with: php

http://stackoverflow.com/comment/44646730
type: Comment
has text: Hi pablochan , thanks for your answer . I had tried but not work ,here my site http://www.cloudsblack.com/modalwindow.html , can you help me to look over ? thanks
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28137485

http://stackoverflow.com/comment/44654846
has text: Yes, that red square is the whole page, but you must put all the content inside `.container`. I posted it as an answer.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28141392

http://stackoverflow.com/comment/44841035
type: Comment
has text: we have to post the data to a third party server...used jsonp for cross domain request..didnt know post wont work here....
comment on: http://stackoverflow.com/a/28236626
score: 0
type: AnswerComment

http://stackoverflow.com/a/28226406
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You can use: Event.preventDefault(), or return false Both will have the effect of prevent the default behavior of internal anchor links from navigating to the top of the page. Example usage, as has been demonstrated on SO before: var links = document.querySelectorAll("a"), pd = function(e) { e.preventDefault ? e.preventDefault() : e.returnValue = false; }; links.addEventListener('click', pd, false); If you're using jQuery, you can do it like this: var links = $('a'); links.click(function(e) { e.preventDefault(); // Can be used anywhere }); Important to note that if you choose to use return false, it has to be on the last line in the function, otherwise it will stop all downstream code from being executed: var links = $('a'); links.click(function() { // Your code here // ... return false; // Must be on the last line }); Perhaps some bedtime reading? The difference between ‘return false;’ and ‘e.preventDefault();’ When and why to 'return false' in javascript?
score: 1
answers question: http://stackoverflow.com/q/28226374
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28226374

http://stackoverflow.com/q/28264126
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44887327
has comment: http://stackoverflow.com/comment/44885117
accepted answer: http://stackoverflow.com/a/28271094
score: 0
has title: Javascript Animation Not Working
has comment: http://stackoverflow.com/comment/44887563
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44885626
has answer: http://stackoverflow.com/a/28271094
tagged with: animation
has comment: http://stackoverflow.com/comment/44885256
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44886536
tagged with: syntax
has body: I have a JS animation that is supposed to move images inside of a div called "reel" down or up. There are two arrows with href="javascript:reelUp" or "reelDown", depending on the arrow. For some reason when I click the arrow it throws a syntax error saying that it expected an expression but got end of script. No idea what is wrong--I pulled this straight from a tutorial that works. Just updated the code after taking in a new suggestions. Its still not working, so I included my (messy) CSS. Any help would really be appreciated! I have no idea what the issue is! Tales of the Hartland: Homepage The tutorial code this is based on is available at: http://javascript.info/files/tutorial//browser/animation/move.html
has comment: http://stackoverflow.com/comment/44897668
has comment: http://stackoverflow.com/comment/44897264

http://stackoverflow.com/comment/44784149
comment on: http://stackoverflow.com/q/28209628
has text: Funny you couldn't come up with a for loop... What have you actually tried? :)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28191517
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28311768
tagged with: intel-xdk
tagged with: audio
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28311768
has title: Intel XDK: Playing audio that is not in the application folder
type: Question
has body: I'm making an app with javascript and wrap it with intel xdk. I read here the method "requires the sound file to be included within the application file folder". Is there a way to play a sound with it's full path from the web (like www.example.com/sound.mp3 )? Should I use an audio library for that ?

http://stackoverflow.com/comment/44782707
score: 0
type: QuestionComment
type: Comment
has text: just try window.location.hash="#login"; instead of $state.go('login') ..
comment on: http://stackoverflow.com/q/28208893

http://stackoverflow.com/a/28186870
type: Answer
has body: Don't include the hash when you're selecting by id. You're not using jQuery or querySelector. var tupu = document.getElementById("com_"+url); There is also no need to concatenate the empty string there at the end so I removed it.
score: 0
answers question: http://stackoverflow.com/q/28186849

http://stackoverflow.com/a/28131315
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44635248
type: Answer
accepted answer of: http://stackoverflow.com/q/28131303
has body: Here, you are using delegation, but it is again on a dynamically generated node. Try this instead: $(document).on('change', ''#titlesDropDown'', function () { Or, alternatively, you can just replace document with an element present in the DOM at the time of load.
answers question: http://stackoverflow.com/q/28131303
upvote count: 1
score: 1

http://stackoverflow.com/comment/44909784
comment on: http://stackoverflow.com/a/28270219
has text: I'm lost, could you use the exact values from the function? What `Object` refers to on your code? The first Object? The second one?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44914681
has text: Now i'm generating this in backend. How to rapresent it in Extjs store? I'm confusing (specially with hasOne associations)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28263660

variables
tag name: variables
tags question: http://stackoverflow.com/q/28185877
tags question: http://stackoverflow.com/q/28159495
tags question: http://stackoverflow.com/q/28271122
tags question: http://stackoverflow.com/q/28123778
tags question: http://stackoverflow.com/q/28140806
tags question: http://stackoverflow.com/q/28148155
tags question: http://stackoverflow.com/q/28240550
tags question: http://stackoverflow.com/q/28212644
tags question: http://stackoverflow.com/q/28270971
tags question: http://stackoverflow.com/q/28215821
tags question: http://stackoverflow.com/q/28139011
tags question: http://stackoverflow.com/q/28255031
type: Tag
tags question: http://stackoverflow.com/q/28143697
tags question: http://stackoverflow.com/q/28258688
tags question: http://stackoverflow.com/q/28121844
tags question: http://stackoverflow.com/q/28212067
tags question: http://stackoverflow.com/q/28126930
tags question: http://stackoverflow.com/q/28263709
tags question: http://stackoverflow.com/q/28257566
tags question: http://stackoverflow.com/q/28140638
tags question: http://stackoverflow.com/q/28138487
tags question: http://stackoverflow.com/q/28147351
tags question: http://stackoverflow.com/q/28276696
tags question: http://stackoverflow.com/q/28160866

http://stackoverflow.com/comment/44651618
comment on: http://stackoverflow.com/a/28139888
type: AnswerComment
score: 0
type: Comment
has text: getting undefined function: ('.rating input:radio').click(function() { $(obj).parents('.stars').find('.rate').html("Thank you"); }

http://stackoverflow.com/q/28220249
tagged with: java
upvote count: 1
type: Question
has title: Getting response form custom @proceesAction in WebSphere Portal Portlet
tagged with: javascript
has comment: http://stackoverflow.com/comment/44827581
tagged with: servlets
answer count: 2
has answer: http://stackoverflow.com/a/28572391
has comment: http://stackoverflow.com/comment/44832361
tagged with: portlet
downvote count: 0
favorite count: 0
has body: I am developing a Portlet in WebSphere Portal 8 and I am having problems getting the response from a custom @processAction method, the method is called and executed, but in the jsp I can't get the data returned. I have a jsp file which has: -definition of portlet actionURL... <portlet:defineObjects/> <portlet:actionURL var="cargarListadoConcursosURL"> <portlet:param name="<%=ActionRequest.ACTION_NAME%>" value="cargarListadoConcursos" /> </portlet:actionURL> -JavaScript method with ajax post method: $(document).ready(function() { cargarListadoConcursos(); }); function cargarListadoConcursos() { $.ajax({ url : '<%=cargarListadoConcursosURL%>', type : 'POST', dataType : 'json', success : function(data) { alert(data); //do something!!! } }); } and my portlet class looks like: public class ListadoConcursosPortlet extends GenericPortlet { //more methods... @ProcessAction(name="cargarListadoConcursos") public void cargarListadoConcursos(ActionRequest request, ActionResponse response) throws PortletException, IOException { HttpServletResponse resp = PortletUtils.getHttpServletResponse(response); resp.setContentType("application/json"); resp.setCharacterEncoding("UTF-8"); PrintWriter writer = resp.getWriter(); writer.append(gson.toJson(new ArrayList<Concurso>())); writer.flush(); resp.flushBuffer(); System.out.println("Paso por cargarListadoConcursos"); } } I think that the portlet.xml its fine because the jsp call the portlet controller (the syso appears at console)... Well in conclusion, the problems is that I can't get the JSON object in my JavaScript called, and the alert(data) is never executed...
possible better answer: http://stackoverflow.com/a/28229231
tagged with: websphere-portal
accepted answer: http://stackoverflow.com/a/28572391
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28229231
score: 1

http://stackoverflow.com/comment/44821853
comment on: http://stackoverflow.com/q/28229475
has text: sorry I receive it from php json_encode() function
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44863850
type: QuestionComment
has text: @T.J.Crowder: If you want to make a really clean canonical question, please strip it of all the jquery and chrome stuff and focus on the object literal. I'd suggest however that we use either [this highest-voted](http://stackoverflow.com/q/11508463/1048572) or [this most-frequently-linked](http://stackoverflow.com/q/2274242/1048572) one to start with (and ask a mod to make them community-wiki).
comment on: http://stackoverflow.com/q/28238858
type: Comment
score: 0

http://stackoverflow.com/comment/44872205
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28256979
has text: “when not setting `on*`”. The point is that it has a hidden gotcha – lots of `on*`s become `addEventListener` later.

http://stackoverflow.com/q/28216179
type: AnsweredQuestion
has title: import data from select to input
has body: I just wanted to know if there is a way to import data from select tag to input tag. From a select list &lt;select&gt;, choose an option and the option value is entered automatically on input field. eg- if you select ABC from a select list, the adjacent input field will automatically have the value ABC in it.
score: -1
has comment: http://stackoverflow.com/comment/44795623
type: Question
downvote count: 2
answer count: 1
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/28216256
accepted answer: http://stackoverflow.com/a/28216256

http://stackoverflow.com/a/28280448
has comment: http://stackoverflow.com/comment/44944543
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28278829
answers question: http://stackoverflow.com/q/28278829
type: Answer
upvote count: 1
has body: The source of your problem is that you are trying to show the same dialog again while its being closed. The default AlertifyJS dialogs are all singletons (one instance at all times). You have 2 solutions for this: Delay showing the second confirm until the first confirm is actually closed. alertify.confirm("confirm ? ", function onOk() { //delay showing the confirm again //till the first confirm is actually closed. setTimeout(function () { alertify.confirm("confirm another time ?"); }, 100); }, function onCancel() { //no delay, this will fail to show! alertify.confirm("this will not be shown!"); } ); Create your own transient (multi-instance) confirm, simply inherit from the existing one. // transient (multi-instance) alertify.dialog('myConfirm', function factory(){ return {};},true,'confirm'); alertify.myConfirm("confirm ? ", function(){ alertify.myConfirm("confirm another time ?"); }); Note: be careful with this, as each call to a transient dialog will create a new instance, you may save references to launched instances and re-use them! See demo here.
score: 1

webstorm
tags question: http://stackoverflow.com/q/28194814
type: Tag
tags question: http://stackoverflow.com/q/28175617
tags question: http://stackoverflow.com/q/28158349
tag name: webstorm

http://stackoverflow.com/comment/44860167
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28250094
has text: if i type in hello in the textarea, the new window should have a hello word that is bolded. is it possible ? and by the way where should exacltly put the code? im new in javascript and php

http://stackoverflow.com/comment/44717381
score: 0
type: Comment
type: QuestionComment
has text: Well, I think the reason you get the syntax error is that the `key` function has a `name` property which exactly matches the argument name (both are `k` in the uglified code): `function k(k){ ... }` Unfortunately, if this is part of another library, I'm not sure how you fix this.
comment on: http://stackoverflow.com/q/28170788

http://stackoverflow.com/comment/44684576
comment on: http://stackoverflow.com/a/28156262
has text: I believe Jenny's phone number is actually 867-5309.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28185043
score: 2
has comment: http://stackoverflow.com/comment/44739170
has body: Your code to append the jQuery script will be appended after your Just drop it in your head or body tag before the script that depends on it. If you need to dynamically load it in the Javascript source Follow the instructions in this tutorial (function () { function loadScript(url, callback) { var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState) { //IE script.onreadystatechange = function () { if (script.readyState == "loaded" || script.readyState == "complete") { script.onreadystatechange = null; callback(); } }; } else { //Others script.onload = function () { callback(); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } loadScript("https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function () { //jQuery loaded console.log('jquery loaded'); }); })();
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28184887
has comment: http://stackoverflow.com/comment/44766227
upvote count: 2

http://stackoverflow.com/q/28260389
upvote count: 2
has answer: http://stackoverflow.com/a/28316229
answer count: 3
downvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28390622
has comment: http://stackoverflow.com/comment/44878174
has answer: http://stackoverflow.com/a/28390622
has comment: http://stackoverflow.com/comment/44878328
tagged with: properties
accepted answer: http://stackoverflow.com/a/28314301
type: AnsweredQuestion
score: 1
has title: Can you get the property name through which a function was called?
has comment: http://stackoverflow.com/comment/44878127
has comment: http://stackoverflow.com/comment/44975267
has answer: http://stackoverflow.com/a/28314301
has comment: http://stackoverflow.com/comment/44878197
type: Question
tagged with: javascript
has body: I've done a lot of searching and some playing around, and I'm pretty sure the answer to this question is no, but I'm hoping a JavaScript expert might have a trick up his sleeve that can do this. A JavaScript function can be referenced by multiple properties, even on completely different objects, so there's no such thing as the object or property that holds the function. But any time you actually call a function, you must have done so via a single object (at the very least, the window object for global function calls) and property on that object. (A function can also be called via a function-local variable, but we can consider the function-local variable to be a property of the activation object of the scope, so that case is not an exception to this rule.) My question is, is there a way to get that property name that was used to call the function, from inside the function body? I don't want to pass in the property name as an argument, or closure around a variable in an enclosing scope, or store the name as a separate property on the object that holds the function reference and have the function access that name property on the this object. Here's an example of what I want to do: var callName1 = function() { var callName = /* some magic */; alert(callName); }; var obj1 = {'callName2':callName1, 'callName3':callName1 }; var obj2 = {'callName4':callName1, 'callName5':callName1 }; callName1(); // should alert 'callName1' obj1.callName2(); // should alert 'callName2' obj1.callName3(); // should alert 'callName3' obj2.callName4(); // should alert 'callName4' obj2.callName5(); // should alert 'callName5' From my searching, it looks like the closest you can get to the above is arguments.callee.name, but that won't work, because that only returns the name that was fixed to the function object when it was defined, and only if it was defined as a named function (which the function in my example is not). I also considered that maybe you could iterate over all properties of the t…

http://stackoverflow.com/q/28196525
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/33387023
has title: Bower Error: Unable to find suitable version for angular
tagged with: bower
score: 1
type: Question
linked to: http://stackoverflow.com/q/18922511
has answer: http://stackoverflow.com/a/28196732
tagged with: javascript
has body: I'm using bower in Visual Studio 2012 and I could migrate most JS/CSS libraries from NUGET to Bower but there's a few I cannot update, getting the same error on all. I'm new to bower so there might be something I'm missing maybe? I did tried to add the resolutions to my bower.json but still give me similar errors. My bower.json { "name": "Web", "version": "0.0.0", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.3.11", "bootstrap": "~3.3.2", "jqueryui": "~1.11.2", "requirejs": "~2.1.15", "fontawesome": "~4.3.0", "angular-smart-table": "~1.4.9", "angularjs-toaster": "~0.4.10", "angular-local-storage": "~0.1.5", "angular-translate": "~2.5.2", "angular-cookies": "~1.3.11", "angular-translate-loader-static-files": "~2.5.2", "angular-loading-bar": "~0.6.0", "oclazyload": "~0.5.2" } } This is for angular-translate-storage-cookie PM&gt; bower install angular-translate-storage-cookie -save bower angular-translate-storage-cookie#* cached git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#2.5.2 bower angular-translate-storage-cookie#* validate 2.5.2 against git://github.com/PascalPrecht/bower-angular-translate-storage-cookie.git#* bower angular-cookies#~1.2.26 cached git://github.com/angular/bower-angular-cookies.git#1.2.28 bower angular-cookies#~1.2.26 validate 1.2.28 against git://github.com/angular/bower-angular-cookies.git#~1.2.26 bower angular#1.2.28 cached git://github.com/angular/bower-angular.git#1.2.28 bower angular#1.2.28 validate 1.2.28 against git://github.com/angular/bower-angular.git#1.2.28 bower angular#* cached git://github.com/angular/bower-angular.git#1.3.11 bower : bower ECONFLICT Unable to find suitable version for angular At line:1 char:1 + bower install angular-translate-storage-cookie -save + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (bower ...ion for angular:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError …
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28200303
favorite count: 0
has comment: http://stackoverflow.com/comment/56096755

http://stackoverflow.com/comment/44761525
comment on: http://stackoverflow.com/a/28197493
score: 0
type: AnswerComment
has text: Yikes, that's an ugly solution.
type: Comment

http://stackoverflow.com/comment/44838367
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28237977
has text: In that case I would bind the form (input elements) with a secondary contents array which on click would be saved on the primary contents array instead of binding keys + values separately, keeping track of index and than storing them on the final array.

http://stackoverflow.com/q/28154071
has answer: http://stackoverflow.com/a/28198033
favorite count: 0
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: react-router
type: Question
has body: I'm trying to use React's low level API for animations (i.e ReactTransitionGroup) with React Router so I can animate transitions using requestAnimationFrame as opposed to CSS. Does anyone know how to get the special lifecycle hooks to be called on the component associated with each route? I've tried wrapping the RouteHandler component inside ReactTransitionGroup but the 'componentWillLeave' event of the current route's component doesn't fire when changing routes. &lt;ReactTransitionGroup component="div"&gt; &lt;RouteHandler key={name}/&gt; &lt;/ReactTransitionGroup&gt; Here's a JSFiddle that illustrates my problem: http://jsfiddle.net/d2mnwqLj/3/
tagged with: reactjs
tagged with: javascript
has title: Using ReactTransitionGroup with ReactRouter
upvote count: 2
has comment: http://stackoverflow.com/comment/44691122
answer count: 1
linked to: http://stackoverflow.com/q/27864720

http://stackoverflow.com/q/28151744
tagged with: http://stackoverflow.com/tag/html
tagged with: onclick
has answer: http://stackoverflow.com/a/28151840
type: Question
has body: I have created a website using backbone.js, jquery and pure javascript. In my sidemenu I have a list with some countries. If you click a country a sublist opens with cities, And if you click on a city another list expands below it filled with museums. Each museum has a checkbox next to it. So when you open the list all the checkboxes are filled and all the museums are shown in my page. When you close the list the checkboxes are unckecked and the list toggles up. It works fine with every pc browser and with all the android devices I have checked. But it doen't work on Ipad. Every time I click on a city it may check or uncheck the checkboxes, toggle or not the list e.t.c. Its works pretty weird. events: { "tap li.category a.check-toggle" : "toggleAllMuseums" }, toggleAllMuseums: function(e){.....} html London London Museum This is a sample of my code.. The problem is only in iPad..
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: backbone.js
has title: Javascript click event doesn't work on iPad
type: UnansweredQuestion

http://stackoverflow.com/comment/44674242
has text: Meaning your `print` statements are being used to print out mark-up, show us the mark-up/HTML please. Makes it easier to see what DOM you're working with. You can get to this by viewing the source, or inspecting the relevant elements.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28151422

http://stackoverflow.com/comment/44626466
type: Comment
has text: but isn't an empty object what I would want? I can add the properties like this `myObj.prop = 1`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28126708

http://stackoverflow.com/q/28221389
has answer: http://stackoverflow.com/a/28231078
tagged with: typeahead.js
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28231078
upvote count: 3
type: AnsweredQuestion
score: 3
tagged with: autocomplete
tagged with: twitter-typeahead
has title: Bootstrap typeahead does not work
has body: I have included this: then there is input: Nothing happens. No error, no suggested items. Why is that? How could I fix it? I downloaded bootstrap3-typeahead.js form there: https://github.com/bassjobsen/Bootstrap-3-Typeahead
type: Question

sencha-touch-2.1
tag name: sencha-touch-2.1
tags question: http://stackoverflow.com/q/28249197
type: Tag

http://stackoverflow.com/comment/44730945
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28180865
type: AnswerComment
has text: After adding the non-working version, your working version doesn't work. I've never seen this code snippet feature before. Very cool. Not sure how I missed it.

http://stackoverflow.com/a/28278657
answers question: http://stackoverflow.com/q/28269136
type: Answer
has body: I found a solution: Because stellar is not part of the angular framework, I have to use $apply() to execute stellar expressions. But as $digest is already in progress in my directive, I have to use $timeout, to get the stellar() call in another digest cycle. $timeout implicitly calls $apply. I also have to call stellar() on angular.element($window) to get multiple directives running correctly. So here's my working code: angular.module('ClientApp') .directive('parallaxModule', function ($timeout, $window) { return { templateUrl: 'views/parallax-module.html', restrict: 'E', scope: { data: '=' }, link: function() { $timeout(function () { angular.element($window).stellar({ horizontalScrolling: false, verticalScrolling: true, verticalOffset: 50 }); }); } }; });
score: 0

http://stackoverflow.com/q/28148169
answer count: 1
has body: I'm afraid this is a very basic Javascript question on building an array from HTML elements. I've had a search for answers, but I think there's important fundamentals that aren't clicking for me and I'm going in circles, so some outside, expert perspective would be appreciated! We're using Moodle to run an online course, and in the introduction week, we want to collect some information on users with a database module, such as country, and then show them the group responses. Moodle give a template with a placeholder data, which you can wrap in html, in this case a div: &lt;div class="country"&gt;country&lt;/div&gt; The issue I'm having is getting the content of all these divs into an array. I found this method explained here, but my attempts to push/concat didn't seem to work: var countryList = document.getElementsByClassName("country"); Array.prototype.forEach.call(countryList, function() {}); The reason I want it in an array is so I can push the content into an existing template using Jason Davies's d3.js powered word cloud. Here's a link to GitHub, and the very basic code for a simple cloud is copied below for reference. Essentially I want to be able to make an array from HTML elements and combine it with the words array used below: var fill = d3.scale.category20(); d3.layout.cloud().size([300, 300]) .words([ "Hello", "world", "normally", "you", "want", "more", "words", "than", "this" ].map(function(d) { return { text: d, size: 10 + Math.random() * 90 }; })) .padding(5) .rotate(function() { return ~~(Math.random() * 2) * 90; }) .font("Impact") .fontSize(function(d) { return d.size; }) .on("end", draw) .start(); function draw(words) { d3.select("body").append("svg") .attr("width", 300) .attr("height", 300) .append("g") .attr("transform", "translate(150,150)") .selectAll("text") .data(words) .enter().append("text") .style("font-size", function(d) { return d.size + "px"; }) .style("font-family", "Impact") .style("fill", function(d, i) { return fill(i); }) .at…
tagged with: d3.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28148694
tagged with: moodle
type: Question
has answer: http://stackoverflow.com/a/28148694
tagged with: arrays
tagged with: javascript
has title: Creating array from html to display using D3 Wordcloud
tagged with: word-cloud
score: 0

http://stackoverflow.com/comment/44853704
score: 0
type: AnswerComment
has text: There is a difference in that using the new operator with a fat arrow function will result in a TypeError. http://robcee.net/2013/fat-arrow-functions-in-javascript/
type: Comment
comment on: http://stackoverflow.com/a/28246537

http://stackoverflow.com/comment/44621456
has text: If this was possible, there would be tons of viruses out there exploiting this very possibility.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28123068

http://stackoverflow.com/comment/44779813
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28207303
has text: `session_start()` is called at the start when I load items from database. And I have tried call it like string to `unserialize($_SESSION['5'])`

http://stackoverflow.com/comment/44624421
comment on: http://stackoverflow.com/a/28125416
type: Comment
has text: edited my answer. Now you don't need ratings array. Just pass pie.rating to range function. And you are good to go.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28158507
has body: Depends on the browser: text on the left is rendered using standard ClearType rendering (at least on Windows ). On the right font anti-aliasing is gray scale. ClearType works when background in not transparent. So try to fill the canvas by some non transparent color. If this will not work then this is a specific of font rendering of particular engine. As an illustration on Windows: This is font rendering in Sciter on solid background: And this is the same document but with background:transparent (Aero Windows 7) Solid background uses ClearType (use "open image in new tab in browser")
answers question: http://stackoverflow.com/q/28158162
score: 0
type: Answer

http://stackoverflow.com/q/28246253
has comment: http://stackoverflow.com/comment/44853556
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44853719
type: AnsweredQuestion
has title: Initiate file download in .Net ApiController
score: 1
has comment: http://stackoverflow.com/comment/44854052
linked to: http://stackoverflow.com/q/4545311
has comment: http://stackoverflow.com/comment/44853273
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44853473
accepted answer: http://stackoverflow.com/a/28247421
tagged with: .net
has body: I'm trying to generate a PDF file with HTML content that's being sent via AJAX from JavaScript. I have the HTML being sent properly, and the PDF being generated correctly using the HTML, but I'm stuck trying to figure out how to initiate the file download on the user's browser. This is what I'm currently trying. This works in a IHttpHandler file when hitting the URL for the file directly, but doesn't work in the ApiController when posting via AJAX. I've also tried posting to the IHttpHandler file with the same results. Everything works fine until I try to initiate the download by using BinaryWrite. public class DownloadScheduleController : ApiController { public void Post(HtmlModel data) { var htmlContent = data.html; var pdfBytes = (new NReco.PdfGenerator.HtmlToPdfConverter()).GeneratePdf(htmlContent); using (var mstream = new System.IO.MemoryStream()) { HttpContext.Current.Response.ContentType = "application/pdf"; HttpContext.Current.Response.AppendHeader("content-disposition", "attachment; filename=UserSchedule.pdf"); HttpContext.Current.Response.BinaryWrite(pdfBytes); HttpContext.Current.Response.End(); } } } Here is the Ajax request. It's using Angular's $http. $http({ method: 'POST', url: 'api/downloadSchedule', dataType: "json", contentType: "application/json; charset=utf-8", data: data }); Alternatively I could return the PDF binary to JavaScript, but then how do I use JavaScript to save the pdf? Any help will be greatly appreciated.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44853347
has answer: http://stackoverflow.com/a/28247421
upvote count: 1

http://stackoverflow.com/a/28227495
score: 4
answers question: http://stackoverflow.com/q/28227379
has comment: http://stackoverflow.com/comment/44818111
accepted answer of: http://stackoverflow.com/q/28227379
type: AcceptedAnswer
type: Answer
upvote count: 4
has body: According to this link that taken from ewwink's answer, yes selecting by ID are faster than single class in any common browser.
downvote count: 0

http://stackoverflow.com/q/28144362
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/44888626
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44667105
has comment: http://stackoverflow.com/comment/44662102
has title: MongoDB Change index of Array-Element
has comment: http://stackoverflow.com/comment/44695372
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44693597
has body: I have a MongoDB-document that looks like: root _id: "some-mongo-id", title: "MyTitle", text: "My Text", contents: [ 0: ...some content object ..., 1: ...some other object ..., 2: ...some third object... ... 11: ... some object ... ] I want now to change for example to set the index of root.contents[2] to e.g. 7. So I want to resort the array ideally based on the old index and the new position the contents should go. What is the best approach?
tagged with: javascript
tagged with: mongodb-query

http://stackoverflow.com/comment/44657838
type: Comment
comment on: http://stackoverflow.com/a/28143076
type: AnswerComment
has text: Thank you so much! Just what I wanted!
score: 0

http://stackoverflow.com/q/28237797
has comment: http://stackoverflow.com/comment/44840773
has comment: http://stackoverflow.com/comment/44841684
has body: I am having an issue with Angular's $templateCache in ie10 specifically, but is also an issue in ie11. It works in Firefox, Chrome and Safari. Here is my template definition, in templates.js: angular.module('app').run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('/views/page.html', "&lt;div class=\"page-header row\"&gt;\n" + " &lt;div class=\"col-xs-6\"&gt;\n" + " &lt;span class=\"heading title\"&gt;{{pageTitle}}&lt;/span&gt;\n" ... ); }]); I include the templates.js at the top of the page in the &lt;head&gt;, like: &lt;script src="/js/templates.js"&gt;&lt;/script&gt; And finally I consume the templates in my routes definition, here: angular.module('app', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider .when('/', { redirectTo:'/page' }) .when('/page', { controller: 'pageController', templateUrl:'/views/page.html' }) .otherwise({ redirectTo:'/' }); }]); Again, it all works fine in Chrome, Firefox and Safari, but not IE10. The only other information I can think to provide is that the app is not at the root level, it is http://example.com/app. but the templates are indeed stored in http://example.com/views. Any ideas? EDIT: Here is a JSFiddle which actually works in IE, but I'm not sure if that's because of how JSFiddle handles the browser frame. If you copy and paste the code into an index.html, and run it on your server, it will not work in IE. http://jsfiddle.net/v9sv7jdL/2/
has title: Angular $templateCache Does Not Work in Internet Explorer
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28242649
tagged with: internet-explorer
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/44836936
tagged with: javascript
has comment: http://stackoverflow.com/comment/44840510
has comment: http://stackoverflow.com/comment/44841255
score: 0
has comment: http://stackoverflow.com/comment/44839466

http://stackoverflow.com/comment/44917167
score: 0
has text: Thanks for the edit. Should I change the outer LI to the ID? Because technically the parent LI or the inner LI is what needs the class and if something doesn't have a sub UL, that page will make it active. Thanks
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28267071

http://stackoverflow.com/q/28156103
tagged with: cordova
has comment: http://stackoverflow.com/comment/44704702
type: AnsweredQuestion
tagged with: mysql
has answer: http://stackoverflow.com/a/28156801
has answer: http://stackoverflow.com/a/28156177
has comment: http://stackoverflow.com/comment/44685058
type: Question
answer count: 2
has title: javascript - simple way to display SQL single column value for input value
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28156177
score: 0
tagged with: android
accepted answer: http://stackoverflow.com/a/28156801
has body: I'm a new Cordova-Android program maker. I've successfully create and insert the local database fields. But I stuck when I want to display them into input tag. This is my table : +----+------+---------+ | id | word | stats | +----+------+---------+ | 1 | abc | stackov | | 2 | def | erflow | +----+------+---------+ I try this code $(document).ready(function(){ docDB = window.openDatabase("Test", "1.0", "Test Data", 50000); docDB.transaction(function (tx) { tx.executeSql("SELECT * FROM Test WHERE word='abc'", [], function (tx, results) { var dblen = results.rows.length; if( dblen&gt;0 ){ document.getElementById("abc").value = results.rows.item(0)['stats']; } }, null); }); }); I've searching for simplest way, because I just want to display single SQL column value word='abc' and other word value such word='def'. Can someone correct it? And I would insert the result value into a input field Name : &lt;input type="text" id="abc"&gt; Thanks for answering :)

http://stackoverflow.com/a/28261617
answers question: http://stackoverflow.com/q/28261363
accepted answer of: http://stackoverflow.com/q/28261363
has body: There're many different ways to check if things are fully loaded. Which way to go should always be based on your need. You don't want to wait longer than what's really necessary. Just to clarify, the "window.load" is not identical with jQuery's "$(document).ready()". If you want a "vanilla" alternative, DOMContentLoaded is your rescue. DOMContentLoaded From MDN: https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded The DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading (the load event can be used to detect a fully-loaded page). document.addEventListener("DOMContentLoaded", function() { }); window.load From MDN: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onload The load event fires at the end of the document loading process. At this point, all of the objects in the document are in the DOM, and all the images, scripts, links and sub-frames have finished loading. window.onload = function() { }
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/q/28193046
has comment: http://stackoverflow.com/comment/44759586
tagged with: browser
has comment: http://stackoverflow.com/comment/44759133
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: WeChat browser stops CSS/JS animation when scrolling
has body: It happens both on iOS and Android devices. I've built some auto-played animation(and would loop for minutes) with CSS and JS. It works smoothly on desktop and all kinds of mobile browsers, but not on WeChat build-in browser. Is there any trick to solve it, or is it because of the rendering rules of this browser? Animations include fade in, fade out, and transition etc.
tagged with: css
has comment: http://stackoverflow.com/comment/44757609
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: wechat
tagged with: javascript

ionic-framework
tags question: http://stackoverflow.com/q/28141824
tags question: http://stackoverflow.com/q/28217824
tags question: http://stackoverflow.com/q/28209744
tags question: http://stackoverflow.com/q/28262101
tags question: http://stackoverflow.com/q/28205324
tags question: http://stackoverflow.com/q/28175160
type: Tag
tags question: http://stackoverflow.com/q/28226180
tags question: http://stackoverflow.com/q/28227501
tags question: http://stackoverflow.com/q/28160861
tags question: http://stackoverflow.com/q/28123985
tags question: http://stackoverflow.com/q/28162119
tags question: http://stackoverflow.com/q/28276107
tags question: http://stackoverflow.com/q/28234690
tags question: http://stackoverflow.com/q/28200889
tags question: http://stackoverflow.com/q/28185001
tags question: http://stackoverflow.com/q/28165229
tags question: http://stackoverflow.com/q/28274681
tags question: http://stackoverflow.com/q/28263269
tags question: http://stackoverflow.com/q/28278503
tags question: http://stackoverflow.com/q/28206834
tags question: http://stackoverflow.com/q/28263008
tags question: http://stackoverflow.com/q/28197752
tags question: http://stackoverflow.com/q/28274310
tags question: http://stackoverflow.com/q/28241516
tags question: http://stackoverflow.com/q/28224912
tags question: http://stackoverflow.com/q/28187924
tags question: http://stackoverflow.com/q/28133031
tags question: http://stackoverflow.com/q/28228887
tags question: http://stackoverflow.com/q/28202565
tags question: http://stackoverflow.com/q/28174609
tags question: http://stackoverflow.com/q/28242373
tags question: http://stackoverflow.com/q/28218250
tag name: ionic-framework

http://stackoverflow.com/q/28128901
type: AnsweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28131238
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28131238
tagged with: http://stackoverflow.com/tag/html
has body: I am working on a simple to-do list. Currently I have three buttons(enterBtn, completeBtn, deleteBtn)-all disabled on startup. The first one EnterBtn, gets enabled when the form is complete using jquery(works fine). Then when i submit form, javascript creates a &lt; ul > that contains a span and a checkbox(also works fine). Now, I want to enable the completeBtn if/when any of the NEW checkbox items are checked. Can someone help me figure out how to toggle my complete button? The culmination is to use completeBtn to both enable when any checkboxes are clicked, and then i am planning on removing only the ones that where checked, but i'll get to that part on my own. The only help i need is to figure out the best way to go about this based on my code below. I will //comment in spots where I've tested so far. HTML &lt;input type="text" id="goalId"&gt; &lt;input id="completeBtn" value="Complete" type="button" disabled="disabled"/&gt; &lt;ul id="log_data"&gt;&lt;/ul&gt; JavaScript function disableFunction() { document.getElementById("enterBtn").disabled = 'true'; } function enableFunction(cbId) { //tested here } function checkSpanStatus() { alert("path works"); } function updateItemStatus() { var cbId = this.Id.replace("cb_",""); var itemText = document.getElementById("item_" + cbId); if(this.checked) { itemText.style.textDecoration = "line-through"; //document.getElementById("completeBtn").disabled = 'false'; &lt;tried this&gt; enableFunction(); //and this }else{ itemText.style.textDecoration = "none"; } } function addNewItem(list, itemText) { totalItems++; var listItem = document.createElement("ul"); var checkbox = document.createElement("input"); checkbox.type = "checkbox"; checkbox.Id = "cb_" + totalItems; checkbox.onclick = updateItemStatus; var span = document.createElement("span"); span.id = "item_" + totalItems; span.onclick = checkSpanStatus; span.innerText = itemText; listItem.appendChild(span); listItem.appendChild(checkbox); list.appendChild(listItem); } var to…
tagged with: checkbox
has title: Enable/Disable button using dynamically added checkbox's

http://stackoverflow.com/q/28257914
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28258025
has body: Here is the code: var newTab; chrome.tabs.create({url: (newUrl)}, function(tab){ newTab = tab.id; }); check(); alert(newTab); chrome.tabs.update(newTab, {pinned: true}); chrome.tabs.update(tabid, {active: true}); chrome.tabs.remove(newTab); The final instruction doesn't work. the newTab variable doesn't update so that is can be pinned and then remove.
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: google-chrome-extension
linked to: http://stackoverflow.com/q/23667086
has title: Variable not being updated in Javascript
has comment: http://stackoverflow.com/comment/44873976
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28258025

http://stackoverflow.com/q/28226520
has comment: http://stackoverflow.com/comment/44844054
has answer: http://stackoverflow.com/a/28226682
type: Question
tagged with: api
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28226682
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I would like to know how to retrieve movies from the Rotten Tomatoes Api using JavaScript/JQuery. I have looked over the documentation and looked at the examples but i am still no wiser as API's are new to me. If someone could give me an example of the following that would be great: http://api.rottentomatoes.com/api/public/v1.0/lists/movies/box_office.json?apikey=[your_api_key]&amp;limit=1 (I am aware i need to input my api key for it to function) Thanks
has title: Retrieving Movies Via Rotten Tomatoes API
type: AnsweredQuestion

http://stackoverflow.com/a/28272148
accepted answer of: http://stackoverflow.com/q/28268835
has body: This depends on your SensorItem component's definition. Because SensorItem isn't a native DOM element but, like you said, another React component, onClick as defined here is simply a property of that component. What you need to do is, inside of the SensorItem component pass the onClick prop to an DOM component's onClick event: var SensorItem = React.createClass({ render: function() { return ( &lt;div className="SensorItem" onClick={this.props.onClick}&gt; ... &lt;/div&gt; ); } });
answers question: http://stackoverflow.com/q/28268835
score: 140
has comment: http://stackoverflow.com/comment/62188870
type: AcceptedAnswer
downvote count: 0
upvote count: 140
has comment: http://stackoverflow.com/comment/77482564
has comment: http://stackoverflow.com/comment/44902867
type: Answer

http://stackoverflow.com/a/28268184
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28267283
answers question: http://stackoverflow.com/q/28267283
score: 0
has body: The nested for loop can be optimized as it is a "search" step, and you can do a better version than just to loop the whole thing, for example, if the numbers array is or can be sorted first, you can use binary search. In ruby (and other modern languages), you can use iterators and built in methods to make the code more concise and potentially perform better (you can do benchmarking to verify that), for example, you can do something like: data.size.times do |i| if tog[i] do_something(i) else do_something2(i) end end

http://stackoverflow.com/q/28135765
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28135953
accepted answer: http://stackoverflow.com/a/28135953
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44643556
has comment: http://stackoverflow.com/comment/44644093
has answer: http://stackoverflow.com/a/28135823
type: Question
has title: define a function for each array element
score: 0
possible better answer: http://stackoverflow.com/a/28135798
answer count: 3
has answer: http://stackoverflow.com/a/28135798
has body: I want to do this without writing the code X times. How you do that in JavaScript ? I am from Java. floors[0].on("up_button_pressed", function() { elevator.goToFloor(floors[0].floorNum()); } ); floors[0].on("down_button_pressed", function() { elevator.goToFloor(floors[0].floorNum()); } ); floors[1].on("up_button_pressed", function() { elevator.goToFloor(floors[1].floorNum()); } ); floors[1].on("down_button_pressed", function() { elevator.goToFloor(floors[1].floorNum()); } ); floors[2].on("up_button_pressed", function() { elevator.goToFloor(floors[2].floorNum()); } ); floors[2].on("down_button_pressed", function() { elevator.goToFloor(floors[2].floorNum()); } ); floors[3].on("up_button_pressed", function() { elevator.goToFloor(floors[3].floorNum()); } ); floors[3].on("down_button_pressed", function() { elevator.goToFloor(floors[3].floorNum()); } ); floors[4].on("up_button_pressed", function() { elevator.goToFloor(floors[4].floorNum()); } ); floors[4].on("down_button_pressed", function() { elevator.goToFloor(floors[4].floorNum()); } );

http://stackoverflow.com/q/28181858
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44734076
favorite count: 0
has comment: http://stackoverflow.com/comment/44734172
has comment: http://stackoverflow.com/comment/44733772
type: Question
score: 1
tagged with: angularjs
upvote count: 1
has title: Using selenium to test AngularJs, Can I access ng-csv
has comment: http://stackoverflow.com/comment/44734115
tagged with: java
tagged with: selenium
has body: I am writing a test and I want to use some data that Angularjs generates for a download instead of downloading the file if possible. I have tried pulling the data from the site but data is pulled and dropped as you scroll through the site making it hard to write tests that are reliable. I have posted the html that generates the download event. I know the function to generate the data is getFilterList(), I just do not know how to use selenium to get the data. Export Filtered List Also, I have to use selenium because there is already a framework that everyone uses.

yii2
tags question: http://stackoverflow.com/q/28140166
type: Tag
tag name: yii2

http://stackoverflow.com/comment/44928268
score: 1
has text: damn, that is what I feared. This is an issue for me as I have some generic search components that accept a modelClass parameter. It would be great if ember-data allowed you to explicitly force polymorphism `this.store.fetchPolymorphic('animal')` without the need for an intermediary. Thanks for your help, I might open an issue in ember-data as I think this is impossible at the moment.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28271033

http://stackoverflow.com/comment/44649077
type: AnswerComment
has text: Thank you for the quick answer and the example! I knew there must be a more elegant solution :)
comment on: http://stackoverflow.com/a/28138176
type: Comment
score: 1

http://stackoverflow.com/a/28226709
answers question: http://stackoverflow.com/q/28226516
has body: You should pass some commandline options to PhantomJS to not use SSLv3 but only TLSv1 and optionally ignore SSL errors (--web-security=false might also be helpful): phantom.create('--ssl-protocol=tlsv1', '--ignore-ssl-errors=true', function(ph) { ... The reason this might be an issue is that many sites have removed SSLv3 support because of the Poodle vulnerability. This answer provides the solution for plain PhantomJS. My answer here elaborates on that issue in more detail for CasperJS.
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28226516

http://stackoverflow.com/a/28183918
type: Answer
answers question: http://stackoverflow.com/q/28123985
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Ok, now that I read the entire question I can help you. The first code snippet will never do what you want without modifying the popup CSS because of the default popup layout In order for the second layout to work (using the template) you need to pass the scope parameter to your popup, so the buttons are linked to the scope holding the functions https://ionicframework.com/docs/v1/api/service/$ionicPopup/
accepted answer of: http://stackoverflow.com/q/28123985

http://stackoverflow.com/q/28203065
tagged with: mustache
has title: Persistent templates (or re-using templates) with Hogan / Mustache?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28223086
has body: Not entirely sure if "persistent templates" is what I am after, this is the first time I am using a Javascript templating engine. I am curious if there is a way of keeping the template data intact for the purposes of re-rendering a document once it has been rendered... An example -- I define a simple template snippet: Price: {{current_price}} I render it: var template = Hogan.compile($("#price").html()) $("#price").html(template.render(price_data)) Let's say I want to update the price information every X seconds (fire a request, grab JSON and push it back to #price), re-rendering the template fails as there is no {{current_price}} any more. I could just do something along the lines of $('#price').text('Price: ' + price_data) after a succesful request but I feel this somehow makes the idea behind using templates useless. So the question is, what is a way to re-use templates on a document? Cache the template data into a variable and re-use it when rendering or is there a more clever way? Thanks.
type: Question
has answer: http://stackoverflow.com/a/28223086
tagged with: javascript
tagged with: hogan.js
score: 0
answer count: 1
tagged with: templates

http://stackoverflow.com/comment/44698385
score: 0
type: Comment
type: QuestionComment
has text: are you using jquery datepicker ??
comment on: http://stackoverflow.com/q/28163744

http://stackoverflow.com/comment/44867938
comment on: http://stackoverflow.com/q/28254412
score: 0
has text: After an additional test, it's the swipe function that block everything. Removing it and having only the other part of the code works fine. But of course I would like it to work.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28128612
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44630525
has comment: http://stackoverflow.com/comment/44630557
answers question: http://stackoverflow.com/q/28128483
downvote count: 0
has body: As a framework , angular certainly has powerful template capabilities above and beyond most other scripts that focus solely on client side templates. Would it be considered a replacement such that other template scripts won't be needed again? No. You won't need other template engines within angular pages but that doesn't mean someone that only needs a template engine should switch to angular solely for one feature that a lighter package can deliver.

http://stackoverflow.com/comment/44905927
type: QuestionComment
score: 0
has text: But I will have to write the "listen to query" code in C++ right? even though the web portal is written in PHP? The flow: I write a query on web portal->It should go to the listener running in the C++ file after building the index -> Sends the result of query back to the web portal.
type: Comment
comment on: http://stackoverflow.com/q/28275195

http://stackoverflow.com/q/28173274
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/4313841
possible better answer: http://stackoverflow.com/a/28175080
accepted answer: http://stackoverflow.com/a/28176453
downvote count: 0
has answer: http://stackoverflow.com/a/28175080
has body: I'm working on a JavaScript extension that is supposed to wrap the selected text somehow and send it to my server. The "wrapping" is done so that the server can identify the exact position of the highlighted text, even if there were duplicates. I followed this link, How to change CSS of selected text using Google Chrome Extension, to be able to obtain the selected text. Afterwards I followed this approach, How to get selected html text with javascript?, specifically the chosen answer, to obtain the innerHTML. The problem is that when the selection is across different divs, it breaks the DOM, or just as zyklus said in that answer "WILL have side effects from breaking nodes in half and creating an extra span". As an example, A neat th<f5e975aa551d1ae4e91e8ce9> eme for start-ups and small corporations. Projects Samples O </f5e975aa551d1ae4e91e8ce9>eme for start-ups and small corporations. Projects Samples Of Our Work Project 3 Project 4 Project 5 Project 1 Project 2 Project 3 Project 4 Project 5 Project 1 Project 2 Project 3 I use f5e975aa551d1ae4e91e8ce9 here to identify the text, just as any kind of unique text that most probably will not exist in a usual web page. As you see above, "IntroDiv" is there twice, as well as "ProjectsSlider". That's the same part of the page before calling any functions. A neat theme for start-ups and small corporations. Projects Samples Of Our Work Project 1 Project 2 Project 3 Project 4 Project 5 That's my code. //save_last_element.js document.body.addEventListener('contextmenu', function(e) { LAST_SELECTION = window.getSelection().getRangeAt(0); }, false); //script.js if (LAST_SELECTION) { var mySelection = LAST_SELECTION.cloneRange(); var selectionContents = mySelection.cloneContents(); var div = document.createElement("f5e975aa551d1ae4e91e8ce9"); div.appendChild(selectionContents); mySelection.insertNode(div); } Is there a way to avoid messing up the DOM? Can I somehow identify the position of the selected text by a completely differ…
tagged with: javascript
has title: window.getSelection().getRangeAt(0) innerHTML without breaking nodes
favorite count: 0
linked to: http://stackoverflow.com/q/26047914
upvote count: 2
linked to: http://stackoverflow.com/q/5643635
has answer: http://stackoverflow.com/a/28176453
type: AnsweredQuestion
score: 2
tagged with: dom

http://stackoverflow.com/q/28198391
favorite count: 0
tagged with: winforms
score: 0
has comment: http://stackoverflow.com/comment/44763491
has comment: http://stackoverflow.com/comment/44764115
has comment: http://stackoverflow.com/comment/44769341
has comment: http://stackoverflow.com/comment/44763561
has comment: http://stackoverflow.com/comment/44763461
has body: I have webpage which gets data by json and then generates html from that data. I want to be able to do element.invokeMember("click"); (webBrowser winForms control) on source generated by JS. How to do that in c#? I can see the source in firebug only. What have I already done: ( _ie from here: How to make WebBrowser wait till it loads fully?) public partial class Form1 : Form { public Form1() { InitializeComponent(); webBrowser1.ProgressChanged += new WebBrowserProgressChangedEventHandler(_ie); } private void _ie(object sender, WebBrowserProgressChangedEventArgs e) { int max = (int)Math.Max(e.MaximumProgress, e.CurrentProgress); int min = (int)Math.Min(e.MaximumProgress, e.CurrentProgress); if (min.Equals(max)) { Console.Write("complete"); var menus = webBrowser1.Document.GetElementsByTagName("menu"); Console.Write(menus.Count); var votes = new List<HtmlElement>(); foreach (HtmlElement menu in menus) { Console.Write("found"); var ass = menu.GetElementsByTagName("a"); foreach (HtmlElement a in ass) { if (a.GetAttribute("class").Contains("vote-up")) { a.InvokeMember("click"); } } } } } private void button1_Click(object sender, EventArgs e) { webBrowser1.Navigate("xxxxx"); } } HTML: http://pastebin.com/0KGCwtqs copied from firebug, so some tags are collapsed. I want only -> -> Console.Write("found") is not executed. So webBrowser can not even find solved Just use tricky JS var elements=document.getElementsByClassName('vote-up');for (index = 0; index < elements.length; index++) {elements[index].click();}
type: AnsweredQuestion
tagged with: c#
linked to: http://stackoverflow.com/q/9776359
has comment: http://stackoverflow.com/comment/44763450
has title: How to manipulate webpage by weBrowser control after JS is executed?
type: Question
has comment: http://stackoverflow.com/comment/44763770
has answer: http://stackoverflow.com/a/28241504
accepted answer: http://stackoverflow.com/a/28241504
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: webbrowser-control

http://stackoverflow.com/comment/44912374
comment on: http://stackoverflow.com/a/28277953
type: Comment
score: 0
has text: Ya you are right. selectedId is set somewhere in my code and I've tried with the way you said. Same result no change. Why is it one empty/blank window is getting opened??
type: AnswerComment

http://stackoverflow.com/a/28138880
answers question: http://stackoverflow.com/q/28138835
upvote count: 1
downvote count: 0
type: Answer
has body: You have to pass the FormData object as the data parameter. jQuery AJAX 'multipart/form-data' Not Sending Data? But alternatively, you may upload base64 string if the image is not that big.
score: 1

http://stackoverflow.com/a/28252282
has comment: http://stackoverflow.com/comment/44863681
type: Answer
has body: So the code below console logs the text inside the contenteditable div which is focused. if you write $(this) inside the event handler it will reference the currently div focused $('[contenteditable="true"]').focus(function(){ console.log($(this).text()); // for example, do whatever you please here // you said you want to find the parent div of the element focused var $parent = $(this).parent(); // now $parent is a reference of the parent div of the focused element }); The tricky thing is that when the user clicks the button, the contenteditable is not focused anymore. so let's make a variable where we store our last focused contenteditable div , and when the user clicks a button, the changes will be made on that very variable. like so : var lastFocused; $('[contenteditable="true"]').focus(function(){ lastFocused = $(this); }); $('#changer').on('click', function(){ console.log(lastFocused); lastFocused.css('background-color', 'red'); }) see codepen : here
accepted answer of: http://stackoverflow.com/q/28252161
answers question: http://stackoverflow.com/q/28252161
has comment: http://stackoverflow.com/comment/44863802
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28265321
type: AnsweredQuestion
has body: Google Developer Tools is displaying the following error when my PHP page uses the content from a javascript file (my_scripts.js): "Uncaught ReferenceError: $ is not defined scripts.js:1 (anonymous function)" Content of my_scripts.js $('a.button').click(function(){ window.location.href = "another_page.php"; }); The page and the script work as required. Clicking the element links to the requested page, but the error is there. 1) What causes the error? 2) Can it or should it be ignored?
type: Question
has comment: http://stackoverflow.com/comment/44887268
tagged with: javascript
tagged with: jquery
score: 4
possible better answer: http://stackoverflow.com/a/28265369
has answer: http://stackoverflow.com/a/28265417
has title: Anonymous Function Error: $ is not defined
answer count: 3
has answer: http://stackoverflow.com/a/28265360
accepted answer: http://stackoverflow.com/a/28265360
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44887269
upvote count: 4
tagged with: php
has comment: http://stackoverflow.com/comment/44887302
has answer: http://stackoverflow.com/a/28265369
has comment: http://stackoverflow.com/comment/44887589

http://stackoverflow.com/a/28259084
has comment: http://stackoverflow.com/comment/45113957
has body: You need to add an onclick event handler to each input box like this. &lt;input type="checkbox" name="Settings" onclick="myFunction(this)" value="ChiaUsed" id="Chia"&gt; Then in your myFunction function, function myFunction(element){ //use element object here } You will receive the element data. You can access properties like "value" by dot notation or bracket notation var value = element.value;
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28257425
answers question: http://stackoverflow.com/q/28257425
type: Answer

http://stackoverflow.com/q/28196415
upvote count: 1
accepted answer: http://stackoverflow.com/a/28206477
tagged with: node.js
type: AnsweredQuestion
tagged with: sails.js
score: 1
type: Question
tagged with: cors
downvote count: 0
linked to: http://stackoverflow.com/q/17355020
tagged with: javascript
has title: sailsjs cors bad request still getting through to controller
has answer: http://stackoverflow.com/a/28206477
answer count: 1
has body: So my cors.js file looks like module.exports.cors = { allRoutes: true, origin: require('./local.js').hosts, // this is 'http://localhost' } I then chose a random site to make a request from, in this case: http://tools.pingdom.com/fpt/ Here is my request and response from the page $.post('http://localhost:1337/gift/create') Object {readyState: 1, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…} jquery-2.1.1.min.js:4 POST http://localhost:1337/gift/create (index):1 XMLHttpRequest cannot load http://localhost:1337/gift/create. The 'Access-Control-Allow-Origin' header contains the invalid value ''. Origin 'http://tools.pingdom.com' is therefore not allowed access. However, I'm still getting errors in the console as the controller function still gets called. sails&gt; error: Sending 500 ("Server Error") response: TypeError: Cannot read property 'email' of undefined I would think that cors should just end the connection if it fails. Am I missing a setting? This is a duplicate of this post CORS: preflight passes, main request completes w/200, but browser still has Origin error but it does not seem like it was resolved. Do we know why the post continues to go through? Here is the response header Access-Control-Allow-Credentials:true Access-Control-Allow-Origin: Connection:keep-alive Content-Length:2 Content-Type:application/json; charset=utf-8 Date:Wed, 28 Jan 2015 15:56:51 GMT Set-Cookie:sails.sid=s%3A5TJr82PCN-Tas2GrfKkhooEB.IWwc75iQUPRYoR7qWSep6xc%2BSLUkOV0IQe0w63GDYrQ; Path=/; HttpOnly X-Powered-By:Sails &lt;sailsjs.org&gt; There is not access-control-allow-origin set. I can make a policy for that, but is this is bug in Sails?
favorite count: 0

http://stackoverflow.com/q/28122665
has answer: http://stackoverflow.com/a/28122835
accepted answer: http://stackoverflow.com/a/28122880
type: Question
has body: I followed a SO question on how to create a placeholder for div[contenteditable]. My code looks like: http://jsfiddle.net/sdxjgkzm/ $('div[data-placeholder]').on 'keydown input', -&gt; if (this.textContent) this.dataset.divPlaceholderContent = 'true' else delete(this.dataset.divPlaceholderContent) Unfortunately, the problem is that as you can see the standard input's placeholder stays until you begin typing, while the contenteditable's goes away as soon as you click inside. How do I fix this?
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: ContentEditable Placeholder Issue
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28122880
favorite count: 0
upvote count: 1
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28122835
score: 1

http://stackoverflow.com/comment/44879502
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69985/discussion-between-pshyoulost-and-rastudios).
type: Comment
comment on: http://stackoverflow.com/a/28260819
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44645123
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28136607
type: QuestionComment
has text: Well you can cut down on the typing by using `$(function() {})` instead of `$(document).ready(function() {})`...

http://stackoverflow.com/a/28279051
type: Answer
has comment: http://stackoverflow.com/comment/44913045
has body: You need to define a webmethod to check the session status and then have a .ajax query the method. [WebMethod] public static string GetSession(string Skey) { return Session[Skey]; } [WebMethod] public static string SetSession(string key, string Svalue) { Session[key] = Svaluee; } jQuery: $.ajax({ type: "POST", url: "website.aspx/GetSessionValue", data: '{ key: "CurrentSessionKey" }', contentType: "application/json; charset=utf-8", dataType: "json", success: function(data) { console.log("The Session value is " + data); } }); Update Read the question wrong. Hope this helps.
answers question: http://stackoverflow.com/q/28278896
has comment: http://stackoverflow.com/comment/44912136
downvote count: 1
has comment: http://stackoverflow.com/comment/44912236
accepted answer of: http://stackoverflow.com/q/28278896
score: -1
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44912747

http://stackoverflow.com/q/28233238
tagged with: internet-explorer
tagged with: javascript
has answer: http://stackoverflow.com/a/28234128
has answer: http://stackoverflow.com/a/28233379
has comment: http://stackoverflow.com/comment/44829870
has body: I need to open a window after the dom is loaded, and scroll the y position to the element, preferably centered on the screen. I looked on stack overflow and I put something together with the bits i found. The problem with this is that it's using a timer to see my element is available, and it is really slow - altering the interval time does not effect the speed at all. Also, it does not work in IE and i need it to. thought on this? linkToComment: function(e){ var link = 'https://****'; var commentId = 21 var w = window.open(link); var interval = setInterval(function(){ if ( $(w.document.body).find("div[data-commentoriginalid=" + commentId + "]")) { $(w.document.body).animate({ scrollTop: ( $(w.document.body).find("div[data-commentoriginalid=" + commentId + "]").offset().top) },500); clearInterval(interval); } }, 500) },
answer count: 2
has title: Open new window, and scroll to element
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/a/28256979
downvote count: 1
answers question: http://stackoverflow.com/q/28256910
has comment: http://stackoverflow.com/comment/44872187
has body: As @EvanMosseri said, you can simply call it manually whenever you add a new button. But that's lame, so do this: document.body.addEventListener('DOMNodeInserted',function(){ someFunction(); } And put all that inside your window.onload handler EDIT: @elclanrs's way is probably better than this, but this way should still work, so I'll leave it here
type: Answer
has comment: http://stackoverflow.com/comment/44872154
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/44872205

http://stackoverflow.com/comment/44823144
has text: @EmmanuelDelay , if i use that plugin, then i should hide default text in the google map, is there a way to do that?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28213656

http://stackoverflow.com/q/28261625
has answer: http://stackoverflow.com/a/28692851
tagged with: defineproperty
tagged with: prototype
has comment: http://stackoverflow.com/comment/44880566
answer count: 1
has comment: http://stackoverflow.com/comment/44880451
favorite count: 0
has body: Ok peep's so I have this code, but here's a simplified version: _ d1 So my setup is: Chrome v40.0.2214.94 m IE v11.0.9600.16428 IIS v7.5.7600.16385 When I open either browser & open the above file as so: IE ==> C:\site\proj\default.htm Chrome ==> file:///C:/site/proj/default.htm Both browsers display the correct result: 2... Yet when I open the file as so: IE ==> http://portal/proj/default.htm Chrome ==> http://portal/proj/default.htm Where portal is the name of the localhost site, setup in IIS. IE displays undefined and throws a console error of: Object doesn't support property or method 'defineProperty' While Chrome still display 2 correctly. So, I suppose my question is this... Does IIS change the 'compatibility mode' of IE or something, or do I just need to update to a newer version of IIS? Thinking Is... I'm playing round with .hta files for the first time & I was writing an Array.prototype.indexOf property as I got a similar error message as above when trying to access .indexOf on an array... Thing is, I wanted to make the new indexOf property enumerable, so I used Object.defineProperty to set the property as enumerable, and that's how I ended up on Stack'...
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44880764
has comment: http://stackoverflow.com/comment/44880417
has comment: http://stackoverflow.com/comment/44881426
linked to: http://stackoverflow.com/q/19567887
type: Question
has comment: http://stackoverflow.com/comment/44881131
score: 5
has title: IE11 error, Object doesn't support property or method 'defineProperty'
tagged with: indexof
upvote count: 5
tagged with: arrays
has comment: http://stackoverflow.com/comment/44880779
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28158925
has answer: http://stackoverflow.com/a/28158968
has comment: http://stackoverflow.com/comment/44689165
tagged with: javascript
has answer: http://stackoverflow.com/a/28159001
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44689153
type: UnansweredQuestion
tagged with: php
has body: I'm trying to teach myself how to use AJAX with PHP. However, I am unable to get my (likely broken) AJAX code to change the value of my $things variable. Instead, what happens is the index.php page gets reloaded and a brand new button gets added. Here is my code: <?php $things = 0; ?> testing <?php echo " Things = Change Content Any clue as to where I'm messing up?
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44689288
score: -1
has comment: http://stackoverflow.com/comment/44689286
has comment: http://stackoverflow.com/comment/44689287
has title: don't understand why i'm not changing my php variable with my script
answer count: 2
upvote count: 0

http://stackoverflow.com/q/28261956
has comment: http://stackoverflow.com/comment/44881039
tagged with: javascript
downvote count: 5
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28262003
favorite count: 0
has title: Href not working when class is mention in a img tag
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: -5
has body: My html code is &lt;a href="./abc/main.html"&gt;&lt;img src="./img/abc.png" class="abc" /&gt; &lt;a href="./color/main.pnhtml"&gt;&lt;img src="./img/abc.png" class="color" /&gt; where in class=" abc" &amp; class="color" I have defined the css code for position of my image abc and color respectively. However when I hovre my mouse over the abc image or color image and click it always open color/main.html page even when i click the abc image it open color/main.html page Please Help..!!
type: Question

http://stackoverflow.com/comment/44826011
type: QuestionComment
comment on: http://stackoverflow.com/q/28231723
has text: I am not really sure what your question is, but I think it's worth mentioning that `$resource` returns a promise which means you have to use `then()`. Have a look at this question http://stackoverflow.com/questions/19490560/angularjs-resource-promise
score: 0
type: Comment

http://stackoverflow.com/a/28184910
has comment: http://stackoverflow.com/comment/44739986
score: 0
has body: The following script fires it as soon as it gets visible (http://jsfiddle.net/f1xbgy86/1/): $(window).scroll(function() { if(isElementVisible($('#yourElementID'))) { $(window).off('scroll'); //Call From here } }); function isElementVisible(elem) { var visibleTop = $(window).scrollTop(); var visibleBottom = visibleTop + $(window).height(); return ((elem.offset().top + elem.height()) &lt;= visibleBottom); }
answers question: http://stackoverflow.com/q/28184521
has comment: http://stackoverflow.com/comment/44750224
type: Answer

http://stackoverflow.com/comment/44794705
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28215703
has text: Do this on the server-side. You can do it on the client-side, but since the client can modify the client-side, everything you do on the client side can be bypassed.

http://stackoverflow.com/q/28272359
has comment: http://stackoverflow.com/comment/44900023
tagged with: css
score: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28272452
answer count: 2
has comment: http://stackoverflow.com/comment/44899913
has answer: http://stackoverflow.com/a/28272407
favorite count: 0
has body: I downloaded a chat template online called shout. When I upload the chat template to heroku, it works fine. However, when I simply doubleclick its index.html in my local browser, it doesn't work. The page refreshes every milisecond. Is this an error specific to what I downloaded, or this is a common phenomenon? If so, is there a way around it?
has title: Running complex web apps locally
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28243965
has comment: http://stackoverflow.com/comment/44849465
has body: You can isolate scope using a repeater, and change a property of the repeated item: myApp.controller("Ctrl", function($scope) { $scope.items = [ { href: '', title: 'Home', }, { href: '', title: 'About', }, { href: '', title: 'Contact', } ]; }); Then, you can store a over property on item, and use it to change class: {{item.title}} http://jsfiddle.net/faGTg/41/ Or you can use a simple var for that now, because the ng-repeat directive isolates each item in a new scope: {{item.title}} I think this is better, because styling on hovering is a view concern. Although the solution above sets a hover property in the current scope, the controller does not need to be concerned about this. http://jsfiddle.net/33ypvx3g/
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28243478
score: 1
accepted answer of: http://stackoverflow.com/q/28243478
upvote count: 1

http://stackoverflow.com/comment/44703739
has text: I added my answer. Hopefully the explanation makes sense (the hour is late...)
score: 0
comment on: http://stackoverflow.com/q/28164657
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28137482
has answer: http://stackoverflow.com/a/28138458
accepted answer: http://stackoverflow.com/a/28138458
has comment: http://stackoverflow.com/comment/44647696
possible better answer: http://stackoverflow.com/a/28138401
type: Question
answer count: 2
tagged with: javascript
duplicate of: http://stackoverflow.com/q/13952686
has comment: http://stackoverflow.com/comment/44647214
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28138401
favorite count: 0
has comment: http://stackoverflow.com/comment/44646845
downvote count: 0
tagged with: digit
tagged with: input
linked to: http://stackoverflow.com/q/13952686
type: AnsweredQuestion
score: 1
has body: In html,I want to make input allow digits only. I know there is a onkey(up|press|down) event,but if you tried then you know that one digit that you pressed first will show its face for a second which would not look beautiful. So how to make it(the question in the title)?----that means if you press a non-numeric word with your keyboard,then the input tag respond nothing. I thought to capture the even that a word is produced and about to show its face in input tag, but I didn't find the document about that even.
has title: input tag never show the face of non-numeric words

http://stackoverflow.com/comment/44833101
has text: Can you post a stacktrace?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28234922

http://stackoverflow.com/q/28225925
type: Question
has comment: http://stackoverflow.com/comment/44815325
answer count: 2
has body: I'm using bootstrap in a chrome app and trying to do basic things, like use a dropdown menu. None of the code samples seem to be 'dropping down' after I click on the button. It's just a styled button that seems to have no code triggered off the 'click' event. Bootstrap version: 3.3.1 jQuery version: 2.1.3 My third-party/css and third-party/js directories seem to have the regular and minified versions of bootstrap. I'm not sure if I can get away with only the .min versions. Action Action Another action Something else here Separated link Edit I've isolated that things work when index.html is directly opened by a browser, but the sample simple dropdown example does NOT work when opened within a chrome app. To remove any ambiguity, the example chrome project available on GitHub.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44815354
has comment: http://stackoverflow.com/comment/44848504
score: 0
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/44815308
has title: Bootstrap dropdown menu not working in chrome app
has answer: http://stackoverflow.com/a/35050723
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44851664
has comment: http://stackoverflow.com/comment/44815935
has comment: http://stackoverflow.com/comment/44815287
has comment: http://stackoverflow.com/comment/44815341
has comment: http://stackoverflow.com/comment/44815366
has comment: http://stackoverflow.com/comment/44815107
has comment: http://stackoverflow.com/comment/44815083
has comment: http://stackoverflow.com/comment/44815990
has answer: http://stackoverflow.com/a/28229894

http://stackoverflow.com/comment/44869583
type: AnswerComment
score: 3
type: Comment
comment on: http://stackoverflow.com/a/28255581
has text: `elevators` is an array, `elevator` is going to be the number index of the array (or even other properties of the array object). Since elevator is a number there is no `on` function.

http://stackoverflow.com/q/28123243
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/28123366
upvote count: 1
has body: JS: function getItem() { var rand = Math.floor((Math.random() * 110) + 1); Weapon = "Opening..." document.getElementById("Weapon").innerHTML = Weapon; if (rand < 3) { document.getElementById("Weapon").innerHTML = "Item Type One"; } else if (rand > 2 && rand < 5) { document.getElementById("Weapon").innerHTML = "Item Type Two"; } // Continues onward etc... } HTML: Get Item You Unboxed: Nothing I was wondering if it would be possible to also set the source of an image in this HTML from my Javascript code. So if I get "Item One" it will display that image in my HTML?
accepted answer: http://stackoverflow.com/a/28123293
favorite count: 0
has title: JS Set background image of span
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28123293
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28123366
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/a/60171499
score: 0
answers question: http://stackoverflow.com/q/28235720
type: Answer
has body: I came across this older post while looking for something else. But have you tried simply putting your HTML file onto google Drive, saving it as a Google 'doc', and then using the 'File->Save As->PDF ? It works fine for me. You'll end up with your original HTML file, a Google Doc version, and a PDF version. There might even be an API for this now, I don't know.

http://stackoverflow.com/a/28200933
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28199330
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28199330
upvote count: 2
has body: This code: svg .datum(topojson.feature(world, world.objects.countries)) .append("path") ... says --> I have one piece of data, draw me a path from it. Change it up to this: svg.selectAll(".countries") .data(topojson.feature(world, world.objects.countries).features) .enter() .append("path") ... which says --> I have multiple data (features), bind the data to my selection (selectAll) and draw me a path for each component. Example here.
type: AcceptedAnswer

http://stackoverflow.com/a/28232153
type: Answer
answers question: http://stackoverflow.com/q/28232112
upvote count: 1
has body: Try this printers[index] = { myfunc : function (name) { return function(titi, tata) { console.log("name: " + name); } }(obj.name) } Example
score: 1
downvote count: 0

http://stackoverflow.com/a/28170549
score: 3
has body: ES6 style is a new standard and I would expect it to become a preferred way of declaration in future. I'd stick to this one in new projects. However, according to documentation: progress/notify callbacks are not currently supported via the ES6-style interface. So if you can live without those, use constructor-style. If not, use the standard syntax.
upvote count: 3
answers question: http://stackoverflow.com/q/28170461
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28170461
type: Answer
downvote count: 0

http://stackoverflow.com/q/28158884
has comment: http://stackoverflow.com/comment/44689192
has comment: http://stackoverflow.com/comment/44689181
tagged with: http
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44689437
tagged with: javascript
has comment: http://stackoverflow.com/comment/44689115
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28167571
type: UnansweredQuestion
has title: HTTP GET request with JQuery
tagged with: xmlhttprequest
has body: First of all, I am VERY new with JS so sorry for the simple question. I have a search box in a webpage which the user should type some input into it. After that, I need to perform a HTTP GET request to some address (say: http://m.mywebsite.com/AppService.svc/searchitems?param=userValue when the param parameter is the user input (in the below sample it is John Doe). So far I tried with this way, but nothings happen when I click somewhere in the webpage. Hope some of you can explain me how to do it right. Thanks $(document).ready(function(){ document.addEventListener("click", function(e) { $.ajax({ 'url' : 'http://m.mywebsite.com/AppService.svc/searchitems', 'type' : 'GET', 'data' : { 'param' : 'John Doe' }, 'success' : function(data) { if (data == "success") { alert('request sent!'); } } }); }); });
has comment: http://stackoverflow.com/comment/44689204
has answer: http://stackoverflow.com/a/28159108

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/28183765
tags question: http://stackoverflow.com/q/28234004
tags question: http://stackoverflow.com/q/28136410
tags question: http://stackoverflow.com/q/28175276

http://stackoverflow.com/comment/125447738
comment on: http://stackoverflow.com/a/28265856
score: 0
type: AnswerComment
type: Comment
has text: What about no-referrer policy ? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#:~:text=Directives-,no%2Dreferrer,-The%20Referer%20header

http://stackoverflow.com/comment/44814965
has text: @crashwap Sure, I mean it's a good idea to avoid `eval()` in general if this is user input in any way, as it's possible to be abused.
type: AnswerComment
comment on: http://stackoverflow.com/a/28225139
score: 0
type: Comment

http://stackoverflow.com/a/28271865
answers question: http://stackoverflow.com/q/28271829
score: -1
accepted answer of: http://stackoverflow.com/q/28271829
has comment: http://stackoverflow.com/comment/44899828
type: AcceptedAnswer
has body: I got it! /* Defines a bunch of global variables and settings */ settings.js module.exports = { load : function() { express = require("express"); // Express JS logfmt = require("logfmt"); // Heroku key-value logger mongoose = require('mongoose'); // DB simplifier passport = require('passport'); // Authentication flash = require('connect-flash'); // Flash Messages port = Number(process.env.PORT || 5000); // Locally uses port 5000, else uses port of server configDB = require('./config/database.js'); cookieParser = require('cookie-parser'); bodyParser = require('body-parser'); session = require('express-session'); app = express(); //Express for server } }; server.js var settings = require("./settings"); settings.load(); // :D
has comment: http://stackoverflow.com/comment/44899619
type: Answer
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/44899063

http://stackoverflow.com/comment/44624558
has text: use other variable then rating in ng-repeat. Updated my answer.
type: Comment
comment on: http://stackoverflow.com/a/28125416
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44765794
comment on: http://stackoverflow.com/q/28198490
has text: You have probably misunderstood the question in the paper. It seems to ask about formatting tools *in HTML*. JavaScript is not HTML. Neither is CSS. So the question appears to be about so-called presentational features in HTML (which is a complicated and controversial topic; e.g. `` is presentational, for bolding, but HTML5 pretends to define it as “semantic” and not presentational).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28197711
has comment: http://stackoverflow.com/comment/44772909
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28197358
has body: You'll need to do another query, but it's not very hard. Population only works on a query, and I don't believe that there is a convenience hook for such cases. var User = mongoose.model('User'); TopicSchema.pre('save', function(next) { var self = this; User.findById( self.user, function (err, user) { if (err) // Do something var usersTime = moment().tz(user.timezone).hours(0).minutes(0).seconds(0).milliseconds(0); // Reset the time to midnight var nextNotifyDate = usersTime.add(1, 'days').seconds(self.timeOfDay); // Add a day and set the reminder self.nextNotificationDate = nextNotifyDate.utc(); next(); }); });
has comment: http://stackoverflow.com/comment/133249481
answers question: http://stackoverflow.com/q/28197358
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44772490
upvote count: 3

http://stackoverflow.com/comment/44725514
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28178113
type: AnswerComment
has text: There's also another way of dealing with this. Having a common class say `modal` for all buttons and a separate div `content-div`. We can have a single overlay object wrapping `content-div`and replacing html with other second divs like `first-div, second-div & third-div`, but you should take care of changing the html cleverly just before opening the overlay. Well that takes some time and some proper testing :)

http://stackoverflow.com/q/28254023
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44866845
type: Question
has body: I am a beginner in programming so don't be too hard on me if I have asked this question wrong or if this problem has a really simple solution. StackOverflow is my last resort. The chemical symbol doesn't show up, I am pretty sure that it is a problem with my event caller but can't be sure. I also doubt my if statements are correct. I have left the code below, it would be great if you'd be able to point out other issues or possible improvements as well. [Code and question have been updated] Calculating Moles Mole Calculator Enter the names of the two elements you would like the calculator to evaluate. Remember to capitalize the first letter of the name of your element/s. Element 1: (optional) Element 2: Chemical Symbol: Number of Moles: grams
score: -2
tagged with: dictionary
downvote count: 2
has title: Event caller doesn't appear to be working
answer count: 1
has answer: http://stackoverflow.com/a/28254078
tagged with: object
has comment: http://stackoverflow.com/comment/44866750
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44866736

http://stackoverflow.com/comment/44877170
score: 0
comment on: http://stackoverflow.com/a/28259633
has text: Check out this jsfiddle http://jsfiddle.net/L0v5ftrd/ press 'try it' and then resize the lower right window and press 'try it' again' this gets the browsers height and width and stores them into variables. From here you can take those variables, and say `if((w==1366) && (h==768)){ alert("true"); }else{ alert("false"); }` and change the alerts to your desired code
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28169692
answers question: http://stackoverflow.com/q/28168914
accepted answer of: http://stackoverflow.com/q/28168914
has body: I found the problem. I set the view's el as tbody (I would like to have all the books listed inside a table). If I set the el to body it works. It seems that we have to set a exclusive View to the form, and another one to the list (table).
type: Answer
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28190200
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44753861
has body: Here, i have used chartist js for area chart. Each currency having the different value. I have stored each currency value in each variable. After ajax call i added value like that var arrVal = $('#changeCurrency a').attr('id',' ');. But its not pointing currectly. When i given like that var arrVal = dataCur11 means it coming fine. What is the solution for this problem? HTML UAE USD SGD INR POUND JS $(document).on('click', '#changeCurrency a', function(){ $.ajax({ url: 'partials/graph.html', method: 'GET', success: function (data, supportsForeignObject) { $('#graphContainer').html(''); $('#graphContainer').append(data); $('#chart-loader').fadeOut(); var dataCur11 = [50, 53, 54, 52, 56, 55, 53, 50], dataCur21 = [20, 53, 34, 42, 26, 55, 53, 50], dataCur31 = [40, 53, 24, 32, 56, 35, 53, 56], dataCur41 = [50, 33, 54, 30, 22, 20, 30, 52], dataCur51 = [20, 33, 54, 30, 22, 20, 30, 52]; var arrVal = $('#changeCurrency a').attr('id',''); // Support var supportsForeignObject = document.implementation.hasFeature("www.http://w3.org/TR/SVG11/feature#Extensibility","1.1"); if(supportsForeignObject) { var labelsVal = [22+" Dec'14", 24+" Dec'14", 26+" Dec'14", 28+" Dec'14", 30+" Dec'14", 1+" Jan'15", 3+" Jan'15", 5+" Jan'15"] } else { var labelsVal = [22+" Dec'14", 24+" Dec'14", 26+" Dec'14", 28+" Dec'14", 30+" Dec'14", 1+" Jan'15", 3+" Jan'15", 5+" Jan'15"]; } setTimeout(function(){ $('.val-pos').addClass('current-pos'); new Chartist.Line('.ct-chart', { labels: labelsVal, series:[arrVal] }, { axisY: { offset: 35, scaleMinSpace: 60 }, low: 0, showArea: true }); }, 1000); } }); });
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has title: How to print array value to variable?
has comment: http://stackoverflow.com/comment/44780314
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44787932
has comment: http://stackoverflow.com/comment/44748468
has comment: http://stackoverflow.com/comment/44748381
has answer: http://stackoverflow.com/a/28190478
has comment: http://stackoverflow.com/comment/44787839
has comment: http://stackoverflow.com/comment/44836174
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44748197
favorite count: 0
accepted answer: http://stackoverflow.com/a/28190478
tagged with: ajax

http://stackoverflow.com/a/28178309
downvote count: 0
score: 2
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28178270
has body: .value returns value from input, in your case, you try convert DOMNode to Integer that will return NaN var x = parseInt(document.getElementById("num").value); Example
type: Answer
answers question: http://stackoverflow.com/q/28178270

http://stackoverflow.com/q/28174008
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44717329
has title: How do I pass on the user input to a other textarea?
type: Question
tagged with: javascript
tagged with: forms
has body: I have got two input field. Don't know how to pass on the user input from the first to the second, so that it simultaneously will add the same text. Can somebody help me out? 1. How should the perfect world look like? In a perfect world (Input from frist form goes here) @TwitterName #HASHTAG
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28174231

http://stackoverflow.com/comment/44955721
comment on: http://stackoverflow.com/q/28199688
has text: Send the image back to your server and use GD or ImageMagick libraries to resize. (PHP) You could also look at cloud services like Amazon's SWF. I don't know of any Javascript libraries that are going to make this happen on the client side.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28182392
tagged with: export-to-excel
type: Question
linked to: http://stackoverflow.com/q/25730008
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28221301
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44741987
has title: Exporting page to Excel xslx
has comment: http://stackoverflow.com/comment/44741981
has comment: http://stackoverflow.com/comment/44740632
type: UnansweredQuestion
tagged with: excel
has body: i am tring to export a table from a page to excel sheet. I found a piece of code and it works fine but downloaded file is saved on xls, how can i make it to be save on xlsx? I have problem with turkish characters too, while saving a table, turkish characters are not saved, my piece of code that i found on internet : var tableToExcel = (function() { var uri = 'data:application/vnd.ms-excel;base64,' , template = ' <!--[if gte mso 9]> <x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook> <![endif]--> {table} ' , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML} window.location.href = uri + base64(format(template, ctx)) } })()
has comment: http://stackoverflow.com/comment/44741758

http://stackoverflow.com/comment/44847719
type: AnswerComment
has text: He's dead on. The ng-disabled directive expects an expression already, so by adding the {{ }}, you're just passing in the string value "true" or "false". https://docs.angularjs.org/api/ng/directive/ngDisabled
type: Comment
comment on: http://stackoverflow.com/a/28243413
score: 0

http://stackoverflow.com/comment/44794309
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28215501
has text: The element has an ID of `submit` which is a bad idea, and a class of `button`

http://stackoverflow.com/q/28219834
has comment: http://stackoverflow.com/comment/44803395
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
answer count: 1
has body: I recently 'upgraded' from JQuery 1.3 (I know, I know, this project is 6 years old and I'm taking it over from another developer in hopes to get it done...properly) to 1.11.2, using JQuery Migrate v1.2.1 since going version to version might take me the rest of my life. Anyways, I'm coming across minimal issues, most of which I am able to repair, however this one stumps me. The following code works perfectly fine in 1.5.1, but throws this error in 1.11.2 "Cannot call methods on dialog prior to initialization; attempted to call method 'destroy'". Here is the code: $(document).ready(function() { setupEvents(); }); function setupEvents() { $('.dmr-id').click(function(e) { e.preventDefault(); loadConsumerServiceDialog(); }); function loadConsumerServiceDialog() { $('#consumer-service-dialog').dialog("destroy"); $('#consumer-service-dialog').dialog("open"); $('#consumer-service-dialog').dialog({ modal: true, height: 740, width: 1000, title: 'Consumer Service Detailed Relations', resizable: false }); } If I add comment out the 'destroy' method, it throws the same error on the 'open' method. It seems like an obvious error, the dialog is not initialized, but how could it be initialized prior to opening? I don't see why it is being thrown in 1.11.2 and not the other versions. Any help would be greatly appreciated, I am not opposed to figuring it out myself if someone could point me in the right direction. Thanks!
has comment: http://stackoverflow.com/comment/44803516
favorite count: 0
tagged with: jquery-ui-dialog
has answer: http://stackoverflow.com/a/28220087
accepted answer: http://stackoverflow.com/a/28220087
upvote count: 2
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44803539
score: 1
has comment: http://stackoverflow.com/comment/44803365
has title: JQuery 1.11.2 cannot call methods on dialog prior to initialization; attempted to call method 'destroy'
has comment: http://stackoverflow.com/comment/44802968
type: Question

http://stackoverflow.com/q/28162381
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28162781
has title: how to maintain state in Collapse Jquery
has body: I have problem on my side bar collapsible menu. when the user click on sub link on the menu the page will refresh and lost the highlight of selected sub item link and parent link item side nav bar and reset it.what I'm trying to do is to man maintain states of side bar collapsible sub item and highlight when the all page refresh ? html Test 1 Item 1 Item 2 Item 3 Test 2 Item 1 Item 2 Item 3 Item 4 Item 5 Jq $(document).ready(function () { $('#active li ul').hide(); $('#active > li > a').click(function () { if ($(this).attr('class') != 'active') { $('#active li ul').slideUp(); $(this).next().slideToggle(); $('#active li a').removeClass('active'); $(this).addClass('active'); } }); }); css .menu_div ul { padding:0px; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:15px; color:#FFF; list-style:none; text-indent:15px; } .menu_div ul li { background:#3f3f3f; line-height:28px; border-bottom:1px solid #333; } .menu_div ul li a { text-decoration:none; color:#FFF; display:block; } .menu_div ul li a:hover { background:#ff850d; } .menu_div ul li#active { background:#ff850d; }
type: Question
has comment: http://stackoverflow.com/comment/44696335
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28162781
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/44766243
type: Comment
has text: Also, you may want to check out http://stackoverflow.com/questions/8404806/where-is-the-preview-tab-on-aptana-studio-3 and/or http://stackoverflow.com/questions/6727704/aptana-how-to-active-preview - maybe they can help you
comment on: http://stackoverflow.com/q/28183393
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44888331
comment on: http://stackoverflow.com/a/28265435
type: Comment
score: 0
type: AnswerComment
has text: When the application excutes, cb() is not a function nor passed in, how can I avoid errors with this outside the test?

http://stackoverflow.com/comment/44674458
has text: @epascarello Hm, any other way of doing that ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28151422

http://stackoverflow.com/comment/44838445
type: Comment
type: QuestionComment
has text: LOL, no worries, hope it's working now?
comment on: http://stackoverflow.com/q/28237338
score: 0

http://stackoverflow.com/comment/44744016
score: 0
has text: @RedCricket Using `onclick="<scripts here>"` is bad form. Use `addEventListener` as described in this answer - that way you can change your Javascript any any time without having to update your HTML.
type: Comment
comment on: http://stackoverflow.com/a/28187780
type: AnswerComment

http://stackoverflow.com/q/28241124
tagged with: checkbox
type: AnsweredQuestion
type: Question
has body: I've wrote something using JsPlumb Library. I got three elements that start using `display:none;` and then i use the typical Jquery code for make them appear flagging a checkbox: input type="checkbox" id="nameCB" name="nameCB" value="on" $('#nameCB').click(function(){ this.checked?$('#elementID').show(1000):$('#elementID').hide(1000); My problem is if i set an anchor for one of these elements: jsPlumb.addEndpoint('elementID', {anchor:"BottomCenter" }, endpointOptions ); the anchor (in the default case is a gray circle) is always visible. I would like to make it visible ONLY when the element it is connected is visible. UPDATE: I solved creating a connection only when the checkbox is flagged an detaching it otherwise: $('#ckFI').click(function(){ this.checked?$('#firenze').show(1000):$('#BBB').hide(1000); this.checked?apparizione():scomparsa(); }); function apparizione() { jsPlumb.connect({ source:"AAA", target:"BBB", anchors:["Top", "Bottom" ], }); } function scomparsa() { jsPlumb.detach({source:"AAA", target:"BBB"}); }
tagged with: javascript
tagged with: jquery
tagged with: jsplumb
tagged with: show-hide
has answer: http://stackoverflow.com/a/28413337
accepted answer: http://stackoverflow.com/a/28413337
score: 0
answer count: 1
has title: JQuery / JsPlumb: toggle "hidden/visible" anchor with checkbox starting from Hidden

game-loop
tag name: game-loop
tags question: http://stackoverflow.com/q/28262448
type: Tag

http://stackoverflow.com/q/28204360
favorite count: 0
tagged with: shadow-dom
has comment: http://stackoverflow.com/comment/45290381
score: 2
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: polymer
tagged with: google-plus-one
has title: Google Plus Button and Polymer
has body: I am working on a Polymer application and I am having trouble adding a Google Plus (+1) button to the page. It seems the javascript for creating the button is not compatible with shadow DOM. I am trying to add this element deep inside several shadow DOMs as this is a large application. Using the normal method of adding the button to the page just does nothing &lt;script src="https://apis.google.com/js/platform.js" async defer&gt;&lt;/script&gt; &lt;g:plusone&gt;&lt;/g:plusone&gt; This, and any other method where the script auomatically tries to find the element do nothing. This is because the query selecter being used by the script doesn't look within the shadow DOM. Now explicitly rendering the button works.... sort of &lt;script src="https://apis.google.com/js/platform.js"&gt; {parsetags: "explicit"} &lt;/script&gt; &lt;div id="gplus" class="g-plusone"&gt;&lt;/div&gt; Then in the script for the parent element gapi.plusone.render(this.$.gplus,{href : "THE URL"}); The button shows up properly, and it almost works. When you click it, it does add 1 and opens the internal dialog to add a comment. But its broken, the dialog size is wrong, and when it tries to load information about the url it just loads forever, and most of the interface in the dialog doesn't work. You get an error in the console too cb=gapi.loaded_0:91 Uncaught TypeError: Cannot read property 'src' of null That line is window.document.getElementById(a) Obviously that wont work with Shadow DOM because the document of the window will be the top level of the DOM and it won't find the actual element. It's weird that Google would do this and look all the way up from the window document when I gave them the only element they would ever need to touch when I called the render function. If I put all this in a separate document and load it in via an iframe (that's what I did for the facebook one) I loose functionality because it tries to open the internal dialog inside the tiny iframe and it's unusable. Does any…
tagged with: javascript
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/30778784

http://stackoverflow.com/comment/44918938
comment on: http://stackoverflow.com/q/28272564
has text: When you say _"names are dynamically generated"_, what exactly do you mean? Are they generated on the server (by PHP, etc.) when the page is constructed OR are they generated after the page was constructed using jQuery DOM manipulation techniques?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/54476904
has body: The whole goal of gcstats is to give metrics on memory usage that are more meaningful that simple sampling of RSS size of the heap. Here are what the output fields above mean: num_full_gc is the number of full mark and sweep garbage collection runs that have occurred since the first time gcstats was required. num_inc_gc is the number of times that V8 has performed incremental garbage collection, referred to within V8 as scavenge GC. heap_compactions is the number of times, after a full GC, V8 has actually compacted the heap and free'd allocated memory. usage_trend is a signed magic number that tells the recent percentage change in your heap. This number will be described later. estimated_base is an estimate of the minimum amount of JavaScript heap memory your program uses. That is, over the last several heap compactions, how small did heap shrink to on average. min from the beginning of time, what was the minimum amount of memory your process has used. max same as above, but for maximum. Credits goes to lloyd hilaiel - http://lloyd.io/is-my-nodejs-program-leaking
upvote count: 1
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28142807

http://stackoverflow.com/comment/44651669
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28139962
has text: Here you have managed to change all values. What specific value do you want to change? You also do understand that you are actually not using an array. You are using basic JavaScript objects. So your `array` is an object with properties `name` and `inside`. `inside` then is another object.

http://stackoverflow.com/comment/44804659
type: QuestionComment
comment on: http://stackoverflow.com/q/28220431
has text: correct Jonathan i've added to the original description with the terminology you used. Thanks.
score: 0
type: Comment

http://stackoverflow.com/comment/44781522
comment on: http://stackoverflow.com/a/28207979
has text: if i console log or use alert on urls, the same thing is returned like attachment.url :) anyways thanks again,any better solution?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44838889
has text: I'll try to ceate the simpliest [mvce] example. thank you again!
type: Comment
comment on: http://stackoverflow.com/q/28235533
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44630272
type: QuestionComment
has text: No disagreement there. The lexical environment (what variables can be accessed) is determined at compile time. The lifetime of those environments (which is what I think of as scope objects) is influenced by the running code at runtime. Your use of the term "scope" caused me to think of the runtime objects that JS uses which are more dynamic than a fixed tree. The possible lexical environment is a fixed tree.
score: 0
comment on: http://stackoverflow.com/q/28128368
type: Comment

http://stackoverflow.com/a/28211182
has comment: http://stackoverflow.com/comment/44794978
has comment: http://stackoverflow.com/comment/44794845
has comment: http://stackoverflow.com/comment/44789548
score: 0
accepted answer of: http://stackoverflow.com/q/28210179
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28210179
has comment: http://stackoverflow.com/comment/44795394
type: Answer
has comment: http://stackoverflow.com/comment/44787188
has body: overlapping occur because $(window).load() function execute after your cookie function. If you not require $(window).load() then use $(document).ready(). &lt;script type="text/javascript"&gt; $(document).ready(function(){ var timer = window.setTimeout(function(){$('#myModal').modal('show');},3000); $('.bs-docs-sidebar').affix({ offset: { top: 10 } }) if($.cookie('pop') == null) { $('#myModal').modal('show'); $.cookie('pop', '7'); } $('#deleteCookie').click(function() { $.cookie('pop', null); window.location.reload(); }); }); &lt;/script&gt; Here i am not use load function if you need then you can use it.

server-communication
tags question: http://stackoverflow.com/q/28234311
type: Tag
tag name: server-communication

http://stackoverflow.com/comment/44789887
has text: Just tested in Chrome Canary - it works for the first call, however you have to click "Step into" five times to get to the first line.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28201351
score: 0

http://stackoverflow.com/comment/44803707
comment on: http://stackoverflow.com/q/28212411
has text: What do you actually get back from grp.top(Infinity)? I think you'll see all keys, but only groups with keys 6.4 and 5.9 should have a value of 1. The others should have values of 0. Also, you have a typo in your magDim definition, but I expect that's not in your actual code or nothing would work.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28236701
has body: $( "#mapsec" ).show( "slow" ); This should ease the div in nicely instead of: div.style.display = "block";
answers question: http://stackoverflow.com/q/28236608
score: 0
type: Answer

http://stackoverflow.com/a/28146537
has comment: http://stackoverflow.com/comment/44665995
has comment: http://stackoverflow.com/comment/44665513
has comment: http://stackoverflow.com/comment/44666182
score: 1
answers question: http://stackoverflow.com/q/28146476
has comment: http://stackoverflow.com/comment/44665757
downvote count: 0
has comment: http://stackoverflow.com/comment/44665908
has body: Doing refresh to the whole page will run the whole script again so there is 2 possible solutions Using ajax request to load the new price and there are a lot of libraries that can help you with that such as JQuery If you have to refresh the page and you have server side code, Then save the old value in a hidden field and update your server side and client side logic to consider having value inside the hidden field.
type: Answer
has comment: http://stackoverflow.com/comment/44665160
upvote count: 1

http://stackoverflow.com/comment/44756929
score: 0
type: AnswerComment
type: Comment
has text: Using `onstart="validateRule(#{bean.dtRules.rowIndex}); "` gives `rowIndex` value of -1.
comment on: http://stackoverflow.com/a/28194838

http://stackoverflow.com/comment/44644831
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28134641
has text: `kpilhus` you can check the answer posted now . Cheers

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/28191206
tag name: openlayers-3
tags question: http://stackoverflow.com/q/28239571
tags question: http://stackoverflow.com/q/28140904

http://stackoverflow.com/a/35504140
downvote count: 0
score: 1
has body: Suppose following is your html: &lt;div class="rateit bigstars" data-rateit-starwidth="32" data-rateit-starheight="32" data-value="0.0" data-step="1.0" data-rateit-min="0" data-rateit-max="5" id="customer_rating"&gt;&lt;/div get selected value: $('#customer_rating').rateit('value'); set value: $('#customer_rating').rateit('value', 2) reset: $('#customer_rating').rateit('reset');
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28240064

http://stackoverflow.com/q/28148545
has comment: http://stackoverflow.com/comment/44682353
has comment: http://stackoverflow.com/comment/44690291
has comment: http://stackoverflow.com/comment/44668501
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44668446
downvote count: 1
tagged with: mathjax
score: -1
has title: MathJax Test Page Warning
has comment: http://stackoverflow.com/comment/44669310
has comment: http://stackoverflow.com/comment/44673612
type: Question
has body: I download the latest MathJax package, and deploy it in my own website(IIS). I include the js file in index.html file as below: But things are weird that there's warning like below: I change the code, use the online js, like below: Everything seems ok. What confuse me is that I just only change the include file. I notice that there's a hint when I load the page Web-Fonts not available -- using image fonts instead But I don't know why. So does anyone can tell me what happened?
upvote count: 0
has comment: http://stackoverflow.com/comment/44669460
answer count: 1
tagged with: javascript
tagged with: web
has comment: http://stackoverflow.com/comment/44674002
favorite count: 0
tagged with: latex
has comment: http://stackoverflow.com/comment/44669475
has answer: http://stackoverflow.com/a/28168148

http://stackoverflow.com/comment/44678967
score: 0
type: AnswerComment
type: Comment
has text: when select pick up the textarea is still required :(
comment on: http://stackoverflow.com/a/28153355

http://stackoverflow.com/q/28228909
has title: Multiple Button function
tagged with: javascript
tagged with: ajax
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http-redirect
has answer: http://stackoverflow.com/a/28229403
has body: I have 2 main interface file there are Admin.aspx and Index.aspx. these 2 files are connected to 1 same file, is seatbook.js. A javascript file that manipulate data from interaction from Interface. in admin.aspx and Index.aspx has a button "booked" this button that I want to hava multiple function. When I run from Admin.aspx and click "booked" button then I'll redirect to ForAdmin.aspx file. If I run from Index.aspx then I'll redirect to ForUser.aspx I took redirect link code on a method on seatbook.js file. this is my following code. &lt;input type="button" name="submit" class="ui-state-default ui-corner-all" onclick="ShowArrData()" value="Book Seat" /&gt; above is my button code on admin.aspx either index.aspx function ShowArrData() { for (var i = 0; i &lt; o.length; i++) { seatname = o[i].Name; console.log(seatname); time = jQuery('#timepicker_7').val(); console.log(time); console.log("hallo"); var url = "ForAdmin.aspx?noSeat=" + encodeURIComponent(lObjSeat[0].Name) + "&amp;endtime=" + encodeURIComponent(time); window.location.replace(url); // alert(url); } } (let's forget about looping code. it's nothing) the code above is my method I called when I click button "booked" var url = "ForAdmin.aspx?noSeat=" + encodeURIComponent(lObjSeat[0].Name) + "&amp;endtime=" + encodeURIComponent(time); window.location.replace(url); that's how I did redirect link. with 2 parameters. I want make it multiple redirect depends on where do you run your program. Is it possible ? UPDATE: After first answer I edited my question, to make it clear as like my problem before showarrdata(), when I click "booked" button, i'll call book_tickes() method, then after that it'll show dialog box then go to showarrdata(); function book_tickets() { var tickets = jQuery('.seat.selected').length; if(tickets==0) { alert('Please select at least one seat to continue...!'); return false; }else { x = jQuery('.seat.selected').toArray(); jQuery('#seat-form-data').html(''); jQuery('.seat.selected').each ( func…
type: Question
tagged with: c#

http://stackoverflow.com/a/35134088
type: Answer
has body: I tried @Kadi's fix of adding a slash, and it worked, but a more elegant solution for me was to change the request from GET to POST, which also fixed the issue. Still not sure what the root cause was.
answers question: http://stackoverflow.com/q/28197528
score: 0

http://stackoverflow.com/q/28275101
has comment: http://stackoverflow.com/comment/44905559
has comment: http://stackoverflow.com/comment/44906735
answer count: 0
has title: ie7 evalJSON not working
type: UnansweredQuestion
has body: I am trying to place a recent pages widget on wordpress. i created the js myself. on IE7 it always breaks. I have included json2,json3,prototype.js. my code is below var newRecentlyViewed = function(opts) { var that = {}; var opts = opts || {}; var cookieName = opts.cookieName || 'recently-viewed'; var popupId = opts.popupId || 'recently-viewed-popup'; var maxRecent = opts.maxRecent || 5; var cookieLifeHours = opts.cookieLifeHours || (24 * 0 * 0); /* 24 hours * 30 days * 24 months = 2 years */ var futureDate = function(nHours) { var expire = null; if (nHours != null &amp;&amp; nHours != 0) { var today = new Date(); expire = new Date(); expire.setTime(today.getTime() + 3600000 * nHours); } return expire; }; var setCookie = function(name, value, path, domain, secure, nHours) { var expires = futureDate(nHours); var curCookie = name + "=" + escape(value) + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((expires) ? "; expires=" + expires : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; }; var getCookie = function(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); }; var recent = function() { var cookie = getCookie(cookieName); var recentlyViewed = []; if (cookie != null) { recentlyViewed = cookie.evalJSON(); } return recentlyViewed; }; var remember = function(recentObj, uniqueKey) { var recently = recent(); var now = new Date(); now = now.getTime(); var i; var dup_idx = -1; for (i = 0; i &lt; recently.length; i += 1) { if (recently[i][uniqueKey] == recentObj[uniqueKey]) dup_idx = i; } if (dup_idx &gt; -1) recently.splice(dup_idx, 1); recently.push(recentObj); if (recently.length &gt; maxRecent) { recently.splice(0, recently.length - maxRecen…
has comment: http://stackoverflow.com/comment/44905247
has comment: http://stackoverflow.com/comment/44907107
has comment: http://stackoverflow.com/comment/44909532
tagged with: prototypejs
has comment: http://stackoverflow.com/comment/44910960
tagged with: http://stackoverflow.com/tag/json
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/44905432
has comment: http://stackoverflow.com/comment/44905015
has comment: http://stackoverflow.com/comment/44905767
tagged with: internet-explorer-7
tagged with: javascript
has comment: http://stackoverflow.com/comment/44905229
has comment: http://stackoverflow.com/comment/44909437
has comment: http://stackoverflow.com/comment/44910747
score: 0

http://stackoverflow.com/q/28268847
downvote count: 0
tagged with: tampermonkey
linked to: http://stackoverflow.com/q/24719256
has answer: http://stackoverflow.com/a/28372948
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/44896529
tagged with: javascript
tagged with: greasemonkey
answer count: 1
linked to: http://stackoverflow.com/q/25778469
favorite count: 0
has title: GM_openInTab (or any other GM_ function) is not defined?
accepted answer: http://stackoverflow.com/a/28372948
score: 8
has body: When my GM script does this: var curTab = GM_openInTab(url); it results in a 'GM_openInTab is not defined' JavaScript error in the Browser Console. I also tried using var curWin = window.open(url); instead of GM_openInTab but it had no affect. What I'm trying to do with this GM script is: for a given website (domain name), go through a list (array) of URLs on this domain and look for items of interest. What's wrong with my code or approach? I'm using Greasemonkey 2.3 with Firefox 33.1.1 and Windows XP 32-bit.
type: AnsweredQuestion

http://stackoverflow.com/comment/44653242
has text: This seems to be an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Please tell us what you're actually trying to accomplish.
score: 4
comment on: http://stackoverflow.com/q/28140806
type: Comment
type: QuestionComment

nude.js
tags question: http://stackoverflow.com/q/28174239
type: Tag
tag name: nude.js

http://stackoverflow.com/a/28150799
answers question: http://stackoverflow.com/q/28150760
type: Answer
downvote count: 0
score: 1
has body: I suppose you need the this reference along with some hack kind of thing $('[class*=vespa]').on('click', function(e){ $(this).vesta(+(this.className.match(/vespa(\d+)/)[1])) }); Here, we capture elements which have a class that matches at least vespa and then we use some bit of regex to match the digits after vespa and + unary operator changes the String version of numbers into actual numbers.
upvote count: 1

http://stackoverflow.com/comment/44704676
type: Comment
type: QuestionComment
has text: @UweKeim - because JSFiddle is not running on the ASP.NET application. But still, the confirm should be displayed.
comment on: http://stackoverflow.com/q/28167265
score: 0

http://stackoverflow.com/q/28246836
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44854324
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44855790
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28248425
has comment: http://stackoverflow.com/comment/44854310
has body: I'm somewhat new to angular and have come across a very weird problem, I'm sure others have too. Let's say that this is the code for my button: Check-In So, basically if either type is 0 or code is nothing (no text), then this button will be disabled. Now's here where my problem starts: If I load the page with type = 0 and code = '', then sure enough it's disabled. If, I change both of these values then of course the button will be enabled. However, if I change the values back to 0 and '', then the button won't become disabled again. I know for a fact that the values are in fact 0 and '' as I've printed their values out on the page. What could be causing ng-disabled to not run the expression again?
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44855235
linked to: http://stackoverflow.com/q/21882681
has comment: http://stackoverflow.com/comment/44854969
has title: AngularJS - bug with ng-disabled? Not updating with new values
upvote count: 5
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/44854376
accepted answer: http://stackoverflow.com/a/28248425
tagged with: validation

http://stackoverflow.com/comment/44689113
score: 0
type: QuestionComment
type: Comment
has text: Works here http://jsfiddle.net/8mn85bd8/. What errors are you getting in the console? Are you testing your code on a server, or locally by opening the file off your PC in a browser?
comment on: http://stackoverflow.com/q/28158904

http://stackoverflow.com/a/28215029
accepted answer of: http://stackoverflow.com/q/28214955
score: 1
answers question: http://stackoverflow.com/q/28214955
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: Try use .bind return "abcdefgh".replace(/[abc]/g, this.func_b.bind(this)); Or store reference to this, func_c: function() { var _this = this; return "abcdefgh".replace(/[abc]/g, function (char) { return _this.func_b(char); }); } Example - 1 Example - 2

http://stackoverflow.com/a/28185476
answers question: http://stackoverflow.com/q/28185131
type: Answer
has body: hope this help you.. // Browser with version Detection navigator.sayswho= (function(){ var N= navigator.appName, ua= navigator.userAgent, tem; var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); if(M &amp;&amp; (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?']; return M; })(); var browser_version = navigator.sayswho; alert("Welcome to " + browser_version); check out the working fiddle ( here )
score: 0

http://stackoverflow.com/q/28196627
has comment: http://stackoverflow.com/comment/44760274
score: -1
has title: Using javascript to replace the html content
accepted answer: http://stackoverflow.com/a/28196894
downvote count: 2
upvote count: 1
answer count: 1
has body: I am trying to replace the content of id='js' with javascript, but this is not working for me. here is the code. Result Here
has comment: http://stackoverflow.com/comment/44760270
tagged with: javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44759830
has comment: http://stackoverflow.com/comment/44759983
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44760141
has answer: http://stackoverflow.com/a/28196894
tagged with: http://stackoverflow.com/tag/html

focus
tags question: http://stackoverflow.com/q/28280022
tags question: http://stackoverflow.com/q/28184099
tags question: http://stackoverflow.com/q/28196560
type: Tag
tag name: focus

http://stackoverflow.com/a/28304510
upvote count: 3
answers question: http://stackoverflow.com/q/28247207
score: 3
has body: Substring will work as well var username = email.substring(0, email.indexOf(&quot;@&quot;));
downvote count: 0
type: Answer

http://stackoverflow.com/q/28270195
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28270210
upvote count: 0
answer count: 1
favorite count: 0
has body: I'm trying to do a formValidation for JavaScript, everything is working but I'm facing a problem now with the length. It actually works and give me the alert, but never pass it when I put 8 or more characters in the password field. I'm sure there is a small mistake that I need to be aware of, please advice! if(!document.getElementById("username").value) { alert("Username field is required!"); return false; } if(!document.getElementById("password").value) { alert("Password field is required!"); return false; } if(!document.getElementById("password").length &lt; 8); { alert("Password should contain at least 8 characters!"); return false; }
has title: JavaScript form validation, string length
accepted answer: http://stackoverflow.com/a/28270210

http://stackoverflow.com/comment/44809653
type: Comment
type: QuestionComment
has text: Wouldn't it be a better use of your time to be a more engaging teacher so that the students actually want to come to class?
comment on: http://stackoverflow.com/q/28222332
score: 0

http://stackoverflow.com/a/28145039
score: 2
answers question: http://stackoverflow.com/q/28134271
has comment: http://stackoverflow.com/comment/44678474
has comment: http://stackoverflow.com/comment/44675095
has comment: http://stackoverflow.com/comment/44664483
downvote count: 0
has body: If all you're trying to do is count to 7 with promises, then this will do it: function f(p, i) { return p.then(function() { return new Promise(function(r) { return setTimeout(r, 300); }); }) .then(function() { console.log(i); }); } var p = Promise.resolve(); for (var i = 0; i &lt; 8; i++) { p = f(p, i); } p.then(function() { console.log('fin'); }) .catch(function(e) { console.log(e.message); }); Looping with promises is hard, because it's almost impossible not to fall into JavaScript's closures in a loop trap, but it is doable. The above works because it pushes all use of .then() into a sub-function f of the loop (i.e. away from the loop). A safer solution, that I use, is to forgo loops altogether and seek out patterns like forEach and reduce whenever I can, because they effectively force the sub-function on you: [0,1,2,3,4,5,6,7].reduce(f, Promise.resolve()) .then(function() { console.log('fin'); }) .catch(function(e) { console.log(e.message); }); here f is the same function as above. Try it. Update: In ES6 you can also use for (let i = 0; i &lt; 8; i++) to avoid the "closures in a loop" trap without pushing code into a sub-function f. PS: The mistake in your example is .then(main(), - it needs to be .then(function() { return new Promise(main()); }, but really, I think you're using the pattern wrong. main() should return a promise, not be wrapped by one.
has comment: http://stackoverflow.com/comment/44674984
upvote count: 2
type: Answer

http://stackoverflow.com/comment/44853254
has text: We wrap it in parens to force an expression. The `()` is to execute the function, that's what makes it an IIFE.
type: AnswerComment
comment on: http://stackoverflow.com/a/28244945
score: 0
type: Comment

http://stackoverflow.com/comment/44693317
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28160914
type: Comment
has text: Do you want the name of the function or the name of the property the function is assigned to?

http://stackoverflow.com/comment/44652967
comment on: http://stackoverflow.com/a/28140692
score: 0
has text: And on my blog (i don't know why) it's height change (my blog is: programming-multilang.tk and the page:MS-DOS Programming)
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28196085
accepted answer of: http://stackoverflow.com/q/28195465
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44760196
type: AcceptedAnswer
type: Answer
has body: Your problem is known in the javascript world as "the dot." The idea is that in javascript, native values are passed by value whereas object values are passed by reference. Try changing your view to this: &lt;div id="callFunction" ng-click="myFunction()"&gt;...&lt;/div&gt; &lt;div id="contactInfo" ng-show="content.Show"&gt;...&lt;/div&gt; and change your controller to: $scope.content.Show = false; $scope.myFunction = function() { $scope.content.Show = true; } The reason this would work is because you're now passing an object around and manipulating an object instead of just manipulating a value. Essentially, think of it as a "sub-scope" problem, where your "div" is spawning its own scope under the view so that variable you're referencing is a native type, it passes by value. Therefore the function updates the parent value but not the child value. For more information: http://jimhoskins.com/2012/12/14/nested-scopes-in-angularjs.html
answers question: http://stackoverflow.com/q/28195465
score: 2

http://stackoverflow.com/comment/44777614
type: Comment
has text: why are you extending a view in a component?
type: QuestionComment
comment on: http://stackoverflow.com/q/28160805
score: 0

http://stackoverflow.com/a/28256379
answers question: http://stackoverflow.com/q/28254079
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44871278
has comment: http://stackoverflow.com/comment/44871195
downvote count: 0
score: 1
has body: The issue with your code is getting the existing html, adding new html and adding the result back into the div. By doing this you are removing all click events of the existing html. Every time you click the "add team" button you copy and paste the current html, add new html (new row) but only add the onclick event for the new row. Instead you could append the new html like this: var holder = document.getElementById('teamsReqTab'); holder.insertAdjacentHTML('afterend', newHTML) I have made a fiddle with this code implemented http://jsfiddle.net/od828m98/
accepted answer of: http://stackoverflow.com/q/28254079
type: AcceptedAnswer

http://stackoverflow.com/a/28239567
has comment: http://stackoverflow.com/comment/44851025
answers question: http://stackoverflow.com/q/28239290
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44841594
score: 0
has comment: http://stackoverflow.com/comment/44842051
has comment: http://stackoverflow.com/comment/44840578
has comment: http://stackoverflow.com/comment/44840836
has body: It seams that you have not set the correct height to bx-viewport if you look at the output code, it has an inline height of 0px: You need to set some height to it, for the images to show, currently the overflow: hidden hides them But the core problem with your script is actually in the fact that on initial load the DIV#popUpDiv has the inline style of display: none this means that the bxslider can't get the dimensions of your images so it by default goes to 0px i.e. the height problem you see. You need to create the bxslider only once the ul.bxslider is visible in the DOM, or the component can't do it's thing. A quick and dirty way to demonstrate how you can do this is this: MA pop-up avec SLIDER !! Projet Uranus Projet Uranus : développement web CONTEXTE Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, odit, omnis! Quas quo, excepturi explicabo nisi consectetur modi mollitia vero aliquam enim eos dolorem, provident pariatur tenetur cumque? Vel, tenetur? Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam corporis fugit laborum sed ab, cum veritatis omnis laudantium odio dolore, sunt quidem est itaque quaerat nihil deleniti placeat eligendi vero. APPROCHE Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero, id, ipsa. Dicta ratione eos adipisci nemo aspernatur totam fugit, mollitia praesentium magnam doloremque tempora architecto a, accusamus soluta nostrum Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt dignissimos veritatis id eligendi voluptatum ullam, sint amet non et, ea laborum illo sit quae distinctio accusantium ipsam. Cum, consequatur, animi. SEE THE WEBSITE BACK As you can see, I commented out the monbxslider.js with activated the bxslider on document load and activated it in the popup2() method I added and now it works fine. Of course you need to make a clean version of this, but this is the basic idea of what you need to do. EDIT : In general this is not how I would do this, but if you want you could …
type: Answer
has comment: http://stackoverflow.com/comment/44842825
accepted answer of: http://stackoverflow.com/q/28239290
has comment: http://stackoverflow.com/comment/44841722

http://stackoverflow.com/comment/44797128
type: QuestionComment
has text: Are you using javascript AJAX or jquery AJAX?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28216830

http://stackoverflow.com/comment/44792891
type: Comment
type: QuestionComment
has text: I've updated the answer to address the edit. It still doesn't change what gets logged, and still doesn't create a global.
comment on: http://stackoverflow.com/q/28213200
score: 0

http://stackoverflow.com/q/28175276
has body: I try to use as input a file in json format. Here is a snippet of example data. [ { id: 1671349531, name: "A Wild Restaurant Expansion", blurb: "We are looking to expand from our current location to a new and better facility. One that will be available for our our followers!", goal: 17000, pledged: 0, state: "live", slug: "a-wild-restaurant-expansion", disable_communication: false, country: "US", currency: "USD", currency_symbol: "$", currency_trailing_code: true, deadline: 1425185940, state_changed_at: 1422373209, created_at: 1422141288, launched_at: 1422373209, backers_count: 0, photo: { full: "https://s3.amazonaws.com/ksr/projects/1619167/photo-full.jpg?1422144440", ed: "https://s3.amazonaws.com/ksr/projects/1619167/photo-ed.jpg?1422144440", med: "https://s3.amazonaws.com/ksr/projects/1619167/photo-med.jpg?1422144440", little: "https://s3.amazonaws.com/ksr/projects/1619167/photo-little.jpg?1422144440", small: "https://s3.amazonaws.com/ksr/projects/1619167/photo-small.jpg?1422144440", thumb: "https://s3.amazonaws.com/ksr/projects/1619167/photo-thumb.jpg?1422144440", 1024x768: "https://s3.amazonaws.com/ksr/projects/1619167/photo-1024x768.jpg?1422144440", 1536x1152: "https://s3.amazonaws.com/ksr/projects/1619167/photo-1536x1152.jpg?1422144440" }, creator: { id: 602131664, name: "Chef James Nelson", avatar: { thumb: "https://s3.amazonaws.com/ksr/avatars/13830182/logo3.thumb.jpg?1422143536", small: "https://s3.amazonaws.com/ksr/avatars/13830182/logo3.small.jpg?1422143536", medium: "https://s3.amazonaws.com/ksr/avatars/13830182/logo3.medium.jpg?1422143536" }, urls: { web: { user: "https://www.kickstarter.com/profile/602131664" }, api: { user: "https://api.kickstarter.com/v1/users/602131664?signature=1422460143.21cd79c238aeae43e8a4311c18bf8e8cd2c3a39a" } } }, location: { id: 2433186, name: "Kissimmee", slug: "kissimmee-fl", short_name: "Kissimmee, FL", displayable_name: "Kissimmee, FL", country: "US", state: "FL", type: "Town", is_root: false, urls: { web: { discover: "…
tagged with: http://stackoverflow.com/tag/r
possible better answer: http://stackoverflow.com/a/54282071
answer count: 2
has answer: http://stackoverflow.com/a/54282071
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44729577
has comment: http://stackoverflow.com/comment/44729550
upvote count: 2
has answer: http://stackoverflow.com/a/28180300
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/44722381
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16947643
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44719821
has title: convert json to csv format
type: Question
accepted answer: http://stackoverflow.com/a/28180300
tagged with: javascript
linked to: http://stackoverflow.com/q/2496710

http://stackoverflow.com/q/28140010
possible better answer: http://stackoverflow.com/a/28140061
has comment: http://stackoverflow.com/comment/44652415
score: 0
has answer: http://stackoverflow.com/a/28140061
has answer: http://stackoverflow.com/a/28140043
accepted answer: http://stackoverflow.com/a/28140043
has body: I'd like to do this in jQuery: var limit=3; if input is 1 ==&gt; the output is 1; if input is 2 ==&gt; the output is 2; if input is 3 ==&gt; the output is 3; //after the limit (in this example 3) if input is 4 ==&gt; the output is 1; if input is 5 ==&gt; the output is 2; if input is 6 ==&gt; the output is 3; //again if input is 7 ==&gt; the output is 1; if input is 8 ==&gt; the output is 2; if input is 9 ==&gt; the output is 3. ... I used do-while loop, but I hope that there is a better (in terms of number of lines) function. Thanks a lot Fabio
type: AnsweredQuestion
type: Question
answer count: 2
has title: Repetition of number up to limit, then loop it
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28168203
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28168151
has comment: http://stackoverflow.com/comment/44707278
has comment: http://stackoverflow.com/comment/44707582
score: 1
answers question: http://stackoverflow.com/q/28168151
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44706739
downvote count: 0
has body: $("#validationForm").submit(function(event) { alert("working"); }); Email Telephone Password Confirm Password You have missed the dot mark before submit().
has comment: http://stackoverflow.com/comment/44706643
type: Answer

http://stackoverflow.com/a/28225803
answers question: http://stackoverflow.com/q/28225732
has body: You need quotes around the string echo '&lt;td&gt;&lt;input id="btnUpdate" type="submit" name="btnUpdate" value = "Update" onclick="updateButton(' . $row['CustomerID'] . ',\'' . $row['custEmail'] . '\')" /&gt; &lt;/td&gt;';
downvote count: 0
has comment: http://stackoverflow.com/comment/59416983
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/comment/117664261
type: Comment
comment on: http://stackoverflow.com/a/28414821
score: 0
has text: More information is available at https://bugzilla.mozilla.org/show_bug.cgi?id=1205604
type: AnswerComment

http://stackoverflow.com/q/28159537
type: Question
upvote count: 1
has title: Why does this WebSocket function return too many messages?
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I'm using Ruby gems sinatra and sinatra-websocket on the backend, with JS on the frontend. My backend: get '/' do if(!(request.websocket?)) erb :index else request.websocket do |ws| ws.onopen do settings.sockets &lt;&lt; ws end ws.onmessage do |msg| EM.next_tick { settings.sockets.each{|s| # p s s.send(msg) } } end ws.onclose do warn("connection closed") end end end end And on the frontend... window.onload = function(){ function someFunction(){ var ws = new WebSocket('ws://'+window.location.host+window.location.pathname); ws.onopen = function(){ var buttons = document.getElementsByClassName('buttons'); [].forEach.call( buttons, function(btn){ if(btn!=null){ btn.onclick = function(){ var amt = 11; ws.send(amt); console.log(amt); return false; }; } } ); }; ws.onmessage = function(msg){ console.log(msg); return false; }; ws.onclose = function(){ console.log("Connection closed"); return false; }; } }; The first console.log() prints test once, but the one in onmessage gives the response twice at first, three times the second time I click one of the buttons, and more times every time I click afterward. Why is this? How do I make it so the function in onmessage gives me msg just once each time I click one of the buttons?
downvote count: 0
tagged with: websocket
score: 1
favorite count: 0
tagged with: ruby
tagged with: sinatra

http://stackoverflow.com/comment/44811905
has text: I was looking at this [page](https://bootstrap-datepicker.readthedocs.org/en/release/) and hoping to use the middle image layout. Having difficulty understanding where exactly all of those snippets of code go and what some of them even do.
comment on: http://stackoverflow.com/q/28222430
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28134723
has body: Angular controllers are not singletons, and every time you use ng-controller in a view, you create a new instance of that controller (see documentation). This is the reason why your second controller doesn't show the data - it's scope is not aware of the scopes of other instances. You can either save the model's data under $rootScope, or create some eventing mechanism in your controller, that would inform other instances of data change.
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28134163
accepted answer of: http://stackoverflow.com/q/28134163
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44799483
score: 0
type: AnswerComment
has text: Don't forget to select an answer that was helpful
comment on: http://stackoverflow.com/a/28203418
type: Comment

http://stackoverflow.com/q/28124986
type: Question
has answer: http://stackoverflow.com/a/28125013
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44623347
accepted answer: http://stackoverflow.com/a/28125013
answer count: 1
tagged with: jquery
has body: $.save1= function(){ var value = $("form#form1").serialize(); send(value); } $.save2= function(){ var value = $("form#form2").serialize(); send(value); } $.save3= function(){ var value= $("form#form3").serialize(); send(value); } $.send= function(value){ value = value + "&amp;do=titlechange"; $.ajax({ url: "php_script.php", data: value, dataType: "json", type:"post", success: function(res){ alert(res); } }); } I have 3 different form in same page. Also i have 3 different button, but i want to send values to same .php file. My code is above, but i could not call send function, in "save" functions. Save functions are binded buttons onclick.
favorite count: 0
has title: JQuery Function Call in another function
type: AnsweredQuestion
downvote count: 2
upvote count: 1

http://stackoverflow.com/a/28179682
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44832657
type: AcceptedAnswer
has body: You would need to declare an array holding every polygon that the user draws and then, when the user adds a marker, you would need to iterate over your polygonarray until you find one that contains the marker. This is done by adding listeners to Drawingmanager's polygoncomplete and markercomplete events. var polygonArray=[]; google.maps.event.addListener(drawingManager, 'polygoncomplete', function (polygon) { polygonArray.push(polygon); }); google.maps.event.addListener(drawingManager, 'markercomplete', function (marker) { polygonArray.forEach(function(polygon) { if(google.maps.geometry.poly.containsLocation(marker.getPosition(), polygon)) { console.log('Marker added inside polygon',polygon); } }); }); Edit: I was missing a closing parenthesis after containsLocation See it working at: http://jsfiddle.net/amenadiel/zfvyou0b/
accepted answer of: http://stackoverflow.com/q/28140181
upvote count: 1
answers question: http://stackoverflow.com/q/28140181
type: Answer
has comment: http://stackoverflow.com/comment/44826120
has comment: http://stackoverflow.com/comment/44826381

http://stackoverflow.com/a/28258676
has comment: http://stackoverflow.com/comment/44875342
type: Answer
has comment: http://stackoverflow.com/comment/44875459
has comment: http://stackoverflow.com/comment/44875419
has body: Yes you can use $.get(url, data, success) which is nearly the same except that it is a method rather than global function and it has an implicit callback function. Then set the ASYNC property to false. This is not recommended since AJAX was made for async calls. But that is one way to do it. It is best to use the complete callback that is in the third parameter of .load() to do anything after the AJAX call. .load( url [, data ] [, complete ] ) Ex $('#ajax-container').load(page, function(){ var height = $(this).height(); alert(height); });
has comment: http://stackoverflow.com/comment/44875541
has comment: http://stackoverflow.com/comment/44875470
answers question: http://stackoverflow.com/q/28258648
has comment: http://stackoverflow.com/comment/44875445
has comment: http://stackoverflow.com/comment/44875475
score: 0

http://stackoverflow.com/a/39295456
downvote count: 0
score: 50
type: Answer
has comment: http://stackoverflow.com/comment/79991347
has body: In updating to version 2.2.2 of ChartJS, I found that the accepted answer no longer works. The datasets will take an array holding styling information for the properties. In this case: var pointBackgroundColors = []; var myChart = new Chart($('#myChart').get(0).getContext('2d'), { type: 'line', data: { datasets: [ { data: dataPoints, pointBackgroundColor: pointBackgroundColors } ] } }); for (i = 0; i &lt; myChart.data.datasets[0].data.length; i++) { if (myChart.data.datasets[0].data[i] &gt; 100) { pointBackgroundColors.push("#90cd8a"); } else { pointBackgroundColors.push("#f58368"); } } myChart.update(); I found this looking through the samples for ChartJS, specifically this one: "Different Point Sizes Example"
upvote count: 50
answers question: http://stackoverflow.com/q/28159595

http://stackoverflow.com/comment/44931015
type: AnswerComment
type: Comment
has text: yes, the aria attribute is added. it's so close! can you take another look?
comment on: http://stackoverflow.com/a/28259868
score: 0

http://stackoverflow.com/q/28232634
has body: I have written a ruby script using selenium webdriver I am using Browserstack to test my script. it is running fine on windows(Chrome, firefox), OS X(chrome, frefox) but when I use android browser execute_script() function returns null. here is my code require 'rubygems' require 'selenium-webdriver' #input capabilities caps = Selenium::WebDriver::Remote::Capabilities.new caps['browser'] = 'android' caps['os'] = 'android' caps['device'] = 'Google Nexus' caps['os_version'] = '4.2' caps['name'] = 'Nestaway Android Device test' driver = Selenium::WebDriver.for(:remote, :url => "http://<REDACTED>:<REDACTED>@hub.browserstack.com/wd/hub", :desired_capabilities => caps) siteUrl = 'http://localhost:3000/' driver.manage.timeouts.implicit_wait = 10 driver.navigate.to siteUrl myscript = "var name = 'rohit kumar'; return name;" result = driver.execute_script(myscript) puts result driver.quit why this is happening. any suggestion please. Thanks in advance Answer I think I found a trick Solution that Whatever your javascript is just write in one line it will work In my case myscript="var name='rohit kumar'; return name;"
downvote count: 0
favorite count: 0
tagged with: ruby
upvote count: 2
type: UnansweredQuestion
tagged with: android
tagged with: ruby-on-rails
score: 2
answer count: 0
tagged with: selenium
type: Question
has title: ruby execute script function return null on android browser selenium
tagged with: javascript

http://stackoverflow.com/q/28266855
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28267004
has title: Async lookup without results hangs app
tagged with: asynchronous
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28267004
type: Question
has body: I am attempting to use mongoose with async, everything works fine for the most part...however when I perform a lookup that returns no results my application seems to hang and eventually timeout. Here is some example controller code that does a simple lookup by id using mongoose and async: module.exports.find = function(req, res) { async.waterfall([ function(next) { SomeModel.findById(req.params.id, next); }, function(someModel, next) { if (!SomeModel) { res.status(404).json({ success: false, message: 'SomeModel not found' }); } else { res.json(SomeModel); } } ]); }; If a record is found everything comes back just fine, however for a nonexistent id it seems that the second async step is never called and eventually the whole request times out. So what am I doing wrong here? How do I get the 'findById' method to call 'next' even if a record isn't found?
tagged with: mongodb
score: 0

http://stackoverflow.com/comment/44642215
type: Comment
has text: Thanks. We're almost there... I don't want to display the value of the option description in the div, i'd like to display the value of the li. see here (http://jsfiddle.net/davidThomas/5Eebm/) how the option text "Title 1" brings up the li text "Prophecy 1 text"...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28122141

http://stackoverflow.com/comment/44646147
type: Comment
has text: Are you sure that Angular.js is not found.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28136740

http://stackoverflow.com/a/30335740
score: 0
answers question: http://stackoverflow.com/q/28253435
type: Answer
has body: I think the sample operator would be your best bet. Unfortunately, it does not come with a built in default value, so you would have to roll your own from the existing operator: Rx.Observable.prototype.sampleWithDefault = function(sampler, defaultValue){ var source = this; return new Rx.AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { observer.onNext(hasValue ? value : defaultValue); hasValue = false; } function sampleComplete() { atEnd &amp;&amp; observer.onCompleted(); } return new Rx.CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleComplete) ); }, source); } You can achieve the queuing behavior using the controlled operator. Thus your final data chain would look like so: var commands = getCommandSource().controlled(); var pipeline = commands .sampleWithDefault(data, defaultCommand) .tap(function() { commands.request(1); }); Here is a full example: Rx.Observable.prototype.sampleWithDefault = function(sampler, defaultValue) { var source = this; return new Rx.AnonymousObservable(function(observer) { var atEnd, value, hasValue; function sampleSubscribe() { observer.onNext(hasValue ? value : defaultValue); hasValue = false; } function sampleComplete() { atEnd &amp;&amp; observer.onCompleted(); } return new Rx.CompositeDisposable( source.subscribe(function(newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function() { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleComplete) ); }, source); } var scheduler = new Rx.TestScheduler(); var onNext = Rx.ReactiveTest.onNext; var onCompleted = Rx.ReactiveTest.onCompleted; var data = scheduler.createHotObservable(onNext(210, 18), onNext(220, 17), onNext(230, 16), onNext(250, 15), onCompleted(1000)); var commands = sched…

http://stackoverflow.com/comment/44907407
has text: What code have you already tried? Please see [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve).
comment on: http://stackoverflow.com/q/28276285
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/65836124
comment on: http://stackoverflow.com/a/39242744
type: Comment
has text: Please check my answer, let me know it is fulfill your requirement of not?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44781334
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28207916
has text: Ok, I'm not very familiar with wordpress media uploader. However it sounds as though you are dynamically populating an array with selections on the client-side. Nothing is being uploaded, you simply want to take an array and make it a single string, is that correct? If you are dealing with a JSON object you can use jsonObj.stringify(); which should return a single string. If needed you can then clean the string using regular expressions.

http://stackoverflow.com/q/28191999
linked to: http://stackoverflow.com/q/14220321
score: 0
has comment: http://stackoverflow.com/comment/44751378
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/44752215
answer count: 1
has comment: http://stackoverflow.com/comment/44751281
has comment: http://stackoverflow.com/comment/44751333
has comment: http://stackoverflow.com/comment/44751197
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44752555
has comment: http://stackoverflow.com/comment/44751453
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/10642459
has answer: http://stackoverflow.com/a/28192077
tagged with: function
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44751250
tagged with: ajax
type: Question
has title: Javascript function not returning correctly
has comment: http://stackoverflow.com/comment/44751330
has comment: http://stackoverflow.com/comment/44751623
has comment: http://stackoverflow.com/comment/44751214
has comment: http://stackoverflow.com/comment/44751232
has body: I am making a commenting system on my Laravel based CMS. The logic I am working on currently is when a comment is deleted, I run an ajax call to check how many comments there are and if there is no more comments then I will show a message 'No comments'. I have everything working, but the last part. My function is always returning undefined. The function: function checkCommentCount($id){ var rootAsset = $('.rootAsset').html(); $.ajax({ url: rootAsset+'postcommentcount/'+$id, type: 'post', cache: false, dataType: 'json', data: $(this).serialize(), success: function(data) { if (data.success) { //return +data.count; console.log(data.count); } }, error: function(xhr, textStatus, thrownError) { alert('Something went to wrong.Please Try again later...'); } }); } This correctly logs the count variable returned via JSON. So the PHP side is fine. However, if try to run the function elsewhere: console.log(checkCommentCount(1648)); It always returns undefined. I need to get the function to a return a number value so I can do my check. The console log works fine in the function, but if I change that to: return data.count; Then the function will return undefined... Any ideas?

http://stackoverflow.com/comment/44644017
comment on: http://stackoverflow.com/a/28131517
has text: Thank you very much for your thoughts. It's pretty close to what I need for my application - except that I need to let my users know the percentile range that their `number` value falls in. So, `number = 744` would yield a result stating that it is **between** the 75th and 90th percentile.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28274741
tagged with: callback
favorite count: 0
tagged with: express
has comment: http://stackoverflow.com/comment/44904440
has title: Node res.send() not working when executed inside callback function?
has comment: http://stackoverflow.com/comment/44904727
tagged with: asynchronous
tagged with: node.js
has body: Tried various techniques now to no prevail, can anybody shed any light on this. //Google search ------------------- app.get("/google/:name", function (req, res) { var term = req.params.name; var searchTerm = function (search, callback) { var options = { hostname: "ajax.googleapis.com", path: "/ajax/services/search/web?v=1.0&amp;q="+ search + "" }; var gsaReq = http.get(options, function (response) { var completeResponse = ''; response.on('data', function (chunk) { completeResponse += chunk; }); response.on('end', function() { outputResult(completeResponse); }); }).on('error', function (e) { console.log('problem with request: ' + e.message); }); }(term, outputResult); function outputResult(result){ console.log(result); res.send(result); // res.send('hello world'); }; }); This works fine if the res.send() sends hello world just not the result of my call back, despite the result being a string? Any ideas? If the above doesn't make sense the code below is simplified (without the callback) and the res.send() still fails..? The res.send doesn't work without the callback - ahhh: app.get("/google/:name", function (req, res) { var term = req.params.name; var searchTerm = function (search) { var options = { hostname: "ajax.googleapis.com", path: "/ajax/services/search/web?v=1.0&amp;q="+ search + "" }; var gsaReq = http.get(options, function (response) { var completeResponse = ''; response.on('data', function (chunk) { completeResponse += chunk; }); response.on('end', function() { res.send(completeResponse); }); }).on('error', function (e) { console.log('problem with request: ' + e.message); }); }(term); });
answer count: 0
has comment: http://stackoverflow.com/comment/44904542
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44905820
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44904527
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28215213
type: Question
has body: I'm developing a asp.net application using twitter bootstrap. I'm trying create a jqgrid. While loading the data im facing issues. I'm getting an error XML Parsing Error: no element found Location: moz-nullprincipal:.... Here is my code $(document).ready(function () { jQuery("#grid-container").jqGrid({ url: "test.url", datatype: 'json', mtype: 'POST', colNames: ['Id', 'Text', 'Name'], colModel: [ { name: 'Id', index: 'Id', hidden: false, editable: true }, { name: 'Text', index: 'Text', hidden: false, editable: true }, { name: 'Name', index: 'Name', hidden: false, editable: true } ], jsonReader: { id: 'Id', repeatitems: false }, height: "100%", pager: '#grid-pager', rowNum: 10, rowList: [10, 20, 30], sortname: 'Id', sortorder: 'desc', viewrecords: true, caption: "Risk Register", loadComplete: function () { var table = this; } }); }); I found that data from dal is not converting into json type.. I'm not getting the response while debugging. Please help me out.
tagged with: jqgrid
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44796582
tagged with: jquery
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: Issue while loading the data in jqgrid
has comment: http://stackoverflow.com/comment/44794728
answer count: 0
has comment: http://stackoverflow.com/comment/44794583

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/28219466

http://stackoverflow.com/q/28201205
type: Question
tagged with: java
has answer: http://stackoverflow.com/a/28201973
score: 0
has comment: http://stackoverflow.com/comment/44768774
has body: I am trying to make my application offline enabled. This is my starting page of the app which I have put on TOMCAT Insert title here Hello World And Here is my test.appcache (although I am not using any of the files mentioned in my manifest files at this point - its just a POC) CACHE MANIFEST #version 821 CACHE: test.html /resources/test.js NETWORK: * FALLBACK: test.html test.html runs fine in online mode in localhost:8080/myapp/test.html But when I stop the TOMCAT and try to run it this is what I get - Why is my HTML page test.html not getting served from cache when I stop TOMCAT server! Thanks
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: Offline cache using manifest appcache
tagged with: http://stackoverflow.com/tag/html
tagged with: html5-appcache
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/44768880

http://stackoverflow.com/comment/80072470
type: Comment
comment on: http://stackoverflow.com/a/46409174
score: 1
type: AnswerComment
has text: I concern was that some engines might add information in the form of comments to the stringified function code e.g. for debugging purposes, which appears to be allowed as per standard because it wouldn't affect the code and is legal in terms of syntax (engine that do this are yet to be found however). I remember a slightly related issue with inaccurate tracebacks in some framework, because the developers didn't consider that the called functions were wrapped with an IIFE, which added two lines to the starting position.

http://stackoverflow.com/a/28274546
type: Answer
has body: There are several problems. As has been pointed out in other answers, the document.getElementsByClassName() function will return a node list, which you need to iterate through. Also the right attribute typically contains a unit (unless its value is something like inherit or auto). Assuming you're working with pixels (since you're assigning a pixel value to slide) you could do something like this: var slide = document.getElementsByClassName('slider_img_width')[0].offsetWidth; and then var elements = document.getElementsByClassName("slides_gsc"); for(var i=0;i&lt;elements.length;i++){ slider_moves++; elements[i].style.right = (slide*slider_moves)+"px"; }
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28274259
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28274259

http://stackoverflow.com/comment/44906848
score: 0
type: Comment
type: QuestionComment
has text: I've added an answer for you.
comment on: http://stackoverflow.com/q/28276058

http://stackoverflow.com/comment/63005462
comment on: http://stackoverflow.com/a/28191816
type: AnswerComment
has text: I downvoted you for "Based on the information provided in the identical question you deleted yesterday..." What is the purpose of that?
score: 0
type: Comment

http://stackoverflow.com/q/28241940
has comment: http://stackoverflow.com/comment/44914243
score: 5
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28288638
downvote count: 0
answer count: 1
tagged with: macos
has comment: http://stackoverflow.com/comment/44915461
has comment: http://stackoverflow.com/comment/44920026
has comment: http://stackoverflow.com/comment/44921959
favorite count: 0
has title: Safari not catching exception when trying to access parent window object with Javascript try/catch
tagged with: exception
has comment: http://stackoverflow.com/comment/44920264
accepted answer: http://stackoverflow.com/a/28288638
tagged with: safari
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/67602176
has comment: http://stackoverflow.com/comment/44914913
type: Question
tagged with: try-catch
has body: So the code below can be seen working via the fiddle link. Safari is refusing to catch the exception- I am assuming this may be because it is not a 'Javascript' error? Either way, if you run the code in any other browser, you will see the page URL in the console. The purpose of the function is find the page URL when executed multiple iframes deep on the page. If anyone can confirm why Safari won't catch the error and/or maybe offer a solution, that would be great...Thanks! function logURL() { var oFrame = window, exception = false; try { while (oFrame.parent.document !== oFrame.document) { oFrame = oFrame.parent; } } catch (e) { exception = true; } if(exception) { console.log('excepted', oFrame.document.referrer); } else { console.log('no exception', oFrame.location.href); } } http://jsfiddle.net/HPu9n/82/

http://stackoverflow.com/comment/44891987
type: AnswerComment
comment on: http://stackoverflow.com/a/28266148
score: 0
type: Comment
has text: I've updated my answer with basically what my two comments where to you as a response.

http://stackoverflow.com/comment/47631607
type: Comment
has text: Some firewalls may block QUIC communication, since it differs from "normal" TCP based HTTP comunication
score: 2
comment on: http://stackoverflow.com/a/28408386
type: AnswerComment

http://stackoverflow.com/a/28225070
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28224876
has comment: http://stackoverflow.com/comment/44817391
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44813706
has body: If I'm understanding you correctly, the ajax/test.html page has content on it that is updated via Javascript after that page fully loads. This is not something that AJAX is designed to handle. One potential avenue, if the dynamic page is within the same domain, would be to load the page into an iframe and get the generated markup after a specified timeframe: &lt;iframe src="ajax/test.html" id="ajax-frame"&gt;&lt;/iframe&gt; &lt;script&gt; setTimeout(function() { var markup = document.getElementById('ajax-frame').contentWindow.document.body.innerHTML; }, 1000); &lt;/script&gt; The method for retrieving the iFrame markup was found in this post.
accepted answer of: http://stackoverflow.com/q/28224876

http://stackoverflow.com/q/28237275
has answer: http://stackoverflow.com/a/28237477
has title: How to check if "http://" is included in url input in Angular.js app?
answer count: 4
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/646628
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28237494
score: 1
has comment: http://stackoverflow.com/comment/44835885
type: Question
has answer: http://stackoverflow.com/a/28237424
has body: I'm new to Angular.js and trying to build a simple news app where you post some text and that text is linked to a url. This is my HTML: Angular News App {{post.title}} Post And here is my app2.js: angular.module('News', []) .controller('MainCtrl', [ '$scope', function($scope){ $scope.posts = [ {title: 'Hotmail.com', link: 'http://www.hotmail.com'}, {title: 'Facebook.com', link: 'http://facebook.com'} ]; $scope.addPost = function(){ if(!$scope.title || $scope.title === ''){ return;} if(!$scope.link || $scope.link === ''){ return;} // if statement to be added here? $scope.posts.push({ title: $scope.title, link: $scope.link }); $scope.title= ''; $scope.link= ''; }; }] ); This all works. Now I want to check if the link provided starts with "http://" and if it doesn't then concatenate that to the start of $scope.link. Can anyone tell me how to do this? I feel it should be possible using something like: if(!$scope.link.startsWith("http://)){ $scope.link = "http://" + $scope.link;} and inserting this after the other if statements in app2.js. Thanks in advance it is much appreciated! Tom
has answer: http://stackoverflow.com/a/28237636
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28160393
favorite count: 0
has answer: http://stackoverflow.com/a/28160602
answer count: 4
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28160699
upvote count: 1
has comment: http://stackoverflow.com/comment/44692133
type: Question
has answer: http://stackoverflow.com/a/28160430
has answer: http://stackoverflow.com/a/28160617
tagged with: javascript
has body: If I run the following code in Chrome console (apologies for the label): var x = 0; theLoop: while (1) { if (!(x &lt;= 2)) { break theLoop; } console.log('x: ', x); ++x; continue theLoop; } The following is output to the console: x: 0 x: 1 x: 2 3 It's late, so I'm missing something very obvious, but where is the '3' coming from?
downvote count: 0
has title: Where is this final number coming from?
possible better answer: http://stackoverflow.com/a/28160602
accepted answer: http://stackoverflow.com/a/28160430

http://stackoverflow.com/comment/44887333
has text: [Disable spaces in Input, AND allow back arrow?](http://stackoverflow.com/questions/14236873/disable-spaces-in-input-and-allow-back-arrow)
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28265322

http://stackoverflow.com/comment/44836439
type: Comment
comment on: http://stackoverflow.com/a/28236139
has text: Would it work if I set a minimum width in pixels? Would it overwrite the % rule? Say 88%? but the min-width: 900px?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44719413
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28175080
type: AnswerComment
has text: Now I really don't get it. This one would only extract all text within the selection and not all text in the DOM. Whether "a word is in the DOM (or the selection) multiple times" or not kind of doesn't have anything to do with selections IMHO.

http://stackoverflow.com/comment/44744133
type: QuestionComment
has text: function map(element){ return element; } this is the most basic map function i tried implementing. cannot share the actual function though.
comment on: http://stackoverflow.com/q/28187894
score: 0
type: Comment

http://stackoverflow.com/comment/44865538
type: Comment
has text: Thanks for the answer but still does not work. I tried to debug and see if Chart.min.js is loaded using getScript. I have put a console log like this ' $.getScript("js/Chart.min.js", function () { console.log("Loaded"); template.chartLoaded.set(true); }); ' but "Loaded" text is not display in the console.
type: AnswerComment
comment on: http://stackoverflow.com/a/28253191
score: 0

http://stackoverflow.com/comment/44902608
type: QuestionComment
comment on: http://stackoverflow.com/q/28273819
has text: Put your script before closing of body and use `innerHTML` instead of `innerhtml`
score: 2
type: Comment

java
tags question: http://stackoverflow.com/q/28192700
tags question: http://stackoverflow.com/q/28231655
tags question: http://stackoverflow.com/q/28202748
tags question: http://stackoverflow.com/q/28220249
tags question: http://stackoverflow.com/q/28196808
tags question: http://stackoverflow.com/q/28223699
tags question: http://stackoverflow.com/q/28201205
tags question: http://stackoverflow.com/q/28259010
tags question: http://stackoverflow.com/q/28267580
tags question: http://stackoverflow.com/q/28272659
tags question: http://stackoverflow.com/q/28222480
tags question: http://stackoverflow.com/q/28227623
tags question: http://stackoverflow.com/q/28267138
tags question: http://stackoverflow.com/q/28122218
tags question: http://stackoverflow.com/q/28214834
tags question: http://stackoverflow.com/q/28231051
tags question: http://stackoverflow.com/q/28154044
tags question: http://stackoverflow.com/q/28155315
tags question: http://stackoverflow.com/q/28210162
tags question: http://stackoverflow.com/q/28156205
tags question: http://stackoverflow.com/q/28180370
tags question: http://stackoverflow.com/q/28170243
tags question: http://stackoverflow.com/q/28125954
tags question: http://stackoverflow.com/q/28169645
tags question: http://stackoverflow.com/q/28213030
tags question: http://stackoverflow.com/q/28256151
tags question: http://stackoverflow.com/q/28164843
tags question: http://stackoverflow.com/q/28164476
tags question: http://stackoverflow.com/q/28135244
tags question: http://stackoverflow.com/q/28269472
tags question: http://stackoverflow.com/q/28159243
tag name: java
tags question: http://stackoverflow.com/q/28139344
tags question: http://stackoverflow.com/q/28148155
tags question: http://stackoverflow.com/q/28246172
tags question: http://stackoverflow.com/q/28222945
tags question: http://stackoverflow.com/q/28252990
tags question: http://stackoverflow.com/q/28128843
tags question: http://stackoverflow.com/q/28219711
tags question: http://stackoverflow.com/q/28227501
tags question: http://stackoverflow.com/q/28139757
tags question: http://stackoverflow.com/q/28272637
tags question: http://stackoverflow.com/q/28229322
tags question: http://stackoverflow.com/q/28157827
tags question: http://stackoverflow.com/q/28123421
tags question: http://stackoverflow.com/q/28256632
tags question: http://stackoverflow.com/q/28167253
tags question: http://stackoverflow.com/q/28276378
tags question: http://stackoverflow.com/q/28275131
tags question: http://stackoverflow.com/q/28181858
tags question: http://stackoverflow.com/q/28199272
tags question: http://stackoverflow.com/q/28148869
tags question: http://stackoverflow.com/q/28276936
type: Tag
tags question: http://stackoverflow.com/q/28261863
tags question: http://stackoverflow.com/q/28184653
tags question: http://stackoverflow.com/q/28275044
tags question: http://stackoverflow.com/q/28209398
tags question: http://stackoverflow.com/q/28129808
tags question: http://stackoverflow.com/q/28166961
tags question: http://stackoverflow.com/q/28125971

http://stackoverflow.com/comment/44711680
has text: Hi, thank you for the reply but I'm not quite sure what you mean.
comment on: http://stackoverflow.com/q/28164338
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/49701374
comment on: http://stackoverflow.com/a/28826129
type: AnswerComment
type: Comment
score: 1
has text: Just Perfect thanks for your time and effort, you helped me alot at my work

http://stackoverflow.com/q/28133128
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/10296985
has comment: http://stackoverflow.com/comment/44638815
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44638805
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28133218
has title: Splice JavaScript array
score: 1
has comment: http://stackoverflow.com/comment/44638839
upvote count: 1
type: Question
tagged with: splice
tagged with: arrays
tagged with: javascript
has body: Here's my attempt at trying to remove a value from an array dynamically $('.btn-remove').click(function() { var players = ["compare","13076","13075","13077","12755"]; var removePlayer = $(this).data('player'); var idx = $.inArray(removePlayer, players); if (idx != -1) { players.splice(idx, 1); } window.location = "/" + players.join('/'); }) For example, $(this).data('player') could equal 13077 and i'd want it to remove that value from the array and then redirect to the url which is attached to the window.location variable
accepted answer: http://stackoverflow.com/a/28133218

http://stackoverflow.com/a/28186066
has body: If I understood you correctly. What you have to use is $index in ng-repeat. It helps to track index nos for traversal. $index will give you that "Id". Check if this helps. [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old. https://docs.angularjs.org/api/ng/directive/ngRepeat
type: Answer
answers question: http://stackoverflow.com/q/28185977
score: 0

http://stackoverflow.com/q/28144316
has comment: http://stackoverflow.com/comment/44660688
has comment: http://stackoverflow.com/comment/44660932
type: Question
has comment: http://stackoverflow.com/comment/44660859
has comment: http://stackoverflow.com/comment/44663673
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/37646585
tagged with: cdn
answer count: 1
has title: reveal.js works from CDN, but not locally
has comment: http://stackoverflow.com/comment/44661311
favorite count: 0
has comment: http://stackoverflow.com/comment/44660814
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44662010
has comment: http://stackoverflow.com/comment/44661016
has comment: http://stackoverflow.com/comment/44661581
tagged with: reveal.js
score: 2
has body: This question deals with the reveal.js library, but is more likely just a general JavaScript question. I have some HTML that loads the reveal.js library. If I load it from https://cdn.jsdelivr.net/reveal.js/2.6.2 everything works properly. I want to do some custom theming, so I am trying to run a local copy of reveal.js, however, when I clone the reveal.js repo from https://github.com/hakimel/reveal.js and place it locally next to my HTML, ensuring that all the links are changed accordingly as well, it doesn't work (none of the text renders). If I look at the JavaScript Console in Chrome, I get: Uncaught ReferenceError: Reveal is not defined Lecture1.slides.html:29623 (anonymous function)
downvote count: 0

http://stackoverflow.com/a/28137727
answers question: http://stackoverflow.com/q/28137668
type: Answer
has body: There are two problems in your code you cannot name your function "function" since it is a keyword you'll need to echo the JavaScript function call with php so that it is printed on the document sent to client.
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/28129274
favorite count: 0
has answer: http://stackoverflow.com/a/28129318
upvote count: 2
has comment: http://stackoverflow.com/comment/44631546
answer count: 4
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28129326
type: Question
possible better answer: http://stackoverflow.com/a/28129318
tagged with: javascript
tagged with: jquery
has title: Sending a custom jQuery validation form
has body: I've been working on some custom validation (very basic). It does what I need it to do but I can't work out how to submit the form. I thought return true would work but it sadly doesn't. Here is the code I'm currently using. $('button').click(function() { $('.required').each(function() { if ($(this).val() == '') { return false; $(this).val("Please enter a value."); $(this).css("background", "#d42c43"); $(this).css("border-color", "#d42c43"); $(this).css("color", "#ffffff", "!important"); } else { return true; } }); }); All of the input fields I would like to be required have the required class in them.
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28129355
has answer: http://stackoverflow.com/a/28129366
accepted answer: http://stackoverflow.com/a/28129366

http://stackoverflow.com/a/28164534
score: 0
answers question: http://stackoverflow.com/q/28164479
type: Answer
has body: If you want to change the current URL: location.replace(strquerystring);

http://stackoverflow.com/q/28138510
favorite count: 0
type: UnansweredQuestion
tagged with: android
linked to: http://stackoverflow.com/q/15059041
downvote count: 0
has answer: http://stackoverflow.com/a/49230169
score: 1
type: Question
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/28139097
linked to: http://stackoverflow.com/q/10729067
tagged with: google-maps-api-3
answer count: 2
tagged with: google-maps
has body: I'm using the google maps in one of my projects but I don't want to have zooming affect in the map so I disabled it via zoomControl: false, however, this only works for desktops and laptops as they dont support multi touch. when i view my map in a device that supports multi touch like tablets or smart phones, I can zoom in using pinch and zoom on the device. I did try map2.getUiSettings().setZoomControlsEnabled(false); which has no affect on it and I still can pinch and zoom! I also tried map.getUiSettings().setZoomControlsEnabled(false); to see if that makes any different but it doesn't! could someone please advise on this issue? This is my full code: &lt;script&gt; function showCurrentLocation(position) { var latitude = &lt;?php echo $curLat; ?&gt;; var longitude = &lt;?php echo $curLon; ?&gt;; var coords2 = new google.maps.LatLng(latitude, longitude); var mapOptions2 = { zoom: 10, center: coords2, mapTypeControl: false, streetViewControl: false, panControl: false, zoomControl: false, scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; //create the map, and place it in the HTML map div map2 = new google.maps.Map( document.getElementById("mapPlaceholder"), mapOptions2); //place the initial marker var marker2 = new google.maps.Marker({ position: coords2, map: map2, title2: "Current location!" }); } google.maps.event.addDomListener(window,'load',showCurrentLocation); map2.getUiSettings().setZoomControlsEnabled(false); &lt;/script&gt; any help would be appreciated.
upvote count: 1
has title: disable pinch and zoom in google maps using JavaScript?

http://stackoverflow.com/comment/44729273
type: Comment
has text: Your null argument isn't really a second argument since it's in the same quotes as ".content_wrapper". I think you want `insertBefore($('.content_wrapper'), null))`. Also, see this question: http://stackoverflow.com/questions/9377887/ie-doesnt-support-insertbefore.
score: 0
comment on: http://stackoverflow.com/q/28179950
type: QuestionComment

http://stackoverflow.com/a/28239723
has comment: http://stackoverflow.com/comment/44840901
has comment: http://stackoverflow.com/comment/44841317
has comment: http://stackoverflow.com/comment/44840681
has comment: http://stackoverflow.com/comment/44842001
has comment: http://stackoverflow.com/comment/44840684
has comment: http://stackoverflow.com/comment/44841067
answers question: http://stackoverflow.com/q/28239382
has comment: http://stackoverflow.com/comment/44843102
has comment: http://stackoverflow.com/comment/44841021
has comment: http://stackoverflow.com/comment/44840819
score: 0
has comment: http://stackoverflow.com/comment/44840645
type: Answer
has comment: http://stackoverflow.com/comment/44841711
has comment: http://stackoverflow.com/comment/44840707
has body: What I can see from your code is that this condition determines the month and year that events should be held on: ((d.getMonth() - 1) == dMonth &amp;&amp; d.getFullYear() == dYear) So when you want to display events only on a certain day you have to extend this condition like: (d.getDate() == dDay &amp;&amp; (d.getMonth() - 1) == dMonth &amp;&amp; d.getFullYear() == dYear) dDay is a new varibale that holds the day that events should be held on.
has comment: http://stackoverflow.com/comment/44844264

http://stackoverflow.com/a/28175849
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28156498
score: 1
upvote count: 1
has body: In a regular cold fusion page, setup in this fashion. form.cfm &lt;cfif isDefined("form.submitb") and form.submitb is "yes"&gt; ... submit form &lt;cfelse&gt; ... show form ... &lt;/cfif&gt; You can do this otherpage.cfm &lt;cfset form.submitb = "yes" /&gt; &lt;cfset form.firstname = "John" /&gt; &lt;cfset form.lastname = "Doe" /&gt; &lt;cfinclude template="form.cfm"&gt; If you're using a recent version of CF/Railo, you can... &lt;cfset StructAppend(form, {submitb = "yes", firstname = "John", lastname = "Doe"}, false) /&gt; where the false is the value of OverWriteFlag, which specifies whether the values of the second struct will overwrite the values of the first if a conflict occurs. Note that we're not assigning the value of the StructAppend to a variable like &lt;cfset form = StructAppend{....}&gt;. Doing so would set the value of form to true, which would be bad. Some other functions like ArrayAppend() work in the same fashion. We could also just say &lt;cfset form = {....}&gt; but you may not want to erase and overwrite otherpage.cfm's form data. Finally, when a form is submitted, Cold Fusion generates a field called form.fieldnames that contains field names of all the form elements in your form. This is not generated when you add to the form scope programmatically. &lt;cfset form.newfield = "test" /&gt; adds newfield to the form scope but it does not add newfield to the list of form.fieldnames. The workaround for this is (if you need it) &lt;cfset ffnames = StructKeyList(form) /&gt; &lt;cfif listfind(ffnames,"fieldnames") /&gt; &lt;cfset ffnames = ListDeleteAt(ffnames,ListFind(ffnames,"fieldnames")) /&gt; &lt;/cfif&gt;

http://stackoverflow.com/a/28145082
has body: loadJSON makes a GET request. The callback function that you are sending to it, gets executed when the response comes back, i.e when the JSON is fetched. init(); console.log(actual_JSON); So, init() gets called and it internally does a GET request, and since this is async it does not block the execution of the rest of the code. So the next line console.log(actual_JSON) get executed, at this point the value of actual_JSON is not modified. You can do something like this to make it a little more clear: function init() { loadJSON(function(response) { actual_JSON = JSON.parse(response); consumeData(actual_JSON); //call another function with the actual JSON }); } function consumeData(actualJson) { //write the rest of the code here }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28144858
answers question: http://stackoverflow.com/q/28144858
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28259973
tagged with: memory-leaks
tagged with: memory-management
tagged with: list
score: 1
upvote count: 1
type: Question
has body: I am trying to iterate over a list var names = new List(); the following way: var names = new List(); names.append('tom'); names.append('bob'); names.append('marshal'); names.append('Cartman'); names.append('Randy'); for(names.top(); names.currentPosition() &lt; names.length(); names.next()) { console.log(names.getElement()); // going on and on stuck at one index! infinite loop!!! } I am getting an infinite loop with an unchanging index of the list. What might be going wrong? Assume the list has already been filled with values using an append method. It is definitely not empty. Here is the implementation of the List class: function List() { this.dataStore = []; this.listSize = 0; this.position = 0; } List.prototype = { clear: function() { delete this.dataStore; this.dataStore = []; this.position = this.listSize = 0; }, toString: function() { return this.dataStore.join(' \n'); }, getElement: function() { return this.dataStore[this.position]; }, append: function(el) { this.dataStore[this.listSize++] = el; }, top: function() { this.position = 0; }, bottom: function() { this.position = this.listSize - 1; }, prev: function() { if(this.position &gt; 0) { this.position--; } }, next: function() { if(this.position &lt; this.listSize - 1) { this.position++; } }, length: function() { return this.listSize; }, currentPosition: function() { return this.position; }, };
tagged with: javascript
tagged with: data-structures
has answer: http://stackoverflow.com/a/28260023
has title: How do I iterate through an instance of this List class in JavaScript
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44763914
type: AnswerComment
score: 0
type: Comment
has text: I can't post another question. It's asking me to edit this question because it's too soon to ask something again...
comment on: http://stackoverflow.com/a/28198640

http://stackoverflow.com/comment/44763543
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28197913
score: 0
has text: Thank you Ryan for your input, I'm keep searching and will post it if I find something useful.

http://stackoverflow.com/q/28258143
has body: I have this error: "undefined is not a function" comming up when trying to add a watch to the scope. I can't find the error. Maybe i am just blind staring at this error for to long now. Why do i get a undefined function error when the $watch method is clearly defined on the scope ? chColorPicker.controller('chColorPickerCtrl', function ($scope,$document,$element) { $scope.init = function (event) { } var colorObject = { r:'0', g:'0', b:'0', hex:'#000000' }; $scope = colorObject; $scope.Z1; $scope.Z2; var onChangeColor = function(newValue,oldValue) { console.log('change'); } $scope.$watch("r",onChangeColor); //&lt;-- the error appears here. });
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44874370
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28258163
has title: $scope.$watch(var,function) undefined is not a function
tagged with: angularjs
upvote count: 2
accepted answer: http://stackoverflow.com/a/28258163
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/28211384
accepted answer: http://stackoverflow.com/a/28211463
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28211463
has body: I'm trying to get postMessage() to work to communicate between an iframe and my main website. However using the exact syntax given in the example code on MDN, I am being presented with a nice Undefined is not a function error. I've tried several things, such as initializing the iframe inside Javascript and appending it to my page, but that left me with the same error. Same for have seperate selectors to select my iframe. I have the following Javascript code: &lt;script type="text/javascript"&gt; $(document).ready(function() { $('.editor').postMessage("A", "domain here"); }); function receiveMessage(event) { if (event.origin !== "domain here") return; // Do something } window.addEventListener("message", receiveMessage, false); &lt;/script&gt; The script above tries to send a message to my iframe on the page, which looks like: &lt;iframe src="domain here/frameListener.html" class="editor"&gt;&lt;/iframe&gt; It then has a function receiveMessage to catch any messages being send as a response to the main webpage. Last but not least, I've tried the answers given in this question: But that did not fix my problem. It is therefore not a duplicate. How can I get rid of this error message?
has comment: http://stackoverflow.com/comment/44787080
has comment: http://stackoverflow.com/comment/44787239
type: AnsweredQuestion
has title: postMessage() generates error "undefined is not a function"
downvote count: 0
tagged with: iframe
tagged with: postmessage
linked to: http://stackoverflow.com/q/6030262
type: Question
score: 7
tagged with: javascript
has comment: http://stackoverflow.com/comment/124383284
upvote count: 7

contact-form-7
tags question: http://stackoverflow.com/q/28232125
type: Tag
tag name: contact-form-7

http://stackoverflow.com/a/28268905
accepted answer of: http://stackoverflow.com/q/28268826
has body: Javascript: - Using the for loop to count down and adding the HTML within the demo id. text = ""; var c; for (var c=20;c &gt; 10;c--){ text += '&lt;img src="images/' + c + '.jpg" alt="' + c + '!" width="90" height="125" border="0"&gt;'; } document.getElementById("demo").innerHTML = text; &lt;p id="demo"&gt;&lt;/p&gt;
answers question: http://stackoverflow.com/q/28268826
has comment: http://stackoverflow.com/comment/44894024
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/44893910
has comment: http://stackoverflow.com/comment/44893880
upvote count: 4
score: 3
type: AcceptedAnswer

http://stackoverflow.com/q/28278417
answer count: 1
tagged with: gwt
has title: GWT and Javascript
has answer: http://stackoverflow.com/a/28280510
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44911206
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44912924
favorite count: 0
has body: Unable to call javamethod from javascript in a GWT java class. Please find the code snippet from below. package abc; public class jsclass extends Composite { public native boolean getOnlineSchedlueResult() /*-{ function listener(event) { //alert("getOnlineScheduleResult called 2 Outside"); var data = JSON.parse(event.data); if(data.FinderSuccess == true){ parent.onlineMoveNavigation = this.@abc.jsclass::onlineMoveNavigation()(); } } if (parent.addEventListener){ //alert("parent getOnlineScheduleResult called 3"); parent.addEventListener("message", listener, false); //alert("getOnlineScheduleResult called 3A"); parent.postMessage("test", "*"); } else { //alert("getOnlineScheduleResult called 4"); parent.attachEvent("onmessage", listener); parent.postMessage("test", "*"); } }-*/; public void onlineMoveNavigation(){ GWT.log("onlineMoveNavigation called"); presenter.moveNavigationNext(); } }
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/44930037

http://stackoverflow.com/comment/44650286
comment on: http://stackoverflow.com/q/28139290
score: 0
has text: hmmm. i try later, after this case not fix
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28235044
has comment: http://stackoverflow.com/comment/44834734
has comment: http://stackoverflow.com/comment/44833816
upvote count: 4
has comment: http://stackoverflow.com/comment/44834510
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28234904
type: Answer
has body: Below should work for you,just use filter on array. var a=[{"month":1,"year":2015},{"month":2,"year":2015},{"month":3,"year":2015},{"month":4,"year":2015},{"month":5,"year":2015}]; var b=[{"month":1,"year":2015},{"month":2,"year":2015},{"month":5,"year":2015}]; var diff = a.filter(function(a){ return b.filter(function(b){ return b.month == a.month &amp;&amp; b.year == a.year }).length == 0 }); console.log(diff);
answers question: http://stackoverflow.com/q/28234904
has comment: http://stackoverflow.com/comment/44834294
has comment: http://stackoverflow.com/comment/44834754
has comment: http://stackoverflow.com/comment/44833574

jakarta-ee
tags question: http://stackoverflow.com/q/28213030
type: Tag
tag name: jakarta-ee
tags question: http://stackoverflow.com/q/28150354
tags question: http://stackoverflow.com/q/28219711

http://stackoverflow.com/comment/44805700
comment on: http://stackoverflow.com/a/28221273
score: 0
type: AnswerComment
type: Comment
has text: Ok thank you, but how can I avoid that the two old actions are executed?

http://stackoverflow.com/q/28180921
has body: As far as I concern, .style.some_property only returns the value of the property if I setting it in javascript. If I don't, it returns empty string. So, is there any other way other than jQuery methods like css() and prop() to get value of a css property?
has comment: http://stackoverflow.com/comment/44731079
favorite count: 0
duplicate of: http://stackoverflow.com/q/2664045
has comment: http://stackoverflow.com/comment/44731021
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
linked to: http://stackoverflow.com/q/2664045
type: Question
has title: is there any way using plaint JS to get value of a css property of an element?
has comment: http://stackoverflow.com/comment/44731051
has comment: http://stackoverflow.com/comment/44731122
tagged with: javascript
has comment: http://stackoverflow.com/comment/44731033
has comment: http://stackoverflow.com/comment/44730975
has comment: http://stackoverflow.com/comment/44731002
upvote count: 1

http://stackoverflow.com/comment/44892325
comment on: http://stackoverflow.com/q/28267202
score: 0
has text: Thanks Alexey! How would I fix it?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44716326
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28172868
has text: ok how can i use this directive 'ngFocus' to focus the next element ?

http://stackoverflow.com/comment/44756413
comment on: http://stackoverflow.com/q/28194518
type: Comment
has text: That is correct. When the user starts with an "S" for example, the Spanish and Serbian flags will show before or after the suggested items "Spain" and "Serbia".
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44743273
comment on: http://stackoverflow.com/q/28187306
type: Comment
type: QuestionComment
has text: Sorry guys I used as \' because its in PHP code, it is working fine, the problem is with classess etc.
score: 0

http://stackoverflow.com/a/28161324
type: Answer
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44697983
has body: you can do it in one line: $clone.attr('class', your_classes).appendTo('#imageArea');
answers question: http://stackoverflow.com/q/28161150

http://stackoverflow.com/a/28198075
answers question: http://stackoverflow.com/q/28197946
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44763518
accepted answer of: http://stackoverflow.com/q/28197946
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44820813
has comment: http://stackoverflow.com/comment/44762910
has body: $('#box').qtip({ content: { text: 'Mouse tracking! Content' } }) Demo
score: 2
downvote count: 0

http://stackoverflow.com/a/28246942
answers question: http://stackoverflow.com/q/28245798
type: Answer
accepted answer of: http://stackoverflow.com/q/28245798
score: 0
has body: Found the perfect library! https://github.com/AnalogJ/matchmedia-ng ^ Here is the code that fixed my issue (needed an Angular way to detect size) var unregister = matchmedia.onPhone( function(mediaQueryList){ $scope.isPhone = mediaQueryList.matches; }); Did have to use the overrides to adjust to my pixel specifications: angular.module('myapp', ['matchmedia-ng']).config(['matchmediaProvider', function (matchmediaProvider) { matchmediaProvider.rules.phone = "(max-width: 500px)"; matchmediaProvider.rules.desktop = "(max-width: 1500px)"; }]); Also had to go ahead with 2 different navs :/ will still try to play around with this a bit to see if I can get it down to using just 1 nav: &lt;div class="mobile_nav noselect"&gt; &lt;div ng-click="isMobileNavOpen = !isMobileNavOpen" class="icon-menu"&gt;&lt;/div&gt; &lt;/div&gt; &lt;nav id="main_nav"&gt; &lt;nav id="mobile_nav" ng-show="isMobileNavOpen"&gt;
type: AcceptedAnswer

http://stackoverflow.com/q/28194148
tagged with: javascript
duplicate of: http://stackoverflow.com/q/901115
linked to: http://stackoverflow.com/q/6644654
type: Question
has title: Parsing date parameters with JavaScript without using a third-party library?
has comment: http://stackoverflow.com/comment/44755270
has comment: http://stackoverflow.com/comment/44755205
tagged with: parsing
has comment: http://stackoverflow.com/comment/44755181
has body: If I have a URL like this: http://localhost/my/service/endpoint?from=2015-01-28T05:55:00.000-06:00&amp;to=2015-01-28T07:55:00.000-06:00 I want to be able to parse the from and to get parameters into JavaScript variables but the URL could potentially have additional parameters before or after what's shown above. What's the best way to parse these without using a third-party library? I'm interested in being able to parse the full date for fromand to and nothing but these dates regardless of the number of GET params in the URL.
score: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/901115
answer count: 0

http://stackoverflow.com/comment/44837398
type: AnswerComment
comment on: http://stackoverflow.com/a/28237563
score: 0
type: Comment
has text: That was exactly the problem. Thanks.

http://stackoverflow.com/comment/44636676
has text: you should store the result from Math.floor in value or the while loop won't work
type: Comment
comment on: http://stackoverflow.com/a/28132016
score: 3
type: AnswerComment

http://stackoverflow.com/comment/44868350
score: 0
type: Comment
type: QuestionComment
has text: console logging `req.baseUrl` is in fact returning what I'm expecting, i.e. `/test/abcd!`, and even the regex test I posted above returns `true`. Not sure what's going on, Express is using `path-to-regex` which does a lot of things to my expression. I'm just going to consolidate it into one route for now and use an `if` block.
comment on: http://stackoverflow.com/q/28254572

http://stackoverflow.com/a/28172787
accepted answer of: http://stackoverflow.com/q/28172785
answers question: http://stackoverflow.com/q/28172785
has comment: http://stackoverflow.com/comment/49143899
type: AcceptedAnswer
upvote count: 9
type: Answer
has body: This is a little bit of a hack job, but you can conditionally hide and show the elements to avoid an infinite loop. On hide, check if this is the first time attempting to hide. If the input does not have focus (meaning they have used the dropdown and we've lost our tab order, then refocusing will cause the picker to show. We'll also catch this show and hide from there, entering back into our original code. We'll pass back and forth a property on the object so we can manage state. That will look like this: $(".datepicker").datepicker({ autoclose: true }) .on('hide', function () { if (!this.firstHide) { if (!$(this).is(":focus")) { this.firstHide = true; // this will inadvertently call show (we're trying to hide!) this.focus(); } } else { this.firstHide = false; } }) .on('show', function () { if (this.firstHide) { // careful, we have an infinite loop! $(this).datepicker('hide'); } }) Stack Snippet Demo: $(".datepicker").datepicker({ autoclose: true }) .on('hide', function () { if (!this.firstHide) { if (!$(this).is(":focus")) { this.firstHide = true; // this will inadvertently call show (we're trying to hide!) this.focus(); } } else { this.firstHide = false; } }) .on('show', function () { if (this.firstHide) { // careful, we have an infinite loop! $(this).datepicker('hide'); } }) &lt;link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/&gt; &lt;link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.1/css/datepicker.css" rel="stylesheet"/&gt; &lt;script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"&gt;&lt;/script&gt; &lt;script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.js"&gt;&lt;/script&gt; &lt;script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.1/js/bootstrap-datepicker.js"&gt;&lt;/script&gt; &lt;input type="text" class="datepicker" /&gt;&lt;br/&gt; &lt;input type="text" class="datepicker" /&gt;&lt;br/&gt; &lt;input type="text" class="da…
downvote count: 0
score: 9

http://stackoverflow.com/comment/44798769
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28217575
has text: Well did you include highcharts? What do the errors in the console say?
score: 0

http://stackoverflow.com/comment/44815296
type: QuestionComment
comment on: http://stackoverflow.com/q/28225990
score: 0
has text: Oddly it still calls the function once. I initially had self.refreshServers = new function so I think that's why I didn't have the parens at one point.
type: Comment

http://stackoverflow.com/comment/44843524
score: 0
comment on: http://stackoverflow.com/q/28240940
type: Comment
type: QuestionComment
has text: I'm not suggesting touching the plugin. I'm suggesting adding a symlink to your project's directory structure so you **don't** have to touch the plug-in or fool around with obtuse grunt rules.

http://stackoverflow.com/q/28194066
score: 0
tagged with: openstreetmap
answer count: 2
tagged with: 3d
has answer: http://stackoverflow.com/a/28195766
accepted answer: http://stackoverflow.com/a/28195766
tagged with: http://stackoverflow.com/tag/html
has title: how to render a 3d map with html5/js with point of interest
type: AnsweredQuestion
has body: i need to rendere a 3d map like https://www.airbnb.it/map and put on it some "point" at runtime, loading them dinamically via rest. have someone information about building a 3d map (eventually getting data from openstreetmap) via js or others techniques? thanks
has answer: http://stackoverflow.com/a/28194519
type: Question
possible better answer: http://stackoverflow.com/a/28194519
tagged with: javascript

http://stackoverflow.com/comment/44706018
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28167989
type: QuestionComment
has text: the code doesn't work, i see the back cards on the left of the page but when i click on nothing happens

http://stackoverflow.com/comment/44917955
type: Comment
comment on: http://stackoverflow.com/a/28275757
type: AnswerComment
has text: A minor clarification: the use of the OR `|` bar itself does not need parentheses. The OR bar works on the innermost group if parentheses are present (as do all other regex commands), and on the entire regex if not.
score: 0

http://stackoverflow.com/q/28168845
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28168990
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28168990
score: 0
has title: Unable to display Todo Collection on the page
tagged with: backbone.js
has body: Iam practising Backbone JS, below is the code Iam tying to display Todo Collection on the page. But iam not understanding what went wrong with the below code and at end displaying nothing. BTW, Iam able to get data from server and console logs too showing correct data, but just not displaying on the page. Seems like my render calling before than getting data from server, but dont know why is that happening like that. Here is the code, please suggest me what went wrong?

http://stackoverflow.com/comment/44700544
type: QuestionComment
has text: A note: if you have `href="javascript:void(0)"` for an `a` and clicking that `a` will only trigger some visual effect, then you most likely should not use an `a` there. Is there a reason why you don't use a `div`?
comment on: http://stackoverflow.com/q/28164029
score: 0
type: Comment

http://stackoverflow.com/comment/44756834
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28172508
has text: Yeah, I have tried to display the shape.. am able to get circle shape only.. not get the expected output

http://stackoverflow.com/q/28171058
has answer: http://stackoverflow.com/a/28171117
accepted answer: http://stackoverflow.com/a/28171117
has title: AngularJS loading individual userProfiles
tagged with: angularjs
tagged with: php
type: AnsweredQuestion
has body: I'm new to AngularJS trying to create a small service as a student project. I have a html5 template available under http:.../profile.html This template is "angularJS-friendly" meaning that I can load any profile informating in my profile.html ( e.g. username with {{user.username}}, ...) from a Rest service providing me with a appropriate json Now when I want to load http:../profile/{usernameXYZ} as in PHP /profile.php?username=usernameXYZ How do I do this? To be more specific: How do I create/load/??? individual profile pages with only one template in angularJS
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/44936245
score: 0
type: AnswerComment
has text: could you please check, you set "Id" attribute for both button.? Bcoz we have checked based on it id only.
comment on: http://stackoverflow.com/a/28229403
type: Comment

http://stackoverflow.com/comment/44763128
score: 0
type: AnswerComment
has text: That means I need to downgrade angular library, I don't really want to do that because I use the new features on 1.3. The only solution I found around is manually maintain those libraries but would like to find another solution inside bower.
type: Comment
comment on: http://stackoverflow.com/a/28196732

http://stackoverflow.com/comment/44840921
has text: I understood your question. I see in the code above that you are handling a `mouseover` in the legend to show your "tooltip" div. Obviously this code isn't working. So, being the nice StackOverflow user I am, I went to debug your code. **BUT** the above code doesn't run, too many undefined variables. At that point I can no longer help you.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28238349

http://stackoverflow.com/a/28139880
answers question: http://stackoverflow.com/q/28139841
downvote count: 1
score: -1
upvote count: 0
has body: If your selector is correct ( the str_rate ) then you can probably get the value through var value = str_rate.val() ( see http://api.jquery.com/val/ ). Then you can upp that value and re-set it to the element through the .val() method again, only this time, passing in the new value, or through .html() as you are already using.
type: Answer

http://stackoverflow.com/comment/44775652
has text: will you have variable data even for the initial render? if not, getDefaultProps will do the job then, and componentWillReceiveProps will do the job subsequently. if the data is variable, you can simply transform props in the render method. duplicating logic like that is fairly common, IMO. In my company's flux stack, we often do similar and sometimes identical things for getInitialState and for when the store changes.
comment on: http://stackoverflow.com/a/28201768
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28208693
has answer: http://stackoverflow.com/a/28209246
has comment: http://stackoverflow.com/comment/44782300
downvote count: 1
possible better answer: http://stackoverflow.com/a/28209235
type: AnsweredQuestion
score: 2
has body: I've been trying to push a complex json data record into a json variable. This is the code I tried to do so. var marks=[]; var studentData="student1":[{ "term1":[ {"LifeSkills":[{"obtained":"17","grade":"A","gp":"5"}]}, {"Work":[{"obtained":"13","grade":"A","gp":"5"}]} ] "term2":[ {"LifeSkills":[{"obtained":"17","grade":"A","gp":"5"}]}, {"Work":[{"obtained":"13","grade":"A","gp":"5"}]} ] }]; marks.push(studentData); But it doesn't push anything to the json array.Can anyone please help me to get rid of this.
has comment: http://stackoverflow.com/comment/44782097
upvote count: 3
accepted answer: http://stackoverflow.com/a/28209343
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44782758
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44782114
has title: Push complex json record into a json variable using javascript
answer count: 3
has comment: http://stackoverflow.com/comment/44783235
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28209343
favorite count: 0
has answer: http://stackoverflow.com/a/28209235

http://stackoverflow.com/comment/44860963
type: Comment
comment on: http://stackoverflow.com/a/28250705
type: AnswerComment
has text: if we have two labels how can i access the second one
score: 0

http://stackoverflow.com/comment/44751082
has text: What I meant was that JavaScript would allow an attacker to decrypt these values right there. Base64 may be less readable, but it certainly isn't a solution to prevent attacks.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28191902
type: AnswerComment

http://stackoverflow.com/comment/44814722
type: AnswerComment
comment on: http://stackoverflow.com/a/28225622
has text: @elclanrs it is, but the thing is that as a "primitive value" it is not required to be resolved as a global object attribute (it's an implementation specifics, not the standard requirement). Do you expect `42` to be resolved as a `global['42']`?
score: 0
type: Comment

http://stackoverflow.com/a/28191657
has comment: http://stackoverflow.com/comment/44751730
has comment: http://stackoverflow.com/comment/44753259
has comment: http://stackoverflow.com/comment/44751908
has comment: http://stackoverflow.com/comment/44753344
type: AcceptedAnswer
downvote count: 0
has body: Mocha does not have any notion of a special file named helper.js that it would load before other files. What you are trying to do works when you run mocha --recursive because of the order in which Mocha happens to load your files. Because helper.js is one level higher than the other files, it is loaded first. When you specify an individual file to Mocha, then Mocha just loads this file and, as you discovered, your helper.js file is not loaded at all. So what you want to do is load a file such that it will set top level ("global") hooks (e.g. before, after, etc.). Options: You could use Mocha programmatically and feed it the files in the order you want. You could force yourself to always specify your helper file on the command line first before you list any other file. (I would not do this, but it is possible.) Another option would be to organize your suite like I've detailed in this answer. Basically, you have one "top level" file that loads the rest of the suite into it. With this method you'd lose the ability of running Mocha on individual files, but you could use --grep to select what is being run. You cannot use the -r option. It loads a module before running the suite but, unfortunately, the loaded module does not have access to any of the testing interface that Mocha makes available to your tests so it cannot set hooks.
accepted answer of: http://stackoverflow.com/q/28191243
score: 29
has comment: http://stackoverflow.com/comment/73532842
answers question: http://stackoverflow.com/q/28191243
type: Answer
upvote count: 29

http://stackoverflow.com/comment/44651175
type: Comment
comment on: http://stackoverflow.com/a/28135069
score: 0
type: AnswerComment
has text: I would +1 this but the OP states that on scroll positions other than 2950 it should return to its default position. *"What I want is when I scroll down, or scroll up, or when my scroll bar is not on 2950px, The position of my .lion_head moves to its original position"*

http://stackoverflow.com/q/28253455
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/4244896
has body: I have a code like this: for (var i = 0; i &lt; result.Table.length; i++) { for (var x = 0; x &lt; count; x++) { var xIndex = 'F' + (x + 1) var item = result.Table[i].xIndex; console.log(item) } } But unfortunately I can't use xIndex in example as this. So how to change script to be able to set xIndex as identifier? Thanks.
has comment: http://stackoverflow.com/comment/44865522
tagged with: for-loop
answer count: 1
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/4244896
downvote count: 3
has answer: http://stackoverflow.com/a/28253471
accepted answer: http://stackoverflow.com/a/28253471
upvote count: 0
tagged with: identifier
has title: Using variable as identifier in object
score: -3
type: Question

http://stackoverflow.com/q/28150415
type: Question
answer count: 2
has title: How to extend method (monkey patch) without a temporary variable?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/67440095
has answer: http://stackoverflow.com/a/28150880
has comment: http://stackoverflow.com/comment/44672955
favorite count: 0
has body: Must be phrasing my question wrong, since I cannot find existing questions on what would seem an often issue. I have a class Foo. var Foo = function () { return { a: function () {} }; }; I have another class Bar that is instantiated with an instance of Foo: var Bar = function (foo) { // Does something with foo. }; I want to extend the Foo instance to work differently for Bar: var Bar = function (foo) { foo.a = function () { return foo.a.apply(this, arguments); }; // Does something with foo. }; Doing the way I did it, will cause RangeError: Maximum call stack size exceeded. Is there a way to extend the method itself without a temporary variable? This is the way to do it using an extra variable: var Bar = function (foo) { var originala; originala = foo.a; foo.a = function () { return originala.apply(this, arguments); }; // Does something with foo. };
linked to: http://stackoverflow.com/q/20748061
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
score: 1

http://stackoverflow.com/comment/44646191
has text: I'm able to use methods such as {{test.value}} in order to retrieve all the values in the scope, but maybe Im wrong?
comment on: http://stackoverflow.com/a/28136740
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44727931
comment on: http://stackoverflow.com/a/28174293
score: 0
type: AnswerComment
type: Comment
has text: maybe something like http://stackoverflow.com/questions/6962658/randomize-setinterval-how-to-rewrite-same-random-after-random-interval ?

http://stackoverflow.com/a/28236739
downvote count: 0
answers question: http://stackoverflow.com/q/28236608
score: 1
has body: Use jQuery.toggle(): function showhide() { $('#mapsec').toggle(); }
type: Answer
upvote count: 1

http://stackoverflow.com/a/28238454
has body: You can do this: onkeydown="keydownFunction()" If you only want it on a specific key you can do this onkeydown="keydownFunction(key)" Then a function that looks like this: function keyDownFunction(e){ if(e.which == 10){ doSomething(); } else { return; } } 10 will be whatever your key code is, you can figure out what code you need here http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/28238344
answers question: http://stackoverflow.com/q/28238344
type: Answer

http://stackoverflow.com/comment/44688048
has text: Yes, http://localhost:5000/items/"id" also gives a 404. Console logs this: Navigated to http://localhost:5000/dashboard/items/events dpd.js:61 GET http://localhost:5000/__resources/items/validate.js 404 (Not Found) dpd.js:61 GET http://localhost:5000/__resources/items/delete.js 404 (Not Found)
comment on: http://stackoverflow.com/a/28157893
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28213390
has comment: http://stackoverflow.com/comment/44798022
has title: UIWebView incorrect display site, javascripts don't load after loading page
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44795920
answer count: 0
has comment: http://stackoverflow.com/comment/44794463
type: Question
tagged with: ios
tagged with: javascript
has body: I use UIWebView in my app. And only one site load without css styles (only mobile version, with desktop all alright). I try load this site in Safari on my iOS device, all good. There is problem only with webView. Doesn't help load with UIWebView LoadRequest method or transition to this page from full version of site. Source code of this site has tag &lt;noscript&gt; and text from this tag shown on this webview. It's look like something don't let download all scripts and styles, because in Chrome I looked source code of full loaded mobile site and it has more scripts, then page in WebView. Moreover, I tried change UIWebView to the WKWebView, the problem remained. Also I use Xamarin.Forms and tried Forms.WebView - nothing. Is it a problem with code of site?
has comment: http://stackoverflow.com/comment/44791463
score: 0
tagged with: xamarin
tagged with: uiwebview

http://stackoverflow.com/a/28202575
accepted answer of: http://stackoverflow.com/q/28202077
type: Answer
has body: As with most things of this nature, the answer is "it depends" and that you need to pick a middle ground. In general, the advice is to place events at least relatively close to their source in the DOM tree to avoid excessive bubbling, and to avoid placing events on the body unless it's necessary. As an example, you could place a handler on your ul to handle event delegation for your lis: document.getElementById('test4').addEventListener('click', function (e) { // handle event for li }); This gives you the best of both worlds because you: Have one event bound to your DOM to handle li clicks instead of a separate copy for every li Don't have to reattach events if the set of lis is dynamically modified Have minimal bubbling (just one level) Don't have to multiplex the logic in a big ugly switch statement So I think that's a worthwhile principle to keep in mind.
has comment: http://stackoverflow.com/comment/44772762
answers question: http://stackoverflow.com/q/28202077
has comment: http://stackoverflow.com/comment/44772101
has comment: http://stackoverflow.com/comment/44771810
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44772674
has comment: http://stackoverflow.com/comment/44771518
has comment: http://stackoverflow.com/comment/44772711
has comment: http://stackoverflow.com/comment/44771778
has comment: http://stackoverflow.com/comment/44771716
has comment: http://stackoverflow.com/comment/44771697

http://stackoverflow.com/q/28147426
score: -4
has answer: http://stackoverflow.com/a/28147475
has answer: http://stackoverflow.com/a/28147494
has answer: http://stackoverflow.com/a/28147467
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28147724
has comment: http://stackoverflow.com/comment/44666543
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44666684
has body: I've a code function person() { name = "David"; hello = function() { console.log("I'm in hello"); }; } And I want to invoke hello function from outside. How can I achieve it?
has comment: http://stackoverflow.com/comment/44666721
has comment: http://stackoverflow.com/comment/44666801
has answer: http://stackoverflow.com/a/28147480
downvote count: 6
upvote count: 2
has answer: http://stackoverflow.com/a/28147724
has title: How to invoke function inside another function in JavaScript as I've mentioned below
possible better answer: http://stackoverflow.com/a/28147475
answer count: 5
tagged with: javascript

http://stackoverflow.com/q/28277839
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44909960
downvote count: 1
has title: how to loop array of functions and execute one at a time onclick
type: Question
tagged with: function
upvote count: 0
has body: var index=0; function canvasp() { var array_of_functions = [canvaspoint,canvaspoint1]; array_of_functions[index++]('a string'); } Next here in this code i have created a array containing two functions and increment the array onclick..on clicking the button the first function executes and if clicked again the second function executes but still the op of first function remains..i need only one function to execute on click and increment to second hiding the first..i tried of using for loop but not working can anybody help chk this fiddle http://jsfiddle.net/karthikchandran/hrvs4fzd/1/
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28277965
has comment: http://stackoverflow.com/comment/44910492
answer count: 1

http://stackoverflow.com/q/28209320
has comment: http://stackoverflow.com/comment/45131915
possible better answer: http://stackoverflow.com/a/28210964
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28210964
accepted answer: http://stackoverflow.com/a/28412143
score: 12
has body: Using jQuery when changing .html() of an inside a (Which I had previously set selectedIndex property to -1) resets selectedIndex property of from '-1' to '0' JS Bin (01) (02) (03) http://jsbin.com/filowe/2/edit?html,output
has answer: http://stackoverflow.com/a/28209442
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28375902
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45088692
has title: Changing .html() of resets selectedIndex property of from '-1' to '0'
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28412143
has comment: http://stackoverflow.com/comment/45157919
tagged with: dom
type: Question
upvote count: 12
has comment: http://stackoverflow.com/comment/45118370

http://stackoverflow.com/q/28146254
has comment: http://stackoverflow.com/comment/44664174
tagged with: javascript
tagged with: jquery
has title: callback function inside of controller finishing after ng-options
score: 0
tagged with: asynchronous
tagged with: angularjs
tagged with: d3.js
has answer: http://stackoverflow.com/a/28147074
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28151608
has body: I parse my data using d3 and a call back function and use a select tag and ng-options to create a dropdown. The problem is the callback function does not finish before the page loads. Thus, how can I solve this problem of using callback function inside a controller? For more clarification, if I have a dataset outside the callback function this works and fills my ng-options perfectly.
type: Question
answer count: 2

http://stackoverflow.com/a/28172759
score: 0
type: Answer
has body: the logical order of your if statements and loop is incorrect for what you are trying to achieve. you want to first check if this number is a number, then you want to check if tis a whole number, then you want to enter the for loop if it passes those 2 requirements. $(document).ready(function () { var fizzBuzz = function () { var userNum = prompt('Enter a number!'); var convertNum = +userNum; if(isNaN(userNum)){ alert("Input is not a number"); fizzBuzz(); } else if (convertNum % 1 !== 0) { alert('Please enter a whole number'); fizzBuzz(); } else { for (var i = 1; i &lt;= convertNum; i++) { if (i % 15 === 0) { $('ul').append('&lt;li&gt;' + "fizzbuzz" + '&lt;/li&gt;'); } else if (i % 3 === 0) { $('ul').append('&lt;li&gt;' + "fizz" + '&lt;/li&gt;'); } else if (i % 5 === 0) { $('ul').append('&lt;li&gt;' + "buzz" + '&lt;/li&gt;'); } else { $('ul').append('&lt;li&gt;' + i + '&lt;/li&gt;'); } } } }; fizzBuzz(); });
answers question: http://stackoverflow.com/q/28172526
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28172526
has comment: http://stackoverflow.com/comment/44715208

http://stackoverflow.com/q/28240336
possible better answer: http://stackoverflow.com/a/28240392
upvote count: 1
accepted answer: http://stackoverflow.com/a/28240351
has answer: http://stackoverflow.com/a/28240392
downvote count: 1
type: Question
has title: specific element in array from array of object
has answer: http://stackoverflow.com/a/28240408
tagged with: javascript
tagged with: jquery
answer count: 3
favorite count: 0
has body: i have an array like myArray = [{'id':'73','foo':'bar'},{'id':'45','foo':'bar'}, etc.] How can i retrive an array with only id like? myArrayResult = [73,45] with jQuery or javascript. thanks
has answer: http://stackoverflow.com/a/28240351
type: AnsweredQuestion
score: 0

http://stackoverflow.com/q/28126873
downvote count: 0
tagged with: setinterval
has comment: http://stackoverflow.com/comment/44626725
has comment: http://stackoverflow.com/comment/44626748
favorite count: 0
has answer: http://stackoverflow.com/a/28126894
type: Question
upvote count: 2
has body: I have two array: pts and I want to create new test array. Every time I add new object from pts to test I need to call function that will execute mimicSvg(test,1) function, with array test (from 0 to m) I write: var test=[{"X":"300","Y":"400"}]; for(var m=1;m&lt;pts.length;m++){ var q = pts[m].X; var e = pts[m].Y; test.push({"X":q,"Y":e}); setInterval(mimicSvg(test,1), 2000); } but setInterval dont work, instead that I get execution on all m times function at the same time. How I can solve that problem?
has comment: http://stackoverflow.com/comment/44634623
linked to: http://stackoverflow.com/q/10182714
has comment: http://stackoverflow.com/comment/44627647
answer count: 1
tagged with: for-loop
linked to: http://stackoverflow.com/q/18687795
tagged with: arrays
has title: Jquery setInterval into for loop
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44626734
score: 2

http://stackoverflow.com/comment/44769136
type: Comment
comment on: http://stackoverflow.com/q/28201398
has text: @Greg If the start date was null I would fully expect the code to fail. The fact that start date is not null is when the issue happens. Start Date is set by the user but there are some cases where end date needs to be the next day (if statement above the first code section, it is getting hit because other code in the if statement is being executed correctly).
score: 0
type: QuestionComment

http://stackoverflow.com/a/28185072
type: Answer
score: 1
upvote count: 1
has body: You just need callback function, after loading jquery secessfully: var loadJS = function(url, cb) { var script_tag = document.createElement('script'); script_tag.setAttribute("type", "text/javascript"); script_tag.setAttribute("src", url); if (script_tag.readyState) { script_tag.onreadystatechange = function() { // For old versions of IE if (this.readyState == 'complete' || this.readyState == 'loaded') { cb();//calling callback } }; } else { // Other browsers script_tag.onload = cb;//calling callback function } (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); }; And simply call this function with jquery library path and callback function reference: loadJS(hostUrl + "/js/libraries/jquery.js", callback);
downvote count: 0
answers question: http://stackoverflow.com/q/28184887

http://stackoverflow.com/comment/44635651
score: 0
has text: What do you mean here by "*library*"?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28131481

http://stackoverflow.com/q/28132020
score: 1
favorite count: 0
type: UnansweredQuestion
has title: Wordpress Customizer, FS and :after CSS
tagged with: css
has body: Ok, I am trying to integrate my theme with the WordPress Customizer API. Everything is OK, except for the JS part. I have this piece working as expected: // Header back color. wp.customize( 'header_backcolor', function( value ) { value.bind( function( to ) { if ( 'blank' === to ) { $( 'header' ).css( { 'background': '#18bc9c' } ); } else { $( 'header' ).css( { 'background': to, } ); } } ); } ); Now I need to apply the same modification (on the fly) to a header hr.star-light:after element, but this next piece is not working, although is the same code(I've only substituted header for header hr.star-light:after: // Header Star Light back color. (not working) wp.customize( 'header_backcolor', function( value ) { value.bind( function( to ) { if ( 'blank' === to ) { $( 'header hr.star-light' ).css( { 'background-color': '#18bc9c' } ); } else { $( 'header hr.star-light' ).css( { 'background-color': to, } ); } } ); } ); Can anybody show me what is wrong? Is it related to the :after pseudo CSS? I don't get it, cause it is working correctly at the inline CSS, after saving changes. My problem is only with the js to show changes in real time.
has answer: http://stackoverflow.com/a/30932977
tagged with: wordpress
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
answer count: 1

http://stackoverflow.com/q/28255685
has body: Below is working code to use jquery+javascript with Bitly's API to shorten a link (when you have a Bitly account with a login and API key). My question is, how can I produce the exact same result using only pure javascript with no other libraries available? Thank you very much to anybody who can help me out. EDIT: This question does not already have an answer (the recommended answer is not relevant at all) due to how specific this is. Also, no references to DOM are possible as this is for server-side code. Therefore every single answer in the suggested duplicate question will not work. Please do not mark this as duplicate. I believe the way to do this is with an xmlhttprequest, but I have absolutely no idea how... Thanks again. var login = "LOGIN_HERE"; var api_key = "API_KEY_HERE"; var long_url = "http://www.kozlenko.info"; $.getJSON( "http://api.bitly.com/v3/shorten?callback=?", { "format": "json", "apiKey": api_key, "login": login, "longUrl": long_url }, function(response) { alert('Shortened link is: ' + response.data.url); } );
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28259513
favorite count: 0
linked to: http://stackoverflow.com/q/7967037
linked to: http://stackoverflow.com/q/6132796
type: Question
has answer: http://stackoverflow.com/a/28259513
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
has title: Bitly API - how to shorten a link with pure javascript, no libraries available (not even jquery)
tagged with: bit.ly
tagged with: ajax

http://stackoverflow.com/q/28130097
tagged with: firefox
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28130608
tagged with: firefox-addon
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
score: 3
upvote count: 3
has title: When do I load a browser frame script (e10s)?
tagged with: e10s
type: Question
has body: I'm trying to port one of my Firefox extensions to support Electrolysis (e10s). My extension grabs some page data and puts it on the clipboard via a context-menu item that the user can click. Based on the message manager documentation, there are 3 types of message managers available: Global Window Browser Since my add-on is context specific, the last one seems like the one I want to use. The problem is that I don't fully know when to load the frame script. A simplified version of my context menu item's action handling code looks like this: onContext: function() { let browserMM = gBrowser.selectedBrowser.messageManager; browserMM.loadFrameScript("chrome://myaddon/content/frame-script.js", true); browserMM.sendAsyncMessage("myaddon@myaddon.com:get-page-info", json); } Loading the frame script here seemed like the best idea to me since (a) the frame script isn't guaranteed to get used on every page and (b) I figured that frame scripts are loaded once and only once per &lt;browser&gt;. The second theory isn't correct it seems; each time I call loadFrameScript, a new copy gets loaded. Even load-protection logic (i.e. only creating the frame script functions if they don't already exist) doesn't seem to fix the problem. So, my problem is that each time the context menu item is accessed, a new copy of the frame script gets loaded. And since my frame script adds a message listener, I get duplicate messages on subsequent calls of the context menu item. When should I load browser frame scripts? Loading it once on add-on initialization doesn't seem to work well, since it only loads on the first &lt;browser&gt; (I want this code to execute when asked for by any subsequent &lt;browser&gt;). But loading it on demand appears to duplicate things. Are there other strategies I'm missing here?
has answer: http://stackoverflow.com/a/28130608

jquery-ui-autocomplete
tags question: http://stackoverflow.com/q/28213631
tags question: http://stackoverflow.com/q/28271986
type: Tag
tags question: http://stackoverflow.com/q/28176552
tag name: jquery-ui-autocomplete

http://stackoverflow.com/comment/44867175
type: Comment
has text: Because there, the *function expression is evaluated* on every constructor call, creating a new function object each time (and then assigning it to the respective instance). It's not the assignment that is responsible for this.
comment on: http://stackoverflow.com/a/28251553
score: 0
type: AnswerComment

http://stackoverflow.com/q/28181663
tagged with: jquery
has answer: http://stackoverflow.com/a/28216121
has comment: http://stackoverflow.com/comment/44732746
has comment: http://stackoverflow.com/comment/44732855
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44732675
has title: Assign random number to element in javascript but avoid duplicates
has comment: http://stackoverflow.com/comment/44733142
has comment: http://stackoverflow.com/comment/44732609
type: Question
possible better answer: http://stackoverflow.com/a/28216121
has answer: http://stackoverflow.com/a/28181801
tagged with: javascript
has body: Please scroll down to bold text if you want to go straight to the question I have made a page that consists of a grid of 9 tiles (divs). Between 1-9 of those tiles could potentially have a slider inside it. The sliders are all setup via a jQuery each function e.g _gridSlider.each(function(){ // count slides, setup slider etc }); // end slider each function Everything works fine except the sliders all change at the same time and so I want to add some diversity into the start times. Right now I create a random ID between 1 and X (X being the number of sliders) inside of the each function for each slider like so _gridSlider.each(function(){ var _sliderID = Math.floor((Math.random() * _numSliders) + 1); }); // end slider each function I then start the sliders at a different time based around this ID like so var _sliderStart = _sliderID + '000'; setTimeout(function() { startTimer(); }, _sliderStart); This works fine the only problem is that it is possible for 2 or more sliders to have the same ID, what I need is to assign each slider an ID between 1 and X but make sure that each slider has a different ID. The end result would be have 1 timer starting at 1 second, another at 2 seconds, another at 3 seconds etc
accepted answer: http://stackoverflow.com/a/28181801
has comment: http://stackoverflow.com/comment/44732778
score: 0
answer count: 2

http://stackoverflow.com/q/28238157
has answer: http://stackoverflow.com/a/28238222
type: Question
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28238222
score: 4
has comment: http://stackoverflow.com/comment/44837567
has title: How to catch Bootstrap navbar dropdown event?
answer count: 1
tagged with: javascript
upvote count: 4
has body: I'm using the basic Twitter Bootstrap navbar for my menu, and I now want to show notifications in a dropdown inspired by the system here on Stackoverflow. To accomplish this I want to call the api when clicking the dropdown, for which I need to "catch" the dropdown event. According to the docs, I need to catch the event like so: $('#myDropdown').on('show.bs.dropdown', function () { // do something… }) So I've got a working fiddle here, but when I use the exact same code in my own html (see below) it doesn't work anymore. Does anybody know what's wrong with the code below: My Website Notifications
type: AnsweredQuestion
downvote count: 0
tagged with: events
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28133048
downvote count: 1
answers question: http://stackoverflow.com/q/28132993
type: Answer
upvote count: 0
score: -1
has body: A value should be a string and a string starts with quotes. In other news, script language= , document.write and navigator.geolocation sure is an interesting mix. Kind of like a javascript hall of fame through the ages

http://stackoverflow.com/comment/44685374
comment on: http://stackoverflow.com/a/28156917
has text: one problem: it doesnt work in a scenario like 20"-10" it still returns 10 where as it should return the bigger value 20
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44623971
type: QuestionComment
comment on: http://stackoverflow.com/q/28125282
score: 0
has text: ? Sorry I dont userstand which bit are you refering to this part })( jQuery );
type: Comment

http://stackoverflow.com/a/29090165
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28184127
has body: Tried a different solution to print as shown in the demo here http://salman-w.blogspot.com/2013/04/printing-wide-html-tables.html. It worked ! Note: I am using a Kendo grid, with that the following solution perfectly works ! This has some additional filter display stuff.etc. Please remove the same if not required. I am sure it can be optimized, but this is the quick code that works. function printGrid() { var gridElement = $('#grid'), firstprintableContent = '', lastprintableContent = '', win = window.open('', '', 'scrollbars=1,resizable=1,width=1150,height=650,left=0,top=0'), doc = win.document.open(), dataSource = $("#grid").data("kendoGrid").dataSource; //get the filter values var filterHtml = "", operator = "", fieldName = "", localCounter = 0;; var fieldArray = new Array("Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", "Field12", "Field13", "Field14", "Field15"); var nameArray = new Array("Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15"); //Logic for getting the filters and displaying them on the print page var currentFilter = dataSource.filter(); if (currentFilter) { currentFilter.filters.forEach(function (filter, index) { localCounter = localCounter + 1; if (filter.operator == "neq") operator = "not equals to"; if (filter.operator == "eq") operator = "equals to"; if (filter.operator == "startswith") operator = "starting with"; for (var iCounter = 0; iCounter < 15; iCounter++) { if (filter.field == fieldArray[iCounter]) { fieldName = nameArray[iCounter]; break; } } if (localCounter > 1) filterHtml += " " + fieldName + " " + operator + " " + "'" + filter.value + "'" + " "; else filterHtml += fieldName + " " + operator + " " + "'" + filter.value + "'" + " "; }); } else filterHtml = "None"; var htmlStart = ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + 'Appl…
answers question: http://stackoverflow.com/q/28184127
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28179255
has body: I am following a javascript video tutorial on pluralsight.com &amp; they have a javascript function but I don't understand how they got this result: function factorial(n){ if (n === 0 || n === 1){ return 1; } return n * factorial(n-1); } console.log( factorial(5) ); // result is 120 Can anyone please explain me why this function is returning 120? I would expect it to return 5 * 4 = 20? >> JS Fiddle Link
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28179308
downvote count: 2
has comment: http://stackoverflow.com/comment/44727687
type: Question
has comment: http://stackoverflow.com/comment/44727664
score: -2
tagged with: javascript
has title: javascript function output math calculation
upvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/124383284
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28211384
has text: Incredible! Lost hours with bad MDN example... Thanks for the question and asnswer!

webkit-animation
tags question: http://stackoverflow.com/q/28242013
tags question: http://stackoverflow.com/q/28167989
type: Tag
tag name: webkit-animation

http://stackoverflow.com/comment/44890532
comment on: http://stackoverflow.com/a/28254893
type: Comment
has text: Thank you. It started working for me after I removed the 'return skatepark;' (I uncommented it out for testing purposes) from the MarkersFromDatabase JavaScript function. It doesn't work for the values that I get from my database but I'll try out formatting it differently. You have answered my question though, thank you very much!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44757933
comment on: http://stackoverflow.com/a/28195095
score: 0
type: Comment
has text: @Sukima because they standardized the API before A+ was a thing I believe.
type: AnswerComment

http://stackoverflow.com/q/28262636
tagged with: gwt
tagged with: gxt
has body: I am quite new to GWT and GXT and i tried makina a very simple application, but it doesn't seem to work. This is my onModuleLoad() method. Instead of getting a nice layout with collapsible elements, it seems like it all collapses into the left part. The elements exist because when i inspect them with the js-console on IE, they seems to be there, but the layout is off. Could you tell me what i did wrong? public void onModuleLoad() { Viewport viewport =new Viewport(); final BorderLayout borderLayout = new BorderLayout(); viewport.setLayout(borderLayout); BorderLayoutData northData = new BorderLayoutData(Style.LayoutRegion.NORTH); northData.setCollapsible(false); northData.setSplit(false); HTML headerHtml = new HTML(); headerHtml.setHTML(" RSS Reader "); viewport.add(headerHtml,northData); BorderLayoutData centerData = new BorderLayoutData(Style.LayoutRegion.CENTER); centerData.setCollapsible(false); BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST,200,150,300); westData.setCollapsible(true); westData.setSplit(true); ContentPanel mainPanel = new ContentPanel(); ContentPanel navPanel = new ContentPanel(); viewport.add(mainPanel,centerData); viewport.add(navPanel,westData); RootPanel.get().add(viewport); }
type: Question
tagged with: javascript
score: 0
answer count: 1
has title: GXT Not working
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28266654

http://stackoverflow.com/q/28179195
has comment: http://stackoverflow.com/comment/44727693
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44732074
tagged with: javascript
has body: I wrote a basic script that reads a JSON file and converts it to an HTML table using json2html. I then email this table using nodemailer. The code works to send the table in an email. However, I would like to add some styling to the table and am yet to find a good solution. Below is the code for my HTML Table creation: var jsonText = fs.readFileSync('file.json').toString(); var data = JSON.parse(jsonText); var tmpl = " ${firstName} ${lastName} ${email} ${skills} ${linkedin} ${github} " var transform = {'tag':'tr','html':tmpl}; data.forEach(function(item) { if (data.skills) { data.skills = data.skills.join(',' + ' '); } }) var resp = " " + json2html.transform(data,transform) + " "; Here is sendmail portion of my nodemailer code for reference: transporter.sendMail({ from: 'email@gmail.com', to: 'email@gmail.com', subject: 'TEST', html: resp });
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Adding styling: json2html node module
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: node.js
answer count: 0
score: 1

http://stackoverflow.com/q/28215674
linked to: http://stackoverflow.com/q/7792362
has answer: http://stackoverflow.com/a/28215837
accepted answer: http://stackoverflow.com/a/28215837
type: AnsweredQuestion
type: Question
score: 0
duplicate of: http://stackoverflow.com/q/7792362
has body: My HTML is: &lt;div class="Editable"&gt; &lt;input type="text" name="Editable" style="width:500px;"/&gt; &lt;/div&gt; I am not able to set value in input field using HTML Symbol code: $(document).ready(function(){ $(".Editable").click( function(e) { $('.Editable &gt; input').val("&amp;#x0204F; &amp;#x02588; Hello"); }); }); But setting value directly in the HTML works fine: &lt;div class="Editable"&gt; &lt;input type="text" name="Editable" value="&amp;#x0204F; &amp;#x02588; Hello" style="width:500px;"/&gt; &lt;/div&gt;
answer count: 1
tagged with: javascript
tagged with: jquery
has title: HTML Symbol code not working in input field properly
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44752213
type: AnswerComment
comment on: http://stackoverflow.com/a/28192579
score: 0
has text: video id="video1" width="640" height="360" controls="controls">
type: Comment

http://stackoverflow.com/comment/71018809
has text: i tried, this, but apparently, the emit function doesn't work; i'm getting this error: Uncaught TypeError: Cannot read property 'emit' of undefined(…), i'm using nwjs version 0.18
comment on: http://stackoverflow.com/a/33173054
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44696335
has text: choices are parse url, store cookie, store localStorage. Javascript doesn't maintain state on page change
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28162381

http://stackoverflow.com/q/28237229
tagged with: http://stackoverflow.com/tag/json
has title: Google Visualization Area Chart not Shaded
type: Question
tagged with: charts
tagged with: google-visualization
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28426236
score: 0
answer count: 1
has body: I'm using the Google Charts API and am trying to make a combo chart with four series. Two of them would be of type line and two of them area. The area chart doesn't seem to be shaded (although it has a mouseover vertical line like an area chart). I've tried assigning the series to be type steppedArea and nothing changes. The data is read from an external JSON file. This is the javascript that creates the graph: function wind_history_render(){var wind_history_data=google.visualization.arrayToDataTable(wind_history); var wind_history_options={ backgroundColor:'transparent', legend:{ position:'none' }, chartArea:{ top:"5%", height:"85%" }, axisTitlesPosition:'out', areaOpacity:0.0, isStacked: false, series:{ 0:{ targetAxisIndex:0, color:'red', type:"Area" }, 1:{ targetAxisIndex:0, color:'#a6cee3', type:"Area" }, 2:{ targetAxisIndex:0, color:'#1f78b4', type:"line", lineWidth:1 }, 3:{ targetAxisIndex:1, color:'#6a3d9a', type:"line", pointSize:1, lineWidth:0 } }, vAxes:{ 0:{ title:'Wind Speed/Gust (MPH)', titleTextStyle:{ color:'#1f78b4', italic:false, bold:true, }, axisTitlesPosition:'none', textStyle:{ bold:true }, viewWindow:{ min:0, max:history_max_speed }, gridlines:{ count:(history_max_speed)/10+1 } }, 1:{ title:'Cardinal Direction', titleTextStyle:{ color:'#6a3d9a', italic:false, bold:true }, textStyle:{ bold:true }, direction:-1, viewWindow:{ min:0, max:360 }, gridlines:{ color: 'transparent' }, ticks:[ {v:0,f:'N'}, {v:45,f:'NE'}, {v:90,f:'E'}, {v:135,f:'SE'}, {v:180,f:'S'}, {v:225,f:'SW'}, {v:270,f:'W'}, {v:315,f:'NW'}, {v:360,f:'N'} ] } }, hAxis:{ showTextEvery: 72, title:"Time (EST)", textStyle:{ bold:true } } }; var windHistoryChart=new google.visualization.ComboChart(document.getElementById('windspeed-and-direction')); windHistoryChart.draw(wind_history_data,wind_history_options); google.visualization.events.addListener(windHistoryChart,'select',selectHandler); } This is an excerpt from the JSON. The variable wind_history is set as the contents in the windHis…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28426236

http://stackoverflow.com/a/28291356
has comment: http://stackoverflow.com/comment/45790649
accepted answer of: http://stackoverflow.com/q/28263734
answers question: http://stackoverflow.com/q/28263734
type: AcceptedAnswer
downvote count: 0
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/59395553
has comment: http://stackoverflow.com/comment/44938005
score: 8
has body: Nested Observables Yes it is normal to have a map operation return an Observable. This gives you an observable stream of observable streams. There are Rx 3 operations to flatten that nested observable one level: mergeAll - subscribe to all of the inner streams as they arrive. You usually end up concurrently subscribed to multiple streams and usually your final stream will have results from the different inner streams intermingled. You can supply a maxConcurrent parameter to limit the number of concurrent inner subscriptions. When the limit is hit, new inner observables get queued and do not get subscribed until a previous inner observable completes. concatAll - subscribe to each inner observable stream one at a time, in order. Your resulting stream will produce items in a predictable order. Concat is just Merge with maxConcurrent set to 1. switch - subscribe to the first inner stream. Then, when a new stream arrives, "switch" to it. Basically unsubscribe from the previous inner stream and subscribe to the latest inner stream. Use switch when you only want to listen to the most recent inner stream. (In my code, I've also implemented a fourth flattening operator: concatLatest which is like concat, but when an inner stream completes, instead of jumping to the next stream in the queue, it jumps straight to the most recent sequence in the queue, throwing away any inner streams skipped. It is sort of in between concat and switch in behavior and I find it very useful for handling backpressure while still producing results). So, it is very common to have .map(...).mergeAll() or .map(...).concatAll() or .map(...).switch(). It is so common, that there are Rx methods for these 3 cases: source.flatMap(selector) is equivalent to source.map(selector).mergeAll() source.concatMap(selector) is equivalent to source.map(selector).concatAll() source.flatMapLatest(selector) is equivalent to source.map(selector).switch() Your Code With the above information, I'd suggest you use switch in…

http://stackoverflow.com/a/28185889
has comment: http://stackoverflow.com/comment/44740534
accepted answer of: http://stackoverflow.com/q/28185860
has comment: http://stackoverflow.com/comment/44753230
answers question: http://stackoverflow.com/q/28185860
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44741873
has body: Function declarations are faster in cases where there's a potential for the function expression to be evaluated multiple times. For example, in code that is called in a loop a hoisted function is only evaluated once, but an expression would be evaluated each time. Besides that, there's no meaningful difference. Whenever you have a question about a JavaScript performance issue, I recommend checking out JSPerf. Also, Google to see if someone already made one for your question:
has comment: http://stackoverflow.com/comment/44743691
upvote count: 2
type: Answer
downvote count: 1
score: 1

http://stackoverflow.com/q/28268995
score: 3
has title: Detect duplicate files for upload
tagged with: javascript
has body: I have an &lt;input type="file" multiple /&gt; and using the onchange event I maintain a list of files selected to be uploaded at a later stage. The workflow is like this: The user selects multiple files to upload I copy the selected File objects into an array of selected files Repeat steps 1&amp;2 until the user has finished selecting all of the files that they wish to upload. Upload all of the files in the selected array The problem is that they can potentially end up selecting the same file twice e.g. Select folder1\a.txt, click ok Select folder1\b.txt, click ok Select folder1\a.txt, click ok The File object doesn't give me the full path to the file and URL.createObjectURL doesn't return the same URL, so it seems like I can only try to guess that the same file has been selected by comparing the size, last modified time, mime type and file name. Is there a more accurate way detect if a user is trying to upload the same file multiple times?
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
upvote count: 3
type: Question

http://stackoverflow.com/comment/45005419
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28324193
has text: Please explain the life cycle with this use case: Login screen ASP.NET MVC, remaining interaction JavaScript. Are you suggesting to create the JavaScript dynamically server side whilst including the AuthID obtained during server side authentication?
type: AnswerComment

http://stackoverflow.com/a/28148291
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28148011
answers question: http://stackoverflow.com/q/28148011
type: Answer
has body: Yes, there is one! You could send an XMLHttpRequest to your Server. This is also possible to hook the form POST format for it. But notice, that this isn´t a standard JavaScript implementation. So you Need to implement also cross-browser Support. If you would like to use a finished solution, which already implented this, I would advise you to use jQuery. If you got this, you need now to place it somewhere inside you JS code. The best way for doing it, is to register an event after the ListBox is filled up.
upvote count: 1
has comment: http://stackoverflow.com/comment/44668333
has comment: http://stackoverflow.com/comment/44668081

http://stackoverflow.com/a/28251175
upvote count: 1
has comment: http://stackoverflow.com/comment/44861863
has body: For example: var titles=document.getElementsByClassName("title"); titles= "&lt;span&gt;" + titles; titles=titles.replace(":", ":&lt;/span"&gt;); document.getElementsByClassName("title").innerHtml = titles; I think this could work.
type: Answer
answers question: http://stackoverflow.com/q/28250984
has comment: http://stackoverflow.com/comment/44861752
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44861849

http://stackoverflow.com/comment/44906805
comment on: http://stackoverflow.com/a/28275861
has text: @MohanKumar that's strange I always use it. Check the plugin you are using.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44783530
score: 1
comment on: http://stackoverflow.com/q/28209435
type: Comment
type: QuestionComment
has text: [**`jQuery.toggleClass`**](http://api.jquery.com/toggleclass/)

http://stackoverflow.com/comment/44895012
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28269430
has text: @Bergi I thought that too but the command node colors.js > colors.html confuses me
score: 0

web-services
type: Tag
tags question: http://stackoverflow.com/q/28233899
tags question: http://stackoverflow.com/q/28159613
tags question: http://stackoverflow.com/q/28136465
tags question: http://stackoverflow.com/q/28145813
tag name: web-services
tags question: http://stackoverflow.com/q/28201751
tags question: http://stackoverflow.com/q/28256164

windows-8.1
tags question: http://stackoverflow.com/q/28267393
type: Tag
tag name: windows-8.1

http://stackoverflow.com/q/28127403
has comment: http://stackoverflow.com/comment/44630237
type: Question
has answer: http://stackoverflow.com/a/49832858
answer count: 1
has comment: http://stackoverflow.com/comment/44630703
has comment: http://stackoverflow.com/comment/44630186
score: 0
has title: Jquery event not being fired with IE8
tagged with: internet-explorer
tagged with: internet-explorer-8
accepted answer: http://stackoverflow.com/a/49832858
has comment: http://stackoverflow.com/comment/44630152
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44631134
tagged with: blueimp
type: AnsweredQuestion
has body: I'm using blueimp's fileupload javascript widget and jQuery 1.9.0 for uploading files to a server and I have an event not being triggered in IE8, which is one of the required browsers for my project. So because of this I can never open the window for browsing for the files. If I do a $('#fileupload').click() from the IE8 console, it works, but I didn't success in the code. I think this is happening because of the bubbling of the event, but I'm showing you the code for deciding for yourselves. I think also that styles are importante to this issue because maybe the styled button I'm using over the real fileupload widget must be overlapping it. Maybe css styles like opacity and position matter. Html: User: Phone: Attached files: Browse Send Clean Javascript: $(document).ready(function() { upload_comp = $('#fileupload') .fileupload({ // Widget options singleFileUploads : false, autoUpload : false, dataType : 'json' }) .on("fileuploadadd", function(e, data) { // Function for adding files after opening the browse window if (data.files.length > 0) { $('input[type=file]').css('color', 'transparent'); } // Creating divs for the selected files in the previous browse window for ( var i = 0; i < data.files.length; i++) { var name = $(' ').text(data.files[i].name); var icon = $(''); icon.click(function() { // This handler creates a button for removing the actual file for ( var k = 0; k < fileList.length; k++) { if (fileList[k].name == $(this).parent().text()) { fileList.splice(k, 1); break; } } $(this).parent().remove(); }); fileDiv = $(' ').wrapInner(name).append(icon); fileDiv.appendTo($('#additional')); fileList.push(data.files[i]); } //createTooltip($('.fa-trash')); }); if (isNavigator(CONSTANTS.BROWSER.IE8)) { // Maybe could use something here and force the click() // But my current solution creates an infinite loop } }); Css: /* These are specifically for IE8 and are located in ie8.css */ DIV.formRow > * { width: auto; } INPUT[type=file] { display : none; } /* These are fo…

http://stackoverflow.com/q/28219697
downvote count: 3
has answer: http://stackoverflow.com/a/28220589
upvote count: 1
type: Question
has title: How do I add this option to this image-picker project?
score: -2
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/44804639
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44803620
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44802989
has body: I have a problem. The concept is that I have 4 clickable image created by this http://rvera.github.io/image-picker/ and I want to create option that will forward somebody to appropriate href link after clicking button and choosing appropiate image. For instance if I would click image with cat and then button, it will forward me to page about cats. If I would click image with dog and button, it will forward me to page about dogs, if I would click images with dog and cat and button, it will forward me to page about dogs and cats. Cute Kitten 1 Cute Kitten 2 Cute Kitten 3 Forward How do I do this? I completely don't have any idea :/.

http://stackoverflow.com/q/28263404
favorite count: 0
has answer: http://stackoverflow.com/a/28276654
has answer: http://stackoverflow.com/a/28273552
score: 2
type: AnsweredQuestion
tagged with: ace-editor
upvote count: 2
possible better answer: http://stackoverflow.com/a/28276654
type: Question
has title: How to change the content inside an ace editor when I clicked on another file?
accepted answer: http://stackoverflow.com/a/28273552
tagged with: javascript
tagged with: reactjs
answer count: 2
has body: I'm learning Reactjs and want to write a web editor. There will be a file list on the left, and an editor in the middle. When I click on a file, the content of the editor will be changed. We are using brace which is a commonjs-compatible version of ACE editor. We use such code to turn a normal dir to an editor: https://github.com/dujuanxian/webpanda/blob/ace/app/scripts/ui/Editor.js#L46 componentDidMount: function() { var editor = ace.edit(this.props.name); editor.getSession().setMode('ace/mode/'+this.props.mode); editor.setTheme('ace/theme/'+this.props.theme); }, The editor will be shown correctly when I open the home page which show the first file by default, but if I click on another file, the editor will be disappeared, and only left a normal div with the content. You can clone the repo: https://github.com/dujuanxian/webpanda, and run: $ git checkout ace $ npm install $ bower install $ gulp watch to start the server and open the home page automatically. I have two options which can fix it but I don't know how to do it: When I click on another file, recreate the ACE editor again (which is slow so not preferred) Reuse the rendered ACE editor, just change the content (I'm not sure if that's possible) How to fix it?
downvote count: 0

http://stackoverflow.com/q/28240772
tagged with: javascript
has title: Php-Json parse with in JavaScript
has comment: http://stackoverflow.com/comment/44849373
tagged with: php
has comment: http://stackoverflow.com/comment/44852254
answer count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0
has body: I use laravel Json_Encode. I want parse PHP Json in Java Script. I use this code on PHP public function searchAutoCompleteAjax(){ $keyword = Input::get('keyword'); $result = array(); if(!empty(trim($keyword))){ $mongoResult = MongoDB::instance(true)-&gt;collection("items")-&gt;like('name',$keyword)-&gt;limit(0,5)-&gt;fetch(); if($mongoResult){ foreach ($mongoResult as $key =&gt; $item) { $result[] = $item['name']; } } } echo json_encode(array("error"=&gt;0,"message"=&gt;"Success","result"=&gt;$result)); } And this is my JavaScript code $(function(){ var currencies = [ { value: 'I want Parse Value - 1' }, { value: 'I want Parse Value - 2' }, { value: 'I want Parse Value - 3' }, { value: 'I want Parse Value - 4' }, { value: 'I want Parse Value - 5' }, ]; // setup autocomplete function pulling from currencies[] array $('#search-box').autocomplete({ lookup: currencies, }); }); You have any solutions? Thank you

http://stackoverflow.com/comment/130275509
score: 0
type: AnswerComment
type: Comment
has text: @tnishada I'm not sure why you accepted this answer as it does not AT ALL answer your question: "How can I change the execution order of these test files?". Either of the higher scoring answers do that. You should change the accepted answer.
comment on: http://stackoverflow.com/a/28235391

http://stackoverflow.com/comment/44869977
has text: So, you simply threw some PHP inside the file? No, that won't work! You have to rename it to `.js.php`, Then you put the following on the first line:`header('Content-type: application/javascript');`, enclosed between php tags. That **must** be the first line and *there can be nothing being `echo`ed to the browser*. If your file is in `UTF-8`, encode it in `UTF-8 without BOM`.
comment on: http://stackoverflow.com/q/28255571
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44803005
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28219691
has text: and once all of that is fixed, the browser console is your friend.
score: 0

http://stackoverflow.com/a/28210292
answers question: http://stackoverflow.com/q/28208146
has body: You can filter links with jQuery's .filter() method. Just customize the regular expression to fit your actual needs jQuery(document).ready(function() { jQuery("a") .filter(function() { var href = jQuery(this).attr('href'); // return true if href exists and matches the regular expression return href &amp;&amp; href.match(/mywebsite\.com\/[\w-]+/); }) .click(function(){ jQuery("a").attr("target","_blank"); url = jQuery(this).attr('href'); jQuery(this).attr('href','/te3/out.php?l=click&amp;u=' + escape(url)); }); }); Update If you want the opposite behavior, you can use .not() jQuery(document).ready(function() { jQuery("a") .not(function() { var href = jQuery(this).attr('href') || ''; // return true if href exists and matches the regular expression return href.match(/mywebsite\.com\/[\w-]+/); }) .click(function(){ jQuery("a").attr("target","_blank"); url = jQuery(this).attr('href'); jQuery(this).attr('href','/te3/out.php?l=click&amp;u=' + escape(url)); }); });
has comment: http://stackoverflow.com/comment/44852748
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44827229
has comment: http://stackoverflow.com/comment/44850631
type: Answer
has comment: http://stackoverflow.com/comment/44813645
accepted answer of: http://stackoverflow.com/q/28208146

http://stackoverflow.com/q/28123438
has title: Year of date validation is failing
upvote count: 2
has answer: http://stackoverflow.com/a/28123947
has body: I need to do a date validation to accept it in dd/mm/yyyy format. However all conditions are working fine except that if I enter year of 6 digits it is also accepting it, like - 12/12/200000 as per my code is valid. Below is my code: function validate(value) { if(!value.match(/\d\d\/\d\d\/\d\d\d\d/)) return false; return checkdate(value); } function checkdate(val) { var dates = val.split(/\D/); if(dates[0] &lt;= 0 || dates[0] &gt; 31) return false; if(dates[1] &lt;= 0 || dates[1] &gt; 12) return false; var now = new Date(dates[2],dates[1]-1,dates[0]); if (isNaN(now)) return false; now.setHours(0,0,0,0); if (now.getFullYear() == dates[2] &amp;&amp; now.getMonth() + 1 == dates[1] &amp;&amp; now.getDate() == dates[0]) return true; return false; } I am not sure why it allowing year as 6 digits valid input?
has answer: http://stackoverflow.com/a/28123510
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28123527
type: Question
has comment: http://stackoverflow.com/comment/44620570
possible better answer: http://stackoverflow.com/a/28123527
score: 2
tagged with: validation
has comment: http://stackoverflow.com/comment/44620611
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28123510
answer count: 3
has comment: http://stackoverflow.com/comment/44620651
tagged with: regex
favorite count: 0

http://stackoverflow.com/comment/44903816
type: Comment
comment on: http://stackoverflow.com/q/28273606
score: 0
type: QuestionComment
has text: yep, thats all you'd need

http://stackoverflow.com/q/28194205
has comment: http://stackoverflow.com/comment/44756662
upvote count: 1
has comment: http://stackoverflow.com/comment/44755522
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44756711
answer count: 1
downvote count: 0
tagged with: javascript
has title: can't access property on parent scope, however I can see through that chain of properties
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28194281
has comment: http://stackoverflow.com/comment/44755344
has body: I have a property called itemClickHandler on an isolate scope. Then I have few other scopes that inherit from it including scopes created by ng-repeat directive. Neither of the child scopes create isolate scope so I should be able to access this property on child scope, but for some reason I can't. Why? This works: scope.$parent.$parent.$parent.itemClickHandler //returns value This doesn't work: scope.itemClickHandler //returns undefined
type: UnansweredQuestion

http://stackoverflow.com/comment/45034073
type: AnswerComment
type: Comment
has text: thanks for your help, I was using watchify though in my example, are your builds taking around 2 - 3 seconds too?
score: 0
comment on: http://stackoverflow.com/a/28246117

http://stackoverflow.com/a/28200606
has comment: http://stackoverflow.com/comment/44767981
has comment: http://stackoverflow.com/comment/44768097
has comment: http://stackoverflow.com/comment/44767723
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44768160
type: Answer
accepted answer of: http://stackoverflow.com/q/28183393
answers question: http://stackoverflow.com/q/28183393
has body: The files from your remote server might not be synchronized with the files on your computer. Check your Synchronization options to ensure you tell Aptana to 'sync from your remote site to your machine' - if you do not have all the files from the server on your computer, you need to do this at least once before you start working on your changes. After this, you will want to decide how to keep the changes made on your computer in sync with the server (either manually upload them yourself, or tell Aptana to automatically synchronize them) Check this page for a brief tutorial on how to set up the sync options (step 7): http://www.danielrosca.ro/blog/en/aptana-studio-and-ftp-server/

http://stackoverflow.com/a/28236295
has body: Create a fie in your app/Vendor/newconfigfile.php then paste this line define("DATETIME_FORMAT", "MM/dd/yy HH:mm"); Now go to in your app/Config/bootstrap.php Add the following line App::import('Vendor', 'newconfigfile'); Now you can call DATETIME_FORMAT as a global variable.
score: 0
answers question: http://stackoverflow.com/q/28188938
type: Answer

http://stackoverflow.com/q/28157652
upvote count: 1
tagged with: embed
type: Question
tagged with: javascript
tagged with: http://stackoverflow.com/tag/pdf
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/64715713
has title: Embed pdf to have width dynamically fill col-sm-6
has body: I know there are a LOT of questions about embedding pdfs, and this one is different as I am focusing specifically on getting the width of my pdf to dynamically scale to the width of the bootstrap "col-sm-6" that I want the pdf inside. I have played with embed, pdf.js, readstep2.html, and google pdf viewer. But, all of them seem to require some sort of "width and height" setting. In a perfect world, I'd like to have a single pdf window with some page left/right buttons at the bottom that shows the full pdf height, and dynamically grows and shrinks so that the width always fills the "col-sm-6" element it's inside of. Here's my current code: Filler text here Your browser does not support the audio element. Thanks for any help you can offer!
answer count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/44768655
has text: What happens if you replace `bind(` with `on(` ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28201226

http://stackoverflow.com/a/28166042
upvote count: 1
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44702441
has body: You can select both the elements using multiple selector then $(".form-group").find('input, span').wrapAll(' '); //class selector is used for `form-group` $(".form-group").find('input, span').wrapAll(' '); Password help text
answers question: http://stackoverflow.com/q/28166025

http://stackoverflow.com/q/28263368
has comment: http://stackoverflow.com/comment/44883833
tagged with: javascript
linked to: http://stackoverflow.com/q/19780725
has comment: http://stackoverflow.com/comment/44883664
has comment: http://stackoverflow.com/comment/44883623
has comment: http://stackoverflow.com/comment/44883570
duplicate of: http://stackoverflow.com/q/19780725
downvote count: 0
has comment: http://stackoverflow.com/comment/44883698
favorite count: 0
type: UnansweredQuestion
has title: Best way to resolve exported class instances
tagged with: node.js
answer count: 0
score: 1
linked to: http://stackoverflow.com/q/20787074
has body: I created a module like this: module.exports = function foo(){ this.run = function () { console.log("run"); } } now i want to require the module in an node.js application and immediatly get an instance. I tried to get it in a simple line, but it doesn't work. The code looks like this: var foo = new require('./foo.js')(); foo.run(); foo will be undefined and therefore run cannot be raised. First working Solution: var foo = require('./foo.js'); var instance = new foo(); instance.run(); console.log('Hello world'); Second working Solution (as i understand adeneo) function foo() { this.run = function () { console.log("run"); } } module.exports = new foo(); Which solution is more common ? are there more?
has comment: http://stackoverflow.com/comment/44883790
upvote count: 1
type: Question
tagged with: commonjs

http://stackoverflow.com/comment/44896793
comment on: http://stackoverflow.com/a/28270576
score: 0
type: AnswerComment
type: Comment
has text: Although I agree with @maremp showing a captcha makes horrible UX, let alone stoping the video at 30s...

http://stackoverflow.com/a/28192922
answers question: http://stackoverflow.com/q/28192721
has body: First, remove the body onLoad. Second, this should be your html script: and this should be your javascript: function changeImg(){ var img1 = document.getElementById("wows1_0"); img1.src = "WOWSlider/data1/images/ContactSupport.jpg"; }
score: 0
type: Answer

http://stackoverflow.com/q/28275222
tagged with: html-encode
has comment: http://stackoverflow.com/comment/44905757
has comment: http://stackoverflow.com/comment/44906430
has title: ENT_QUOTES in a JS string
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44905395
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44905543
has comment: http://stackoverflow.com/comment/44905436
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28275277
has body: I have this function : function change_this(my_str) { $('#myDiv').html('&lt;input value=\''+my_str+'\'&gt;'); } When I call this function with this : onclick=change_this('Test &amp;#039;'); I see in the debugger that &amp;#039; has been turned to a quote, and therefore the script does not work. So my question is: how can I send a quote inside a string to a JS function? I'm sure I'm not the first person to face this issue, I googled but did not find any simple explanations / answers.
has comment: http://stackoverflow.com/comment/44905532

http://stackoverflow.com/comment/44686723
type: Comment
comment on: http://stackoverflow.com/a/28157735
has text: Thanks I was changing the divs that are displaying and hiding and not the tabs that fixed the problem Thanks
type: AnswerComment
score: 0

http://stackoverflow.com/q/28273617
possible better answer: http://stackoverflow.com/a/28274305
has body: I am currently using an event attached to $(document) I tried changing it to different elements on the page, but nothing happens. This is my starting code for a basic context menu $(document).bind("contextmenu", function (event) { event.preventDefault(); if ($(".context-menu") != null) { $(".context-menu").remove(); } $(" " + " " + " Do Something " + " "+ " ") .appendTo("body") .css({ top: event.pageY + "px", left: event.pageX + "px" }); }); $(document).bind("click", function (event) { $(".context-menu").remove(); }); Clarification I am not trying to create a context menu. I am trying to create multiple ones, each one is triggered by right clicking a different element. For instance, if you right-click a div, you get a context menu with the ability to change the div's color, if you right-click on the document you get a different context menu, and if you right-click on the header, yet a different context menu. Can this be done? This is my attempt that doesn't work $(document).bind("contextmenu", function (event) { event.preventDefault(); }); $(document).bind("click", function (event) { $(".context-menu").remove(); }); $("#divID").mousedown(function (e) { if (e.button == 2) { if ($(".context-menu") != null) { $(".context-menu").remove(); } $(" " + " " + " Do Somthing " + " " + " ") .appendTo("divID") .css({ top: event.pageY + "px", left: event.pageX + "px" }); return false; } return true; });
has answer: http://stackoverflow.com/a/28274017
accepted answer: http://stackoverflow.com/a/28274017
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44902403
has answer: http://stackoverflow.com/a/28274305
has comment: http://stackoverflow.com/comment/44902429
type: Question
has comment: http://stackoverflow.com/comment/44902314
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: How to create multiple context menus on right click depending on which object was clicked?
has comment: http://stackoverflow.com/comment/44902256

http://stackoverflow.com/q/28144668
answer count: 4
has comment: http://stackoverflow.com/comment/44661544
has title: HTML5 textTrack.kind=subtitles cueChange event not working in FireFox
has comment: http://stackoverflow.com/comment/44661493
has answer: http://stackoverflow.com/a/30472657
type: UnansweredQuestion
score: 11
has answer: http://stackoverflow.com/a/37304987
has comment: http://stackoverflow.com/comment/44661558
type: Question
tagged with: audio
has body: UPDATE: This issue no longer existing FireFox, cuechange now works. Embedded base64 images also render. The original code is a simple implementation of am MP3 player with captioning using HTML5 and a few lines of JavaScript. The example Audio Player HTML has a .VTT subtitle file with embedded images using Base64. ORIGINAL POST BEGINS HERE I am using the HTML5 Player with a VTT subtitle The Player and lyrics VTT subtitles (with images) work fine with Google Chrome Version 35. Click Here for: Link to the html page that works in Google Chrome but not FireFox Now the above link works in Firefox with workaround below. FireFox Version 35 can play the mp3, but the VTT subtitles do not work properly. The onCueChange and cueChange events both work in Chrome Neither onCueChange nor cueChange events work in FireFox New Update Added Below With Simple Workaround (1/26/16) OnCueChange embedded in HTML cueChange Event Listener track.addEventListener("cuechange", cueChange, false); How it works When the VTT time changes the audio.track generates a cueChange Event. In the below VTT cues (2 of 25) the cueChange Event should fire at 00:00:00.001 and 00:00:04.200 When the event fires, the script then reads the activeCues[0].text The activeCues.text is displayed in the innerHTML WEBVTT 00:00:00.001 --> 00:00:04.000 Seasons in the Sun Terry Jacks 00:00:04.200 --> 00:00:20.000 Goodbye to you, my trusted friend We've known each other since we were nine or ten Together we climbed hills and trees Click Here for Link to full .vtt This .vtt in addition to the lyrics has embedded base64 images NOTE: VTT must be served with an HTTP header MIME Type of Content-Type:text/vtt I have confirmed via Firebug the Following: The VTT file loads with out Error. The acvtiveCues has correct length and text. The 25 cues from the VTT file are loaded and correct The textTrack mode is "showing" Full HTML with JavaScript Seasons in the Sun Update Work Around Works in FireFox and Chrome Still not working in FireFo…
has comment: http://stackoverflow.com/comment/52358554
has comment: http://stackoverflow.com/comment/44661308
has answer: http://stackoverflow.com/a/35762573
upvote count: 15
downvote count: 4
tagged with: firefox
has answer: http://stackoverflow.com/a/31841764
has comment: http://stackoverflow.com/comment/57771598
has comment: http://stackoverflow.com/comment/44661457
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28130730
type: Answer
answers question: http://stackoverflow.com/q/28125080
has body: You must be missing the img element with id myImage which has width and height set to some value so that it is visible, and is given display: block. Your code follows strictly the code from the examples of the Camera plugin usage and since it goes correctly to the server you should have all the plugins &amp; permissions needed.
has comment: http://stackoverflow.com/comment/44640077
score: 0
has comment: http://stackoverflow.com/comment/44641540
has comment: http://stackoverflow.com/comment/44641526

http://stackoverflow.com/a/28805290
type: AcceptedAnswer
has body: Thanks all . problem solved that is jquery confiscation
type: Answer
answers question: http://stackoverflow.com/q/28272560
accepted answer of: http://stackoverflow.com/q/28272560
score: 0

http://stackoverflow.com/a/28176251
has body: I don't understand why you want to force the Pdf to be opened in the browser window ? Why you don't force the download or provide a link to download it once it has been created ?
answers question: http://stackoverflow.com/q/28175982
has comment: http://stackoverflow.com/comment/44721983
score: 0
has comment: http://stackoverflow.com/comment/44757957
type: Answer
has comment: http://stackoverflow.com/comment/44753589

http://stackoverflow.com/comment/44642491
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28135212
has text: @u_mulder which is the best way to go about it?
score: 0

http://stackoverflow.com/comment/44766716
has text: I would recommend tweaking your code so that instead of adding the same text into each div, just add a substring from that particular point in the text. Your current method is not very efficient and you don't have a lot of control over it.
comment on: http://stackoverflow.com/q/28199712
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/105940205
has text: Can someone TL;DR for me which which of the solutions given in all the answers preserve the OO type of the clone, i.e. `cloned instanceof MyClass === true`?
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28152032

http://stackoverflow.com/comment/44856598
comment on: http://stackoverflow.com/q/28159178
type: QuestionComment
type: Comment
has text: That's exactly part of it. Made some adjustments in my posted answer as well.
score: 0

http://stackoverflow.com/a/28197251
answers question: http://stackoverflow.com/q/28197170
score: 1
upvote count: 1
downvote count: 0
has body: You can use exec() to get the matches to your Regex: var thisId = 'id[33]'; var matches = /\[(.*?)\]/g.exec(thisId); alert(matches[1]); // you want the first group captured Example fiddle
type: Answer

http://stackoverflow.com/a/28181967
has comment: http://stackoverflow.com/comment/44733258
upvote count: 5
answers question: http://stackoverflow.com/q/28181880
type: Answer
downvote count: 0
has body: It should be getElementById not getElementByID. See below: function getInput() { var userInput= document.getElementById("Variables").value; var answer = 100 * parseFloat(userInput); console.log(answer); alert(answer); } &lt;input id="Variables" value="10"/&gt; &lt;input type="button" value="Multiply" onclick="getInput()"/&gt;
score: 5

youtube-api
tags question: http://stackoverflow.com/q/28180672
tags question: http://stackoverflow.com/q/28149815
type: Tag
tags question: http://stackoverflow.com/q/28267701
tag name: youtube-api
tags question: http://stackoverflow.com/q/28268733
tags question: http://stackoverflow.com/q/28243439

http://stackoverflow.com/q/28138386
has title: How to convert bitrate of audio files in javascript?
has answer: http://stackoverflow.com/a/28139169
tagged with: javascript
score: 0
has body: firstly, I have to say sorry for my bad English :) Anyway, I'm going to develop a simple website that users can upload their audio files and play others' files. I planed to use Node.js, and HTML5 built-in audio tag to play the files. I have never used the audio tag, so I wondered if the tag really works fine, so today I lightly wrote a simple code and played a mp3 file and I got a problem, which is that the mp3 file wasn't be played using the tag. I realized the audio tag cannot play audio files above bitrate 128kbps. so now, I need a way of auto-converting from more than 128kbps to 128kbps, in javascript(using Node.js). I've never used Node.js, so I never know how to do this. The things I want to know are that it is possible and it is easy. Anyone give me how or where to find the solution please. Thanks to read my bad-English question anyway. Good luck :)
answer count: 1
accepted answer: http://stackoverflow.com/a/28139169
tagged with: node.js
type: AnsweredQuestion
tagged with: audio
type: Question

http://stackoverflow.com/q/28133388
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44639357
has comment: http://stackoverflow.com/comment/44639308
upvote count: 0
has comment: http://stackoverflow.com/comment/44639291
tagged with: javascript
has answer: http://stackoverflow.com/a/28133412
has body: I have variable newValue and javascript object var newValue = value3; var myJson = { key1 : value3 key2 : [ value1,value2] } I want to add the variable newValue( value3) to key2 in the myjson meaning to the array. key2 : [value1,value2,value3] also it is possible that the key2 will be empty and then i need to add array with the newvalue meaning keys : [ value3] I did it with string logic but I want to di it with regular expression is it possible with regular expression?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28133412
has comment: http://stackoverflow.com/comment/44639350
tagged with: regex
has title: is it possible to add new string to existing string in regular expression
favorite count: 0
score: -1
type: Question

http://stackoverflow.com/a/28266668
type: AcceptedAnswer
has body: Make use of document ready block. $(document).ready(function() { // Try your code here and it should work like a charm. })
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28266610
answers question: http://stackoverflow.com/q/28266610
score: 1
upvote count: 1

http://stackoverflow.com/comment/44829349
type: QuestionComment
has text: Are you already using a library? Where did you get `Date.today(` from?
score: 1
comment on: http://stackoverflow.com/q/28233532
type: Comment

http://stackoverflow.com/comment/44763563
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28198604
has text: you could use a directive with an isolated scope
score: 0

http://stackoverflow.com/comment/44672995
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28150786
has text: this code won't work. `i` will be bound to the wrong value when the click handler is invoked.

http://stackoverflow.com/q/28202620
has comment: http://stackoverflow.com/comment/44771831
tagged with: javascript
has body: I'm using route and ngView to load dynamic content, and I got warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. The warning is from jQuery 2.1.3 If I try to load a static html file it works fine without any warning, is there anyway I can make routing asyc? app.config(function($routeProvider){ $routeProvider.when("/test", { templateUrl: "/getStuff", resolve:{ } }) $routeProvider.otherwise({ templateUrl: "/test.html", resolve:{ } }); }); If I try to load a static html file, it works without warning, if the templateUrl is not a static html file, there will be a warning
tagged with: jquery
has answer: http://stackoverflow.com/a/28219050
has comment: http://stackoverflow.com/comment/44774168
has comment: http://stackoverflow.com/comment/44771396
has comment: http://stackoverflow.com/comment/56976504
answer count: 1
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44773662
has title: Angularjs How to make route async?
has comment: http://stackoverflow.com/comment/44773806
score: 1
has comment: http://stackoverflow.com/comment/44773644
downvote count: 1
type: Question

http://stackoverflow.com/comment/44846363
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28242013
score: 0
has text: That appears to be the same fiddle - do you mean replacing "-webkit-animation-duration" with just "-webkit-animation" in the event handler?

http://stackoverflow.com/comment/45152362
comment on: http://stackoverflow.com/q/28276226
type: QuestionComment
has text: I just edited and I added the full code to the question, thanks in advance.
score: 0
type: Comment

http://stackoverflow.com/comment/44765253
comment on: http://stackoverflow.com/q/28197581
score: 0
type: Comment
type: QuestionComment
has text: My biggest issue that was identified below was that I wasn't using the global modifier. I feel pretty stupid about that mistake. Doh!

http://stackoverflow.com/comment/44622661
has text: It was indeed the case: I found two controllers. Must have been a relict from some earlier development. Still I learned more about what is important around rootScope events. Thanks
score: 0
comment on: http://stackoverflow.com/q/28124442
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28148174
type: Answer
answers question: http://stackoverflow.com/q/28147983
has body: Bootstrap is mobile-first, so the smaller column sizes are used if a bigger variant is not found. To have it behave the same for all screen sizes, just define the smallest. If you set it up to show as three columns in the smallest size, it should do the trick eg. Here is a revised fiddle which I think is what you're aiming for.
score: 0
has comment: http://stackoverflow.com/comment/44668260

http://stackoverflow.com/comment/44721340
type: Comment
has text: What does your basic HTML look like?
type: QuestionComment
comment on: http://stackoverflow.com/q/28176061
score: 0

http://stackoverflow.com/q/28213365
tagged with: javascript
has comment: http://stackoverflow.com/comment/44790569
has comment: http://stackoverflow.com/comment/44790401
has comment: http://stackoverflow.com/comment/44790566
score: 0
type: UnansweredQuestion
has title: using the loop index value in JS
linked to: http://stackoverflow.com/q/750486
type: Question
has answer: http://stackoverflow.com/a/28213539
duplicate of: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/28213533
has body: I have the javascript function in my jsp page as &lt;script type="text/javascript"&gt; $(document).ready(function(){ for(i=0; i&lt;20; i++ ) { $(".plus"+i).click(function(){ $(".details"+i).slideToggle(500) }); } }); for each iteration i want the output like this: .plus0 .details0 Next iteration : .plus1 .details1 and so on. But this is not working. Please help.
answer count: 2
has comment: http://stackoverflow.com/comment/44790493
has comment: http://stackoverflow.com/comment/44790851

http://stackoverflow.com/comment/44779869
score: 0
type: AnswerComment
type: Comment
has text: probably there js syntax error after event fired so second time stop working, if you can create js fiddle that would be useful to trace exact issue
comment on: http://stackoverflow.com/a/28207357

http://stackoverflow.com/comment/44831063
has text: Either solution will remove the current tooltip behaviour, you can manually invoke the dimple tooltip: bars.shapes.on("mouseover", function (e) { dimple._showBarTooltip(e, this, chart, bars); });
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28233442

json-web-token
type: Tag
tags question: http://stackoverflow.com/q/28262345
tag name: json-web-token

http://stackoverflow.com/q/28161374
has answer: http://stackoverflow.com/a/28161971
tagged with: divider
possible better answer: http://stackoverflow.com/a/28161456
type: AnsweredQuestion
tagged with: javascript
score: 1
favorite count: 0
has body: In place of something like a horizontal rule or div border, I'd like to do something like this: My Title /*----------------------*/ My content Notice how the divider between the Title and content is literally a slash, asterix, dashes, and then an asterix and slash to end (it's supposed to look like code). I'm curious how I could achieve this effect on a fluid layout, with the divider stretching to fill the whole width of the div. Also, I'd like to not use any art for this. Just using ascii would be perfect. Summary: How can I create a dynamically resizing custom ascii divider? I'm pressuming this will probably have to be done mostly in Javascript and then polling the width of the div everytime the window is resized, and then calculating the length of characters (it's a monospace font) required to fill that space. Is this on the right track?
type: Question
has title: How to make a dynamic ascii horizontal divider?
accepted answer: http://stackoverflow.com/a/28161971
tagged with: css
upvote count: 2
answer count: 2
downvote count: 1
has answer: http://stackoverflow.com/a/28161456

http://stackoverflow.com/comment/44745280
has text: Yes, you are right. Maybe my first question is foolish~ Hope someone can help me about the second question. Max, thanks a lot !
comment on: http://stackoverflow.com/q/28135404
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44691342
type: Comment
has text: @FelixKling thanks, great answer, very thorough. Still, it doesn't seem to address why one needs `B.prototype.constructor = B` here, does one? There is always also the actual constructor on B which was implicitly created by defining B in the first place, right? So the B.prototype.constructor should never be used anyway, or am I missing something?
comment on: http://stackoverflow.com/q/28159784
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44834549
type: Comment
comment on: http://stackoverflow.com/a/28227200
score: 0
type: AnswerComment
has text: but I really suggest you to look at the other answer I linked you as it is much more complete, read it all and check the layoutMode I use there as i believe you will need that for your case

http://stackoverflow.com/q/28214209
type: Question
tagged with: angular-strap
tagged with: javascript
tagged with: dom-events
has answer: http://stackoverflow.com/a/28214573
score: 0
has body: I use angular-strap library to add datepicker element. The input element is in a row, and when I click row, I change it's color. Now when I click on div with class datepicker, or other child table row the event is trigger. I need to prevent it. How can I do? Data $scope.select = function(home){ if(home.isSelected == undefined){ home.isSelected = true; }else{ home.isSelected = !home.isSelected; } }
has title: Angular-strap how to prevent click event propagation to datepicker element
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28214573
type: AnsweredQuestion

http://stackoverflow.com/q/28161278
has comment: http://stackoverflow.com/comment/44694361
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44694578
has comment: http://stackoverflow.com/comment/44725218
has comment: http://stackoverflow.com/comment/44694098
answer count: 0
has title: jquery wordpress undesired behaviour
has comment: http://stackoverflow.com/comment/44718724
tagged with: wordpress
type: Question
has body: I don't how to solve the next problem: When page loads, I am using jquery to search for a class and then to automatically put that "link" to the desired website, but I am missing something... Because when a user choose first image from the portfolio (art gallery) all other images in there have that link. Here is the actual code: jQuery(document).ready(function($){ jQuery(".row a, .grid-image").click(function( event ) { window.setTimeout(function(){ jQuery(".preview").each(function(){ var a = jQuery(jQuery(this).children("a")[0]); var galleryLink = false; if(jQuery(this).parent().parent().find('.gallery-link')[0]){ galleryLink = jQuery(jQuery(this).parent().parent().find('.gallery-link')[0]); } if(!galleryLink){ a.click(function( event ) { event.preventDefault(); }); }else{ a.attr("href", jQuery('.gallery-link').attr("href")); a.attr("target", "_blank"); } }); }, 100); }); }); Just to recap: User loads the gallery and clicks on any image there That image is zoomed in and has some text on the left side example: title: image title 1 description: some text here link: link to the author (which has .gallery-link class ) if there is a link to the author's work then that link is added to title of the image (in this case "image title 1") above description text and that title automatically becomes clickable Problem: When page is loaded and user choose one image from gallery, that image is zoomed and "image title 1" links to "link to author 1", but when user close that zoomed image and choose "image title 2" links to "link to the author 1" (which is wrong) and from that point on, it doesn't work as I want, for any "image title" links to "link to the author 1"... Any ideas? Thank you very much.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44694601
has comment: http://stackoverflow.com/comment/44694807
score: 0
has comment: http://stackoverflow.com/comment/44720897
has comment: http://stackoverflow.com/comment/44733804

http://stackoverflow.com/q/28208853
score: -1
tagged with: servlets
type: Question
has answer: http://stackoverflow.com/a/28209013
upvote count: 0
answer count: 1
tagged with: jsp
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Populate a dropdown list based on the selection of previous dropdown list using ajax and JSP Servlet
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44782538
has body: I wants to develop a live project for one consultancy. I need a help... develop JSP page. 1: user want to select Cilent(Company name) from dropdown list and populating HR list to another dropdown list from belongs to Client(Copmany Name) using ajax. Thanks in advance.
downvote count: 1

http://stackoverflow.com/q/28277293
has comment: http://stackoverflow.com/comment/44909402
tagged with: callback
has title: JS -how to return & rerun a function?
has body: I have a onButtonClick function, when a certain condition is met I'd like to return the result (update the browser), and rerun the function. ...The reason I'm doing this is that changing a transformation property, if I don't reset at a certain degree the rotation won't be coherent... Here's what my click called function looks like: var degree=0, axis='Y'; function onButtonClick(e) { var x = this.className.slice(5); if (condition === true){ //needs to update browser box.style.transform = "translateZ(-"+trans+"px) rotateY(-180deg)"; //now I need to return &amp; rerun this whole function (possibly repeating the call) }; /* switches and manipulations */ box.style.transform = "translateZ(-"+ trans +"px) rotate"+ axis +"("+ degree +"deg)"; } With this code, if the specific condition is met it's not updated in the browser, so when the transformation takes place calculation isn't modified.
has comment: http://stackoverflow.com/comment/44910554
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: call
has comment: http://stackoverflow.com/comment/44909525
tagged with: closures
score: 0
has comment: http://stackoverflow.com/comment/44911770
has comment: http://stackoverflow.com/comment/44909224
tagged with: javascript

http://stackoverflow.com/q/28127036
has comment: http://stackoverflow.com/comment/44628543
score: -1
has comment: http://stackoverflow.com/comment/44627296
type: Question
has body: http://boxes.site44.com/ I have these boxes, and when a user clicks book in any of them, the clicked box will expand and will appear a form. Now i am trying to populate the dropdown on the left upper side (you have to click on book to see) with the h2 tags (which box have the h2 title tag) and change the content, depending on the h2 clicked by the user. The HTML is very large, because of that i made a fiddle: Fiddle: http://jsfiddle.net/62Lw4bjz/ The to expand the box is: var $expander = $('.event .cta'); var $actual = $(); var $others = $(); var $clicked = $(); $expander.click(function(e) { e.preventDefault(); $clicked = $(this); $clicked.addClass('hidden'); $actual = $(this).closest('.event'); $others = $('.event').not($actual); $others.addClass('hidden'); $actual.find('.event__info-list').addClass('inline'); $actual.find('h2') .addClass('event__close') .append('&lt;span class="event__arrow" aria-hidden="true"&gt;&amp;#9660;&lt;/span&gt;'); $actual.find('.expanded').slideDown().css('display', 'flex'); $("html").velocity("scroll", { offset: $("#sell").offset().top, mobileHA: false }); $actual.velocity('transition.expandForm', { delay: 0, duration: 800, ease: 'easeOutSine' }); }); All the dropdowns that i saw, works with lists (&lt;li&gt;), it is possible populate the dropdown with the h2s title tags from each box, or i need change the html in order to make it work? How to change the box based on the clicked h2? Is there example code to help me with this? Should I use jquery's change to achieve this? I am open to suggestions, i am stuck on this for 3 days.. Thanks very much. Update: This is not a dropdown when the box expand, but i need to bee a dropdown that has options to navigate to the other boxes.
has comment: http://stackoverflow.com/comment/44627750
has comment: http://stackoverflow.com/comment/44627462
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44627370
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44627539
tagged with: css
has comment: http://stackoverflow.com/comment/44627368
has comment: http://stackoverflow.com/comment/44627316
has answer: http://stackoverflow.com/a/28127272
accepted answer: http://stackoverflow.com/a/28127272
has comment: http://stackoverflow.com/comment/44627340
has title: how to populate a dropdown with h2 tags and change html content, depending on the h2 clicked by the user
downvote count: 1
has comment: http://stackoverflow.com/comment/44627822
type: AnsweredQuestion

http://stackoverflow.com/comment/44901962
comment on: http://stackoverflow.com/a/28273211
has text: The original fiddle in the answer has also been updated
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28188898
answer count: 3
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has body: ** function task() { var date=Date.now(); var accountid=Xrm.Page.data.entity.getId(); var entity = {}; entity.Description = date; entity.Subject = "Hi....."; entity.RegardingObjectId = { Id:accountid, LogicalName: "account" }; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", datatype: "json", url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/TaskSet", data: JSON.stringify(entity), beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, async: false, success: function (data, textStatus, xhr) { var result = data.d; var newEntityId = result.TaskId; }, error: function (xhr, textStatus, errorThrown) { alert(textStatus + " " + errorThrown); } }); } //I try to get date from system and inserted in to task description but it showing. Blockquote Error bad request Blockquote so please help me out ,thanks in advance.
tagged with: dynamics-crm
has answer: http://stackoverflow.com/a/28189124
score: 1
has answer: http://stackoverflow.com/a/28189148
type: Question
has answer: http://stackoverflow.com/a/28192531
tagged with: javascript
has title: On Save of when creating account record create a task (capturing current time and user in description field) using odata
upvote count: 2

http://stackoverflow.com/comment/44900463
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28271731
has text: either you do it inside `.success` or you can get your rest of the code get executed when your are done with the response using `.done`

http://stackoverflow.com/comment/44731670
score: 2
comment on: http://stackoverflow.com/q/28181175
has text: All your forms get the same class. Your forms get processed with serialize, but will be overwritten each time. leaving you with the last one. You will need to make your forms unique.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28232072
downvote count: 0
has answer: http://stackoverflow.com/a/68112515
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/38019444
has body: Using javascript I create a meta viewport and assign to it a value of 980px. The script is this: var viewPortTag=document.createElement('meta'); viewPortTag.id="viewport"; viewPortTag.name = "viewport"; viewPortTag.content = "width=980, user-scalable=1"; document.getElementsByTagName('head')[0].appendChild(viewPortTag); In CSS, is it possible to write a media query that fires only when the viewport width is EXACTLY 980px?
score: 9
accepted answer: http://stackoverflow.com/a/28232298
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/28232298
answer count: 5
possible better answer: http://stackoverflow.com/a/42604626
tagged with: http://stackoverflow.com/tag/html
has title: CSS media query for exact viewport width
has answer: http://stackoverflow.com/a/42604626
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28232197

http://stackoverflow.com/q/28258655
has comment: http://stackoverflow.com/comment/44875365
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28258670
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44875212
has body: Please can anyone explain why the following throws an "Argument 'MainCtrl' is not a function, got undefined" error which seems to be tied into the use of module dependency injection with directives(?!). angular.module('app', []) .controller('MainCtrl', [function() { var self = this; self.name = "will this work"; self.items = [ { name: "name 1", test: "test 1" }, { name: "name 2", test: "test 2" } ]; }]); angular.module('app',[]) .directive('typeahead', [function() { return { templateUrl: 'type-ahead.html', restrict: 'AEC', scope: { items: '=', prompt: '@', title: '@', subtitle: '@', model: '=', onSelect: '&amp;' }, &lt;...more code&gt; Yet it will work perfectly fine when I remove the [ ] module dependency braces from the directive to read angular.module('app').directive('typeahead', ...) It also works perfectly fine if I define the directive as a cascade following the controller definition i.e. angular.module('app', []) .controller('MainCtrl', [function() { var self = this; self.name = "will this work"; self.items = [ { name: "name 1", test: "test 1" }, { name: "name 2", test: "test 2" } ]; }]) .directive('typeahead', [function() { return { Thanks in advance!
type: Question
has title: angularjs directive definition using angular.module
tagged with: javascript
score: 0

http://stackoverflow.com/q/28147025
downvote count: 2
upvote count: 1
tagged with: css
has answer: http://stackoverflow.com/a/28147175
has answer: http://stackoverflow.com/a/69719753
answer count: 4
has body: I am trying to display the current time as the value in my input upon loading the page. However, its not working for some reason. Any suggestions? Thanks for any help.
type: AnsweredQuestion
type: Question
has title: Have Time automatically be in the input type="time"
accepted answer: http://stackoverflow.com/a/28147175
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28147055
has answer: http://stackoverflow.com/a/28147053
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/28147053

http://stackoverflow.com/q/28263017
has title: Javascript cant get value from PHP variable?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44883005
has comment: http://stackoverflow.com/comment/44882930
type: Question
has comment: http://stackoverflow.com/comment/44882959
has comment: http://stackoverflow.com/comment/44883064
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44882941
has body: I want make data exist checker. data.check.php: &lt;?php $nick = mysql_real_escape_string($_POST['nick']); $query = mysql_query("select * from tb_user WHERE nick='$nick'"); $nick_exist = mysql_num_rows($query); ?&gt; &lt;script language="javascript" type="text/javascript"&gt; var nick_exist = "&lt;?php echo $nick_exist; ?&gt;"; &lt;/script&gt; and this for $POST data input.data.js var v_nick = $('input:text[name=nick]').val(); $.post('data.check.php', {nick: v_nick} ,function() { if(nick_exist){ window.alert('Choose another nick please!'); } }); I dont know where is the problem and my windows.alert is not running :( thanks u
tagged with: ajax
has answer: http://stackoverflow.com/a/28263111
has comment: http://stackoverflow.com/comment/44883860
accepted answer: http://stackoverflow.com/a/28263111
has comment: http://stackoverflow.com/comment/44884014
tagged with: php

http://stackoverflow.com/comment/44679330
type: Comment
comment on: http://stackoverflow.com/a/28153439
score: 0
type: AnswerComment
has text: UTC really isn't affected. You only live in UTC part of the time, apparently.

http://stackoverflow.com/a/28193883
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has body: There is not a direct equivalent in the languages you mention. HTML is a markup language and as such does not have funcitons at all. Javascript and PHP are both interpreted languages, which can be used inline in your HTML. You will find that they aren't as structured in some ways as compiled languages like Objective-C. You can use different approaches to structuring your code, but there is no compiler enforcing them. So for example, you can deploy some Javascript with your HTML which makes a method call, and it doesn't matter if that method was even written yet. As long as it can be found at runtime, it will work. The same goes for PHP. Nothing will prevent you from writing and deploying your code making any method calls you like. As long as those methods can be found in some file that's included when the script runs, the code will work. include() and require() are the commands used to pull in other .php scripts which contain the classes or functions you need. You could write a "header" script which includes all of your dependencies if you like to structure things that way. There are also dependency management tools like Composer - but these are entirely optional.
accepted answer of: http://stackoverflow.com/q/28193499
score: 2
answers question: http://stackoverflow.com/q/28193499

http://stackoverflow.com/a/28180623
type: Answer
has comment: http://stackoverflow.com/comment/44730309
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28180556
has comment: http://stackoverflow.com/comment/44730332
has body: This is pretty easy without any library, although libraries provide alternative implementations for Array#every: var same = a.length === b.length &amp;&amp; a.every(function(value, index) { return value.text === b[index].text; });

http://stackoverflow.com/q/28254683
has answer: http://stackoverflow.com/a/28254820
type: Question
tagged with: javascript
tagged with: gruntjs
has title: Node.js glob - matching a path under any directory
accepted answer: http://stackoverflow.com/a/28254820
score: 0
has body: With node.js globbing, I want to match some path, under any subdirectory. I hope my code example is clearer than my wording: app/themes/*/images/icons/**/*.png So, imagine the following: app |-- themes | |-- theme1 | | `-- images | | `-- icons | | `-- home-icon.png | `-- theme2 | `-- images | `-- icons | `-- home-icon.png It should match both home-icon.pngs, in both theme1 and theme2.
answer count: 1
tagged with: gulp
tagged with: glob
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28197735
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/44765320
type: Question
tagged with: conditional-statements
score: 1
has answer: http://stackoverflow.com/a/28197969
has body: I have a variable that can either be set to false or to an object x.y.z. I want to do something like this: if (var1) { if (var1.x.y.z === 1) { // do stuff } } else { // do something if var1 OR var1.x.y.z === 1 is false } I'm having trouble setting up this conditional statement without having to duplicate the else code for the outer if statement and the inner if statement.
has comment: http://stackoverflow.com/comment/44763865
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44769323
has title: How do I deal with nullable objects in JavaScript conditional statements
has comment: http://stackoverflow.com/comment/44765723

http://stackoverflow.com/q/28270234
has comment: http://stackoverflow.com/comment/44896324
linked to: http://stackoverflow.com/q/19917774
accepted answer: http://stackoverflow.com/a/28633919
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: angular-routing
tagged with: javascript
has comment: http://stackoverflow.com/comment/44896574
has answer: http://stackoverflow.com/a/28633919
has comment: http://stackoverflow.com/comment/44896648
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44897451
has body: When trying to custom elements with Angular, I have made different routes, and they work. Problem is some custom elements won't load. I have a page that is using Angular Route to handle different views like so: angular.module("appRoutes", ["ngRoute"]) .config(function($routeProvider, $locationProvider) { $routeProvider // Route for the home page .when("/", { templateUrl : "../views/home.html", controller : "homeController", controllerAs : "home" }) // Route for Credits .when("/credits", { templateUrl : "../views/credits.html", controller : "creditsController", controllerAs : "credits" }); $locationProvider.html5Mode(true); }); All the CSS and JS files are called in the index.html file. The CSS at the beginning of the file, the JS at the end of the index.html file. I tried moving the JS imports to the top of the file, however that did not change anything. The custom elements I'm trying to use are Slider Revolution and Owl Carousel. When I place the content of home.html directly into index.html everything works perfectly. However, when I try to keep the content of home.html inside of home.html and just load the content using my view. The elements inside the Revolution Slider and Owl Carousel will not work, the images do not load, and the "skeleton" of both of them do not work. Additionally I tried placing the CSS and JS file imports inside the home.html view and that did not work either. I have no idea of how to fix it. I imagine it's some kind of issue with the Javascript for Owl Carousel and Revolution Slider not being able to interact with the view inside of home.html since the CSS in general is working with no issues. Thanks for taking the time to read all of that, any and all help is greatly appreciated.
favorite count: 0
has comment: http://stackoverflow.com/comment/44896336
tagged with: angularjs
has title: AngularJS ngRoute Child View not Loading the Javascript in the Parent View

http://stackoverflow.com/comment/44699941
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28164636
has text: You can't use `<?php` inside strings, you can only use that when you've switched from PHP script interpretation to raw output.
score: 0

http://stackoverflow.com/comment/44720377
score: 0
type: AnswerComment
has text: Can you try showing how can that be done in code? The point is that by extracting it, it becomes messed up, and I don't know how can I add some identification strings without extracting it.
type: Comment
comment on: http://stackoverflow.com/a/28175080

http://stackoverflow.com/q/28211404
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28211778
tagged with: php
possible better answer: http://stackoverflow.com/a/28211664
has comment: http://stackoverflow.com/comment/44787794
has answer: http://stackoverflow.com/a/28211664
has comment: http://stackoverflow.com/comment/44787532
type: AnsweredQuestion
tagged with: placeholder
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28211778
has title: placeholder is not working with ajax
has comment: http://stackoverflow.com/comment/44787233
has comment: http://stackoverflow.com/comment/44787692
answer count: 2
has body: I make ajax request to my function and when i am echo it , placeholder is not working see this div is in loop php: $info=NULL; //loop-start $info.=' '; echo $info; //loop-end js: $('#data').append(html);

http://stackoverflow.com/comment/70590485
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/32561386
type: Comment
has text: I have tried this solution but its not working for me.

http://stackoverflow.com/comment/44834122
has text: Bottomline is: you can't override the onbeforeunload dialog, and you can't redirect the user. There's a [very good answer here](http://stackoverflow.com/questions/6063522/dialog-box-runs-for-1-sec-and-disappears/6065085#6065085). What you can do is spawn another tab with your promotional content. But it's still very frustrating to the user.
comment on: http://stackoverflow.com/q/28235960
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28193744
possible better answer: http://stackoverflow.com/a/28194128
has body: I am developing a site where there is a part where I perform a zip code query, when I give "TAB" or simply click off the field to inform data to the query is performed the event (I'm execulting my JavaScript code in the onblur event in my inputbox). However, I need a "modal" screen or "alert" that should appear during the waiting time of the query. already tried using the methods below, but I did not succeed, do not work in onblur event and not in onclick: $ ('# BuscaCEP') modal ('show.'); $ ('# BuscaCEP') modal ('hide');. someone would have a tip? my geral code: &lt;li class="fields"&gt; &lt;div class="field"&gt; &lt;div class="form-group"&gt; &lt;?php //inputbox to the query from the onblur ?&gt; &lt;label for="zip" class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;__('Zip/Postal Code') ?&gt; &lt;/label&gt; &lt;div class="input-box input-box-bkg-lage-small"&gt; &lt;input type="text" name="postcode" value="&lt;?php echo $this-&gt;escapeHtml($this-&gt;getAddress()-&gt;getPostcode()) ?&gt;" title="&lt;?php echo $this-&gt;__('Zip/Postal Code') ?&gt;" id="zip" onblur="consultacep(this.value)" OnKeyPress="formatNumber('#####-###', this, event)" maxlength="9" class="form-control validate-zip-international &lt;?php echo $this-&gt;helper('customer/address')-&gt;getAttributeValidationClass('postcode') ?&gt;"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;script type="text/javascript"&gt; //Javascript Code function consultacep(cep) { cep = cep.replace(/\D/g, "") url = "http://cep.correiocontrol.com.br/" + cep + ".js" s = document.createElement('script') s.setAttribute('charset', 'utf-8') s.src = url document.querySelector('head').appendChild(s); //where the the loading screen should be performed $('#buscaCEP').modal('show'); } function openWindow() { $('#buscaCEP').open(); } function correiocontrolcep(valor) { if (valor.erro) { alert('Cep não encontrado'); return; } var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if…
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28899898
accepted answer: http://stackoverflow.com/a/28899898
score: 2
type: AnsweredQuestion
tagged with: alert
has answer: http://stackoverflow.com/a/28194128
type: Question
answer count: 2
tagged with: modal-dialog
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Alart or modal screen javascript

http://stackoverflow.com/q/28255972
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44870401
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44881508
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44881535
has comment: http://stackoverflow.com/comment/44870452
has comment: http://stackoverflow.com/comment/44870436
has title: Not all data sent using $http.post angularjs
answer count: 0
has body: why is it that whenever I send data to my server from my mobile application (Ionic Framework) not all data is sent? $http({ method: 'POST', url: 'http://remoteserver/data', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, transformRequest: function(obj) { var str = []; for(var p in obj) str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); return str.join("&amp;"); }, data: { image: $scope.imgURI, facebook_id: localStorage.facebook_id, token: localStorage.accessToken, location: localStorage.location, lon: localStorage.longitude, lat: localStorage.latitude } }).success(function (suc) { localStorage.removeItem('longitude'); localStorage.removeItem('latitude'); localStorage.removeItem('location'); alert(JSON.stringify(suc)); }) .error(function(err){alert(JSON.stringify(err));}); The location after is undefined when the server receives it. When in fact, I alert it to check if its not empty. How can I fix this? Of all the data sent to my server, only the location is missing. The location is the reversed geocoding of the latitude and longitude. I just put it in my mobile to reduce the over use of Google API since it is per session basis. On my server (using laravel) I fetch the sent data using $post-&gt;lon = Input::get('lon'); $post-&gt;lat = Input::get('lat'); $post-&gt;location = Input::get('location'); $post-&gt;token= Input::get('token'); $post-&gt;facebook_id = Input::get('facebook_id'); when I tried to return Input::all(); I see all the sent data except for the location. It says undefined. The problem is, I can fetch the location once, after I tried again, it returns undefined.

http://stackoverflow.com/q/28129072
tagged with: javascript
answer count: 2
has body: I have a image which always points in the direction of the mouse. At some point the angle goes from 180deg to -180deg, how do I get the image to take the short angle instead of doing full circle? // Find ship angle (Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI;). var mouseAngle = getAngle(FIREFLY.CENTER.X, FIREFLY.CENTER.Y, currentMousePos[0], currentMousePos[1]); var turnDegrees = mouseAngle - FIREFLY.ANGLE; var maxDegrees = 5; console.log(mouseAngle + " " + FIREFLY.ANGLE); if (turnDegrees &gt; -5 &amp;&amp; turnDegrees &lt; 5) { // Do nothing. } else if (turnDegrees &lt; 0) { FIREFLY.ANGLE -= 5; } else { FIREFLY.ANGLE += 5; } // Set ship direction. FIREFLY.style.transform = 'rotate(' + (FIREFLY.ANGLE + 90) + 'deg)'; Fiddle
has title: How to prevent object from rotating 360deg when reaching full circle?
downvote count: 0
accepted answer: http://stackoverflow.com/a/28130656
favorite count: 0
has answer: http://stackoverflow.com/a/28129121
tagged with: css
possible better answer: http://stackoverflow.com/a/28129121
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/28130656
type: Question

http://stackoverflow.com/comment/44866091
type: AnswerComment
has text: Nope, `fail` handlers do not replace each other.
score: 0
comment on: http://stackoverflow.com/a/28225034
type: Comment

http://stackoverflow.com/q/28195663
downvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28195792
answer count: 2
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44758080
has title: How do i give download option in fancybox
possible better answer: http://stackoverflow.com/a/28195784
has answer: http://stackoverflow.com/a/28195792
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28195784
has body: I am using the fancy box to display the images in my wordpress theme. Following is the code i am using to display the images. <?php if ( get_post_gallery() ): $gallery = get_post_gallery($post,false); $ids= explode(',', $gallery['ids']); ?> <?php foreach( $ids AS $id ): ?> <?php $src = wp_get_attachment_image_src($id,'thumbnail'); $src1 = wp_get_attachment_image_src($id,'full'); ?> <a class="fancybox-buttons col-sm-4 col-xs-6 paper_img" data-fancybox-group="button" href="<?php echo $src1[0];?>" title=""> <img src="<?php echo $src[0];?>" class=" fancybox-image img-responsive"/> <?php endforeach; endif; ?> This is the js i have been using which i got from somewhere jQuery(document).ready(function() { $('.fancybox-buttons').attr("rel", "gallery").fancybox({ afterLoad: function () { this.title = this.title ? 'Download ' + this.title : 'Download'; }, openEffect : 'none', closeEffect : 'none', prevEffect : 'none', nextEffect : 'none', closeBtn : false, helpers : { title : { type : 'inside' }, buttons : {} }, }); }); The problem is that when i click on download button it takes me to the new window to the url of image instead of downloading it. What i am doing wrong or can you provide me with some other alternative
upvote count: 2
score: 1
tagged with: wordpress

http://stackoverflow.com/comment/44918641
type: AnswerComment
has text: I don't see why not. Give it a go :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28277653

http://stackoverflow.com/a/28250168
downvote count: 1
has comment: http://stackoverflow.com/comment/44860054
upvote count: 0
score: -1
has body: The reason your code is failing is you are using JavaScript inside php code. Try changing your $strUsername = " "; $strPassword = " "; To $strUsername = $_POST['username']; $strPassword = $_POST['password'];
answers question: http://stackoverflow.com/q/28250033
type: Answer
has comment: http://stackoverflow.com/comment/44860006

http://stackoverflow.com/a/28266069
score: 1
upvote count: 1
has body: I have setup a fiddle to replicate the issue. I only managed to get this working by changing the actionMethod for the destory action to POST and setting an idProperty on the model. Ext.application({ name: 'Fiddle', launch: function() { Ext.define('File', { extend: 'Ext.data.Model', idProperty: 'id', fields: [{ name: 'id', type: 'int' }, { name: 'fileName', type: 'string' }, { name: 'fileSize', type: 'string' }, { name: 'position', type: 'string' }] }); Ext.define('Files', { extend: 'Ext.data.Store', model: 'File', autoLoad: true, proxy: { url: 'data1.json', type: 'ajax', simpleSortMode: true, reader: { type: 'json', rootProperty: 'items', totalProperty: 'totalCount' }, api: { create: '', read: 'data1.json', update: '', destroy: 'delete.json', }, actionMethods: { create: 'POST', read: 'GET', update: 'POST', destroy: 'POST' } } }); var store = Ext.create('Files'); Ext.create('Ext.grid.Panel', { title: 'Test', store: store, columns: [{ header: 'id', dataIndex: 'id', flex: 1 }, { header: 'file name', dataIndex: 'fileName', flex: 1 }, { header: 'file size', dataIndex: 'fileSize', flex: 1 }, { header: 'position', dataIndex: 'position', flex: 1 }, { xtype: 'actioncolumn', items: [{ icon: 'css/images/tree/black-trash-16.png', tooltip: 'Delete', width:50, handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); rec.erase(); } }] }], height: 300, width: 600, renderTo: Ext.getBody() }); } }); // Sample JSON Data { "success": true, "totalCount": 5, "items": [{ "id": 1, "fileName": 'file1.png', "fileSize": 93204, "position": 1 }, { "id": 2, "fileName": 'file2.png', "fileSize": 93204, "position": 1 }, { "id": 3, "fileName": 'file3.png', "fileSize": 93204, "position": 1 }, { "id": 4, "fileName": 'file4.png', "fileSize": 93204, "position": 1 }, { "id": 5, "fileName": 'file5.png', "fileSize": 93204, "position": 1 }] }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28262274
answers question: http://stackoverflow.com/q/28262274
type: Answer

http://stackoverflow.com/comment/44912647
has text: If (Recordsety.EOF) Then %> <%
comment on: http://stackoverflow.com/q/28279029
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44628641
comment on: http://stackoverflow.com/q/28127873
type: Comment
type: QuestionComment
has text: Just insert a ` ` tag into the document using JavaScript.
score: 0

http://stackoverflow.com/comment/44638647
comment on: http://stackoverflow.com/q/28133003
type: Comment
type: QuestionComment
has text: Access control means what please @SLaks
score: 0

http://stackoverflow.com/comment/44875601
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28258659
has text: There is still one error, on reload the slidebar shows always up open
score: 0

http://stackoverflow.com/comment/44792499
type: AnswerComment
has text: This is on dom ready so I can make it authenticate immediately. I'm not sure if this needs to be under index.js config function instead
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28214413

http://stackoverflow.com/q/28142646
has answer: http://stackoverflow.com/a/28142897
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1369035
tagged with: iframe
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28142848
possible better answer: http://stackoverflow.com/a/28142897
accepted answer: http://stackoverflow.com/a/28142848
type: Question
answer count: 2
has body: I am a new member to this site...have used it for a long time but never a member but i have not been able to find an answer so I thought I should ask. I am new to working with jquery and html selectors so please forgive me if this is easy question but.. I am using HTML5, css, and jquery. I created a horizontal drop down menu that is three levels deep. I want to select html pages to load into an iframe based on the user's selection (each page represents a report). when I select an inner il selection, I get its id, but then it continues looping through the li and ul until it ends at the parent li. ==> this is the UL > IL > IL tree: link 4 -link 4.1 -link 4.2 -link 4.3&#9654 -- link 4.3.1 -- link 4.3.2 ==> this is the jQuery function: function processRequest(value) { var selectedValue = value; console.log('selected values is: '+selectedValue); $('#frameIt').replaceWith(' ') } I want to use the ID to identify the correct html file to load into the iframe but here is what I see when I inspect this via chrome tools... default.aspx:71 selected values is: sublink41.html default.aspx:71 selected values is: as you can see, it finds the correct value but then it continues to the parent LI and ends there... I have put in some time trying to find a solution to this but have not been able to...any help is appreciated.
tagged with: javascript
tagged with: jquery
has title: Loading an Iframe src with selection from horizontal drop down menu
score: 0
has comment: http://stackoverflow.com/comment/44657286
has comment: http://stackoverflow.com/comment/44658491

http://stackoverflow.com/comment/44713388
has text: Please show some code. A fiddle is great, but questions should be self-contained.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28172104

http://stackoverflow.com/comment/44845964
comment on: http://stackoverflow.com/q/28242616
score: 0
type: Comment
has text: @RadimKöhler OP has included angular in head...
type: QuestionComment

http://stackoverflow.com/a/28172736
type: Answer
has body: This should work... var fizzBuzz = function () { var userNum = prompt('Enter a number!'); var convertNum = +userNum; if(isNaN(userNum)){ console.log('not a number'); fizzBuzz() }else{ doSomethingElse() } }; fizzBuzz();
answers question: http://stackoverflow.com/q/28172526
score: 0

http://stackoverflow.com/comment/44891556
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28266962
score: 0
has text: Do you see the new script elements hen you debug your page with firebug or similars? Also, have your tried to specify that the script.type = 'text/javascript' ?

http://stackoverflow.com/comment/44907445
score: 0
has text: What does the call to login.php return? You can either alert the result in javascript or look at the request in the network tab of the F12 dev tools in your browser.
type: Comment
comment on: http://stackoverflow.com/a/28275319
type: AnswerComment

http://stackoverflow.com/comment/44727296
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28178931
has text: Hmm... I gave that a try however it returned an error; 'window' is undefined, under code 800a1391. Also, it goes to default browser which is IE. ... The complicator to all this is that I can't simply redefine the default to chrome because some of the links will only function within IE. so the script needs to call to both IE and chrome. (some links go to chrome, some to IE). Is there a way to add a variable to the 'window.open' command to direct it to chrome?
score: 0

http://stackoverflow.com/comment/44803670
type: AnswerComment
score: 0
type: Comment
has text: Just to confirm that Angular should be filtering the results and that ang.com isn't a web service that will be filtering that json results based on any passed query strings!
comment on: http://stackoverflow.com/a/28219643

http://stackoverflow.com/q/28192595
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28586012
has comment: http://stackoverflow.com/comment/44752449
score: 4
accepted answer: http://stackoverflow.com/a/28586012
has comment: http://stackoverflow.com/comment/44752960
has answer: http://stackoverflow.com/a/73743410
has body: I want to do a simple window.scrollTo(0,0) on a button click. I want it to just move the window to the top. Unfortunately the window.scrollTo(0,0) does nothing with the GUI. I suspect it has something to do with React and the structure of the application. scrollToTop: function() { window.scrollTo(0, 0); } Do I have to do it in another way with react or is there something I have missed?
upvote count: 4
tagged with: reactjs
possible better answer: http://stackoverflow.com/a/73743410
tagged with: javascript
answer count: 2
has title: Window.scrollTo is undefined in React
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/44969952
type: Comment
has text: it was not a fan of that one, it basically told me "uh you didn't actually pass us anything, we at least need the workspace". I think i had tried that as well at some point... it is so frustrating... why don't they post a "worst case scenario" in their documentation?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28223618

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/28192251
type: Tag
tags question: http://stackoverflow.com/q/28186177

http://stackoverflow.com/q/28194047
has comment: http://stackoverflow.com/comment/44756390
has body: I have written a CSS/HTML code which is supposed to show the images of three cars and when you click on an image, a text box appears and you can write comments about the car into the text box and click on the submit button. I have checked and rechecked my codes and everything seems to be in order. I have saved the codes in the htdocs folder of XAMPP. Now, no PHP is involved in my codes, so I don't need a server to execute the file, but as far as I know, this should not matter. So, I type "localhost/index1.php" into the address bar and press return. What I get, surprisingly, is just the images of the three cars, but no submit button. And when I place my pointer on each car, the individual car image gets bigger (as expected) BUT a textbox does NOT appear. This should not be happening. So I decided to rename my file index1.html and saved it in the htdocs folder as before but STILL the situation persists. Please could someone tell me why I am not getting the textbox to appear when I click on the icon, and why no submit button appears either? I HAVE NOW ADDED JavaScript to my code, and it's STILL not working!!!
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Browser is not ouputting webpage with textbox and submit button
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44754960
has answer: http://stackoverflow.com/a/28194717
has comment: http://stackoverflow.com/comment/44755005
has comment: http://stackoverflow.com/comment/44755129
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28194151
has comment: http://stackoverflow.com/comment/44757083
has comment: http://stackoverflow.com/comment/44755116
has answer: http://stackoverflow.com/a/28194151
accepted answer: http://stackoverflow.com/a/28194717
score: 0
has comment: http://stackoverflow.com/comment/44757031
answer count: 2

http://stackoverflow.com/a/28192026
score: 1
upvote count: 1
has body: The problem, my friend, lies in the server/smtp.js file where you have misspelled the world server. So the smtp object doesn't have any property called server. You defined as servre.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28191677

http://stackoverflow.com/q/28124459
has title: Highcharts single horizontal stacked bar chart with data names (labels) and %-ages always shown and data numbers and series name shown on mousehover
linked to: http://stackoverflow.com/q/28126688
linked to: http://stackoverflow.com/q/13808135
score: 1
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28125065
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28125065
favorite count: 0
linked to: http://stackoverflow.com/q/16837209
has body: Is it possible to combine the following? Fiddle 1 (answered by mäksä) as a main template: Single horizontal stacked bar with bar segments Combined with the following features of Fiddle 2 (answered by aus_lacy): Always visible on bar segments: Data names (labels) (i.c. "apples", "pears",...) Percentages (calculated if possible: "50%","50%",...) Shown on mousehover: Original data numbers (i.c. "15","15",...) Series name/description (i.c. "Browser share") Almost but not quite: An example of a horizontal bar chart with "percentages" always shown, and "original data numbers" on mousehover can be found in Fiddle 3 (answered by jlbriggs), but there the "data names" are lacking, and I can't find a way to change the "series name". Further more: this is a horizontal bar chart, but this is not a single stacked one. Any help would greatly be appreciated, many thanks.
linked to: http://stackoverflow.com/q/28117712
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/28169828
has comment: http://stackoverflow.com/comment/44709550
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28169455
answers question: http://stackoverflow.com/q/28169455
type: Answer
has body: What is normally meant with currying is that calling a function with less than the expected number of parameters will return a function that expects the remaining missing parameters. It should not accumulate state on the function object... f = curry(function(x, y, z) { return x+y+z; }); g = f(1) // --&gt; &lt;func&gt; h = g(2) // --&gt; &lt;func&gt; h(3) // --&gt; 6 (computed from 1+2+3) g(10, 20) // --&gt; 31 (computed from 1+10+20) currying is even used in pure functional languages where you don't actually have the concept of mutable state.
downvote count: 0
score: 3
upvote count: 3

http://stackoverflow.com/a/28207940
has body: Once you get response from the AJAX call and once the items are set in the dataView, add the below lines of code for the latest changes to be reflected in the grid: dataView.beginUpdate(); dataView.setItems(items); // data from response dataView.endUpdate(); // Below 2 lines are important grid.updateRowCount(); grid.invalidateRows(selectedrows); grid.render(); Hope this works
answers question: http://stackoverflow.com/q/28185491
score: 0
type: Answer

http://stackoverflow.com/comment/44660758
score: 0
has text: @JimMacKenzie Use this plunker and set up the demo. http://plnkr.co/edit/mtXoPq?p=preview
type: Comment
comment on: http://stackoverflow.com/a/28143464
type: AnswerComment

http://stackoverflow.com/comment/44641254
has text: Thanks and this is a great answer but the reason i wish to use regex is because not only ami looking good what is behind the colon but i also want the value that comes after it.
comment on: http://stackoverflow.com/a/28134295
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28264389
has title: Jquery div dissappearing with no reason
answer count: 0
score: 0
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44885578
has comment: http://stackoverflow.com/comment/44891005
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: I have made a menu animation (also with help of other stack overflowers). I have (hopefully) my final problem. The div that I create on the hover of second ul disappears when changing the lis on the third ul. Changing the lis on the second ul works just fine (background stays there). I even tried this as you can see on the jsfiddle example. $(".main-navigation ul ul:nth-child(2) &gt; li:not(ul:nth-child(3))"). I tried to isolate any way possible to not react when leaving the third ul lis, even though the ">" selector should do that. (figured that's where the problem is.) JSFIDDLE: http://jsfiddle.net/r8vx07ae/13/
tagged with: css
has comment: http://stackoverflow.com/comment/44885721
has comment: http://stackoverflow.com/comment/44893492

http://stackoverflow.com/comment/44838702
comment on: http://stackoverflow.com/q/28238377
has text: Inconsistency -- your OS menu requires a click. Touchscreens don't have a hover, so *they* also require a click.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28194128
has comment: http://stackoverflow.com/comment/44762538
score: 0
has body: Try this: $('#zip').blur(function(){ consultacep(this.value); }); This will bind the onblur event programmatically with jQuery. Note: Make sure the item with id buscaCEP exists. Edit: The original error comes from the place where you define your functions, when "onblur" event triggers the callback is undefined and it triggers an error. Try to add your javascript on the header of the website or use the method I provided for waiting the DOM to load. Do not redefine the blur event callback, just use one method. simple example
has comment: http://stackoverflow.com/comment/44807384
has comment: http://stackoverflow.com/comment/44796689
type: Answer
has comment: http://stackoverflow.com/comment/44763649
has comment: http://stackoverflow.com/comment/44762384
has comment: http://stackoverflow.com/comment/44792132
answers question: http://stackoverflow.com/q/28193744
has comment: http://stackoverflow.com/comment/44762055
has comment: http://stackoverflow.com/comment/44761356

http://stackoverflow.com/comment/44832952
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28235770
score: 1
has text: where do u want to see php's echo?

http://stackoverflow.com/a/28130607
has comment: http://stackoverflow.com/comment/44633992
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44633967
has comment: http://stackoverflow.com/comment/44634061
type: Answer
answers question: http://stackoverflow.com/q/28130576
accepted answer of: http://stackoverflow.com/q/28130576
has comment: http://stackoverflow.com/comment/44634017
upvote count: 3
has comment: http://stackoverflow.com/comment/44633984
score: 3
has body: You called the constructor function as if it were a regular function. This meant that the default value of this was (in a browser, outside of strict mode) window and not a new object. It also means that the default return value was undefined instead of that new object. To use it as a constructor you need to use the new operator. var newTAelement = new TAelement( "rs5", "Thirteen", "13", "15", "14","11","99"); NB: This has nothing at all to do with jQuery, which you don't use anywhere in your code. It is core JavaScript.

http://stackoverflow.com/comment/44736053
type: AnswerComment
has text: It is a little bit readable for me. But I think there is some situations that you must declare a function inside the parameters of another function. So, what could I do to maintain good interfaces in this case?
type: Comment
comment on: http://stackoverflow.com/a/28178624
score: 0

http://stackoverflow.com/comment/44719125
comment on: http://stackoverflow.com/q/28175042
score: 2
type: Comment
type: QuestionComment
has text: http://www.w3schools.com/jsref/prop_doc_referrer.asp `document.referrer`

http://stackoverflow.com/comment/44724759
type: QuestionComment
comment on: http://stackoverflow.com/q/28175032
score: 0
has text: Can you give us an example array, so we can run it for ourselves?
type: Comment

http://stackoverflow.com/comment/44921811
type: AnswerComment
comment on: http://stackoverflow.com/a/28245154
score: 0
type: Comment
has text: Thank you. Well, I could explain how `randomQuestion()` works, exactly, but I will be more useful in terms of learning if you find out yourself. Open the browser's developer tools, set a few breakpoints and step through the code. It's not that difficult to figure out how it works. :)

http://stackoverflow.com/a/28249566
score: 0
has comment: http://stackoverflow.com/comment/44859604
has comment: http://stackoverflow.com/comment/44868388
type: Answer
answers question: http://stackoverflow.com/q/28249456
has comment: http://stackoverflow.com/comment/44858975
has comment: http://stackoverflow.com/comment/44868373
has body: Maybe i don't understand your question but is this kind of thing you want to achieve? // Static class method. Interface.ensureImplements = function(object) { if(arguments.length &lt; 2) { throw new Error("Function Interface.ensureImplements called with " + arguments.length + " arguments, but expected at least 2."); } for(var i = 1, len = arguments.length; i &lt; len; i++) { var interface = arguments[i]; if(interface.constructor !== Interface) { throw new Error("Function Interface.ensureImplements expects arguments" + " two and above to be instances of Interface."); } for(var j = 0, methodsLen = interface.methods.length; j &lt; methodsLen; j++) { var method = interface.methods[j]; if(!object[method] || typeof object[method] !== 'function') { throw new Error("Function Interface.ensureImplements: object " + "does not implement the " + interface.name + " interface. Method " + method + " was not found."); } } } }; I use this code to test if a function is a type of Interface. The key code is : if(interface.constructor !== Interface) { To extends for a class you can do this : function Item () { }; function Picture () { Item.call(this); // Call to superClass constructor with subclass instance }; Picture.prototype = new Item(); Picture.prototype.constructor = Picture; var picture = new Picture(); if(picture instanceof Item){ alert("True"); } else { alert(false); }

http://stackoverflow.com/comment/44626973
comment on: http://stackoverflow.com/q/28126941
has text: But you don't get any error... hm. What is `019+1`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44922675
score: 0
comment on: http://stackoverflow.com/a/28283192
type: AnswerComment
has text: I love you. Thanks so much for your answer! I'll see if I can fix the problem now!
type: Comment

http://stackoverflow.com/q/28276285
has comment: http://stackoverflow.com/comment/44907207
has comment: http://stackoverflow.com/comment/44907407
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: how to select and copy some text when i right click on it
favorite count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28276508
downvote count: 4
has body: I have a text on my html page. When I select and right click on text, i have to copy that text and want to show in another popup or want to load another window with selected text. Please help me. Thanks in Advance.
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: -4

http://stackoverflow.com/q/28233500
has answer: http://stackoverflow.com/a/28234958
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has title: Always show one text in Bootstrap-select
type: AnsweredQuestion
score: 2
upvote count: 2
has body: Mustard Ketchup Relish So there are bootstrap-select(multiple). Is it possible not to change title when user something check/select? Behaviour like in Bootstrap dropdown. Example : jsFiddle
type: Question
possible better answer: http://stackoverflow.com/a/28234958
accepted answer: http://stackoverflow.com/a/28234997
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28234997
downvote count: 0
tagged with: bootstrap-select
favorite count: 0

http://stackoverflow.com/q/28201147
possible better answer: http://stackoverflow.com/a/28201485
type: Question
has answer: http://stackoverflow.com/a/28201485
score: 5
accepted answer: http://stackoverflow.com/a/28202424
has title: How to make top line shorter than bottom line (within div)
tagged with: javascript
tagged with: string-length
answer count: 2
has answer: http://stackoverflow.com/a/28202424
has comment: http://stackoverflow.com/comment/44768634
tagged with: jquery
favorite count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/44769009
has comment: http://stackoverflow.com/comment/44769573
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44768538
has body: I have an unordered list which contains 3 list items (represented in my example as 3 green boxes). Each box has an image and 3 divs (title,location,price). I'm only concerned with each box's title div. If the title is long enough so that it produces 2 lines, I want the top line to always be shorter than the bottom line. My demo site seen here shows boxes 1 & 2 with the wrong setup, and box #3 shows the correct setup. I'm having trouble... this may require js to determine line length and then set the bottom line to be longer. Screen resolution will likely play a role but can't I make the lines consistent across different screen sizes? Here is one of the list items, I'm interested in the div "titlebox": This line is longer than this line Location Price Any help is great, thanks!! Screenshot attached too:
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44771120
downvote count: 0

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/28222228
tags question: http://stackoverflow.com/q/28139810

http://stackoverflow.com/comment/80035770
score: 1
has text: the last image does not detect animation
type: AnswerComment
comment on: http://stackoverflow.com/a/29104335
type: Comment

http://stackoverflow.com/comment/44678712
type: AnswerComment
comment on: http://stackoverflow.com/a/28153208
score: 0
type: Comment
has text: Thanks, I will try to implement it in the magento form. the submit button looks like this: hope it works.

http://stackoverflow.com/q/28170511
accepted answer: http://stackoverflow.com/a/28170815
answer count: 2
tagged with: google-maps
tagged with: javascript
has answer: http://stackoverflow.com/a/28170815
has answer: http://stackoverflow.com/a/43512324
possible better answer: http://stackoverflow.com/a/43512324
favorite count: 0
score: 2
downvote count: 0
has body: I use this code to provide autocompletion of location names thanks to the Google Maps API: var autocomplete = new google.maps.places.Autocomplete(document.getElementById('adr')); City : &lt;input id="adr" type="text" class="form-control" value="" &gt; &lt;script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;amp;libraries=places" type="text/javascript"&gt;&lt;/script&gt; All locations names are provided, like city names "Paris", but also country names "Germany", region names, etc. How is it possible to have autocompletion but for city names only? i.e. no street names, no country names, no region names ?
type: Question
has title: Get only city names with Google Maps API autocompletion
type: AnsweredQuestion
tagged with: autocomplete
upvote count: 2

http://stackoverflow.com/comment/44744226
score: 0
comment on: http://stackoverflow.com/q/28187950
has text: this link can help you : http://stackoverflow.com/questions/17320399/how-to-change-text-color-after-x-amount-of-seconds and the demo here : http://jsfiddle.net/simevidas/7ZrtQ/
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28178931
has comment: http://stackoverflow.com/comment/44727368
has body: I'm quite sure that you get the same result by calling window.open("website url", "_blank") multiple times, using Chrome. It might give a warning that the page is trying to open other pages, but since it is from a "trusted source", you can disable this warning and it'll not annoy you anymore.
score: 0
has comment: http://stackoverflow.com/comment/44727296
answers question: http://stackoverflow.com/q/28178668
type: Answer
has comment: http://stackoverflow.com/comment/44727598

http://stackoverflow.com/a/28148320
has comment: http://stackoverflow.com/comment/44668562
type: Answer
has comment: http://stackoverflow.com/comment/44668392
has comment: http://stackoverflow.com/comment/44668466
has comment: http://stackoverflow.com/comment/44668470
score: 0
answers question: http://stackoverflow.com/q/28148271
has body: You need to attach event listeners for focusout (respectively blur) and compare the value to your original input data. If those two values match, nothing was changed. document.getElementByName( 'myinput' ).addEventListener( 'focusout', function( event ) { if( document.getElementByName( 'myinput_original' ).value !== this.value ) { alert( 'new value differs' ); }; }, false); Demo: http://jsfiddle.net/faphygty/

http://stackoverflow.com/a/28170573
type: AcceptedAnswer
downvote count: 0
has body: var number = parseInt('' + (num * 100)) / 100;
has comment: http://stackoverflow.com/comment/44710434
has comment: http://stackoverflow.com/comment/44711628
has comment: http://stackoverflow.com/comment/44710407
type: Answer
has comment: http://stackoverflow.com/comment/44710830
accepted answer of: http://stackoverflow.com/q/28170463
answers question: http://stackoverflow.com/q/28170463
score: 10
has comment: http://stackoverflow.com/comment/44710480
upvote count: 10
has comment: http://stackoverflow.com/comment/44710436

http://stackoverflow.com/comment/44842413
score: 0
type: Comment
has text: yes Albert, thank you. I will accept your answer. I have another question about this plugin. When I use KnockoutJS to repeat the data in a loop, so the ratings also repeat, when a star is moused over, the rest do not get highlighted. I've edited my question with some code.
comment on: http://stackoverflow.com/a/28223436
type: AnswerComment

http://stackoverflow.com/comment/44759133
has text: @MasterScrat setTimeout and setInterval. I added setTimeout in a function to call itself, to create a loop with delay. In the loop JS addClass to trigger a CSS transition. When scrolling, everything freezes.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28193046

http://stackoverflow.com/q/28200570
has comment: http://stackoverflow.com/comment/44767729
type: Question
accepted answer: http://stackoverflow.com/a/28200638
has title: Looping though unique keys
has comment: http://stackoverflow.com/comment/44768017
tagged with: javascript
has comment: http://stackoverflow.com/comment/44768277
has comment: http://stackoverflow.com/comment/44767742
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44768561
linked to: http://stackoverflow.com/q/13041009
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44767500
has comment: http://stackoverflow.com/comment/44768086
has comment: http://stackoverflow.com/comment/44768697
type: AnsweredQuestion
has body: I have a json object which I would like to loop through; however each object has a nested object which I can't access through dot notation due to the values being unique. .__proto__ will give me consistent results; however I'd like to pull out the values starting with the "-Jg". Is it possible to do this through a regular expression or another method? Edit: I'm looping through the 'javascript object' with angular var lognew = []; angular.forEach(log, function(value, key) { if(value){ if(value.substr(0,3) !== "-Jg" ){ this.push(value); } } }, lognew); console.log(lognew); This currently returns: TypeError: undefined is not a function
has answer: http://stackoverflow.com/a/28200638
score: 1
has comment: http://stackoverflow.com/comment/44767654
upvote count: 1

http://stackoverflow.com/comment/44653682
type: AnswerComment
type: Comment
has text: I think you're missing my point. The JS code above makes 2 requests to http://localhost:8080, the first one succeeds, the second causes a CORS error. I've added some comments to the code, to make this clearer
comment on: http://stackoverflow.com/a/28140449
score: 1

http://stackoverflow.com/q/28128690
has answer: http://stackoverflow.com/a/28128883
answer count: 1
downvote count: 0
favorite count: 0
has title: How to add the "Functions tab" to Google's blockly
tagged with: code-generation
accepted answer: http://stackoverflow.com/a/28128883
type: AnsweredQuestion
score: 1
tagged with: blockly
has body: According to the Demo that comes with blockly, we only have logic, loops, maths and text options when generation our code. here: https://blockly-demo.appspot.com/static/demos/generator/index.html How do I add the functions and variables tab since the documentation provide seems quite shallow. Documentation: https://developers.google.com/blockly/installation/code-generators Thanks in advance!
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/28536187
type: Answer
has body: Lightbox2 2.7.1 and the bootstrap carousel work well together for the buttons : previous next And the carousel : your content here your content here I didn't use it exactly like you (1 image per step), but I'm sure you can find a lot of usage examples on the web.
accepted answer of: http://stackoverflow.com/q/28126648
answers question: http://stackoverflow.com/q/28126648
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/44881244
score: 0
has text: And why do you want to put that HTML tag in the canvas? How is that supposed to look, and what are you expecting ?
comment on: http://stackoverflow.com/q/28262111
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44883626
has text: A first thing, that might not be related : use POST as method. GET requests should not change the data.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28262274
score: 1

http://stackoverflow.com/comment/44698360
has text: i want to get the data from upload file....
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28149774
type: Comment

http://stackoverflow.com/comment/44770989
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28181120
has text: its not working. submit button is no longer clickable. any further help

http://stackoverflow.com/comment/44637995
comment on: http://stackoverflow.com/q/28132545
has text: @Alexander O'Mara It's the query result, and it´s correct `"admin_login_image_tiles":0,"admin_login_background_image":"","admin_login_background_image_property":"cover".......` that's what it should put in a file
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28201490
downvote count: 0
has title: Center expanding text on a hover
score: 1
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28201603
tagged with: javascript
tagged with: jquery
has body: I have got a hover working with some text and overlay, but I want the text to be centered in the middle. The heading might change so it needs to be center no matter the number of words (I know there is a limit to the container). I know this is possible to using jquery but I just wanted to see if there was a CSS way of doing it. li { position: relative; display: inline-block; margin: 0 -4px -4px 0; } li img { display: block; } li .over { position: absolute; display: none; background: rgba(0, 0, 0, 0.6); top: 0; bottom: 0; right: 0; left: 0; color: white; } li:hover .over { display: block; } Hello
possible better answer: http://stackoverflow.com/a/28202897
has answer: http://stackoverflow.com/a/28202897
upvote count: 1
has answer: http://stackoverflow.com/a/28201603
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/44770308
type: AnsweredQuestion

http://stackoverflow.com/a/28227325
answers question: http://stackoverflow.com/q/28225944
type: Answer
has body: Then you change checked property using Jquery prop method input does not fire change event. So you have to fire it manually using Jquery trigger. For more info look at this question. Also yo have to register event bind before trigger it, or use Jquery on.
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28225944

http://stackoverflow.com/q/28222828
has body: Migrating from struts 1 to struts 2 Javascript problem. Struts 1 project has a logonForm. Struts 1 project Javascript as following: function doLogin() { document.logonForm.userId.value = document.logonForm.userId.value .toUpperCase(); document.logonForm.btnLogin.value = '&lt;bean:message key="button.login" /&gt;'; disableButtons(document.forms[0]); document.logonForm.submit(); } Migrating the Javascript code from Struts 1 to Struts 2. Struts2 has no form bean. (NO more logonForm) The “document.logonForm.userId.value” failed “ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[default]] (http--0.0.0.0-8080-8) Servlet.service() for servlet default threw exception: java.lang.IllegalStateException: Parameters processing failed. How can I fix the Javascript error (NO more logonForm) for Struts 2?
downvote count: 0
favorite count: 0
has title: Migrating from struts 1 to struts 2 for Javascript
has comment: http://stackoverflow.com/comment/44827736
has comment: http://stackoverflow.com/comment/44848170
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44847447
tagged with: struts2
type: Question

code-generation
tag name: code-generation
tags question: http://stackoverflow.com/q/28128690
type: Tag

http://stackoverflow.com/comment/44632219
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28129589
has text: I thought something like that but if I remove the second value and replace it with a number say 10 for instance it still don't go through.
score: 0

http://stackoverflow.com/q/28168393
has body: I'm trying to make an robot with perl (LWP librairy) to automatize some annoying task. I'm able to passing through the first login page, but i'm redirected to a second one with a formulaire write in Javascript : &lt;script language='javascript'&gt; var f; f=(document.forms.length&gt;0 ? document.forms.item(0) : null); if (!f) { document.writeln("&lt;form method='post' action='' target=''&gt;"); document.writeln("&lt;/form&gt;"); f=document.forms.item(0); } f.action='URL'; f.target='_top'; f.submit(); &lt;/script&gt; Due to this method, my ( HTML::Form->parse( $resultat->content, $resultat->base ) )[0], doesn't find the form &amp; crash. I really need help on this, Thanks :)
has title: Perl / LWP Trouble to submit a javascript form
has answer: http://stackoverflow.com/a/28169142
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
tagged with: forms
tagged with: perl
tagged with: lwp
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28240570
type: Question
tagged with: javascript
has body: I am using Joomla 3 and Splashr to create a modal popup that displays content using an iframe. The module uses the SqueezeBox.Open method to spawn the modal on page load. The problem is that the iframe has a scroll bar on the right side. What I have tried to remove it: CSS: sbox-content iframe { overflow:hidden !important; } JS Modification: SqueezeBox.open('./pop-up', { "handler":"iframe", "style" : { "overflow":"hidden" }, "size" : { "x":"600", "y":"600" } }); SqueezeBox.open('./pop-up', { "handler":"iframe", "options": { "scrolling":"no" }, "size" : { "x":"600", "y":"600" } }); Usually I would just add scrolling="no" to the iframe HTML, but that HTML code is generated by the javascript. Is there a way to insert the scrolling="no" in to the iframe via the SqueezeBox.open() JS OR is there some other method I can use to remove the scroll bar?
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: css
tagged with: joomla
downvote count: 0
answer count: 0
score: 1
has title: Removing Scroll Bar on Joomla 3 SqueezBox

http://stackoverflow.com/a/28211988
has comment: http://stackoverflow.com/comment/44804224
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44800232
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/44798528
accepted answer of: http://stackoverflow.com/q/28204789
has comment: http://stackoverflow.com/comment/44797630
has body: I did some JavaScript customization for MicroStrategy and it was quite a nightmare to figure out how to do things. MicroStrategy, as company, doesn't support JavaScript customization, so there is no documentation for it, also online there is not much you can find. I'm not sure which version of MicroStrategy and which visualization you are using (interactive works differently from express mode), anyway my suggestion is to modify the onclick to log this so that you can have an idea about this object is that. Something like that: jQuery('#cm1r10').click( function(){ console.log(this) } ); Another way to tackle the problem is not to try to run the function associated to the menu item, but to simulate the button click on it. jQuery("#RemoveGrid").on("click", function (e) { jQuery('#cm1r10').trigger('click'); } ); Not sure if this works if the context menu is not showing on the screen, but I think it's worth a try. Anyway I suggest you to use jQuery instead of $ when you are customizing someone else code
answers question: http://stackoverflow.com/q/28204789
has comment: http://stackoverflow.com/comment/44803612

http://stackoverflow.com/q/28137452
has answer: http://stackoverflow.com/a/28137485
upvote count: 1
type: Question
tagged with: settimeout
has answer: http://stackoverflow.com/a/28137528
has title: Bootstrap Modal Window pop-up after 5sec
has answer: http://stackoverflow.com/a/41324665
tagged with: bootstrap-modal
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28137528
has body: Do anyone know how to make bootstrap modal window pop-up after 5sec ? I had done a Modal Window with auto pop up but I wish it's pop up delay 5 sec . can anyone help ? thanks for help . here my code . 給我們一個小小的贊吧～我們會帶給你更多的趣事，新聞，最新動態！您的一個贊給我們帶來無限的力量！ 已經讚了,请稍等...
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44646657
possible better answer: http://stackoverflow.com/a/28137483
tagged with: twitter-bootstrap
score: 1
has answer: http://stackoverflow.com/a/28137483

http://stackoverflow.com/comment/44659770
has text: I have the code $target = $(event.target), but I don't know how to use additional codes to open the myModal. I am quite new to these. Thank you in advance.
comment on: http://stackoverflow.com/q/28143955
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44852378
type: Comment
comment on: http://stackoverflow.com/q/28245795
score: 0
type: QuestionComment
has text: Agreed with orange, your question is hard to understand. Do I understand you correctly that you're wondering how CoffeeMachine has access to the `self` variable defined in Machine?

http://stackoverflow.com/comment/44897561
has text: could you please include sample codes.It will be more better to understand
comment on: http://stackoverflow.com/a/28270939
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44816417
comment on: http://stackoverflow.com/q/28226632
has text: If you need to return the config, why not just get it in a variable before the first require, and pass the value to the module ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44719668
score: 0
has text: Had a similar problem today, solved it by reading this: http://www.sitepoint.com/understanding-angulars-apply-digest/ not sure if that's what you need though.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28175160

http://stackoverflow.com/q/28231367
has comment: http://stackoverflow.com/comment/44829155
has comment: http://stackoverflow.com/comment/44828554
tagged with: javascript
has body: I am trying to define controllers in separate files, but I'm getting the error: transactionsController not a function got undefined File structure I have added files in this sequence 1- common.js 2- transactions.js Common.js In common files I have defined var app = angular.module("spModule", ["ngMessages", "ui.bootstrap"]); Transactions.js angular.module('spModule').controller('transactionsController', ['$scope', '$http', function ($scope, $http) {} ] ); HTML FIle &lt;body ng-app="spModule" ng-controller="transactionsController"&gt;
accepted answer: http://stackoverflow.com/a/28233898
possible better answer: http://stackoverflow.com/a/28233490
downvote count: 0
has comment: http://stackoverflow.com/comment/44827115
has answer: http://stackoverflow.com/a/28233490
has comment: http://stackoverflow.com/comment/44824954
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44824967
answer count: 4
score: 25
has answer: http://stackoverflow.com/a/28231824
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/37928303
upvote count: 25
has answer: http://stackoverflow.com/a/28233898
has comment: http://stackoverflow.com/comment/44828581
has comment: http://stackoverflow.com/comment/44825016
type: Question
has title: How to define controllers in multiple files - AngularJs

http://stackoverflow.com/a/28138091
has body: adding #sidebar .nav { width: 95%; position:fixed; } works for me fiddle: http://jsfiddle.net/PrakharThakur/afrbbsh3/
score: 0
answers question: http://stackoverflow.com/q/28137985
has comment: http://stackoverflow.com/comment/44647891
type: Answer

http://stackoverflow.com/q/28141311
score: 1
has body: I'm using a div with contenteditable="true" as an input field, and now I'm looking for a way to pass the content of the div to a PHP variable in order to be able to save it in a .txt file. I've been looking around for solutions, and the only suggestion I've found so far would be to (as I understand it) add the content to a hidden input field before submitting it – though I'm not sure how to do this, it seems like there's probably a better way to approach this? It's worth mentioning that I'm not that experienced working with back-end, so any explanation to a solution would be greatly appreciated – even just a pointer in the right direction at this time would be nice. I'm currently having a regular form to test the save function with the variable $name for texting purposes, but my goal is to save the text in the div in $textcontent instead. (Preferably I'd use a href to submit instead of a button, but I doubt that makes much difference as to what method to use in order to solve my problem.) index.php &lt;?php //temporary, will be dynamic $sessionid = "123testID"; ?&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;div id="results"&gt; &lt;div name="textcontent" contenteditable="true" class="no-formatting"&gt;Content that should be saved to .txt file&amp;#133;&lt;/div&gt; &lt;!-- for testing only --&gt; &lt;form action="index.php" method="post"&gt; &lt;input type="text" placeholder="Name" name="name"&gt; &lt;input type="submit" name="submit"&gt; &lt;/form&gt; &lt;br&gt; &lt;a href="index.php"&gt;reload&lt;/a&gt; &lt;!-----&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php $name = $_POST["name"]; $sessionid = "123testID"; ?&gt; &lt;?php if (strlen($name) &gt; 0) { $fp = fopen('stories/'.$sessionid.'.txt', 'a+'); fwrite($fp, "textcontent:\t".$name."\r\n"); fclose($fp); } ?&gt;
has comment: http://stackoverflow.com/comment/44655040
has comment: http://stackoverflow.com/comment/44654831
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/6247702
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28142091
has comment: http://stackoverflow.com/comment/44654570
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44654727
tagged with: submit
has title: Get content in div to PHP variable
tagged with: contenteditable
has comment: http://stackoverflow.com/comment/44654668
upvote count: 1
accepted answer: http://stackoverflow.com/a/28142091
tagged with: php
type: Question
type: AnsweredQuestion

http://stackoverflow.com/a/28178154
has comment: http://stackoverflow.com/comment/44728543
has comment: http://stackoverflow.com/comment/44729096
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/44727701
score: 2
accepted answer of: http://stackoverflow.com/q/28177900
downvote count: 0
answers question: http://stackoverflow.com/q/28177900
has comment: http://stackoverflow.com/comment/44727538
has body: Your color isn't being animated because you need to use the jQuery Color plugin to animate colors. So you'd need to include the jquery color plugin in your markup and then change your animate code to look similar to this. $("#block").animate({ backgroundColor: $.Color(blues[counter++]) }, 1500 );
has comment: http://stackoverflow.com/comment/44726108
has comment: http://stackoverflow.com/comment/44728900
has comment: http://stackoverflow.com/comment/44729068

http://stackoverflow.com/q/28139962
has title: Javascript array change value recursively
type: UnansweredQuestion
has body: I'm stucking at changing an value of an array with unknown depth. I want to iterate over it and change specific values, after all changes are done I want to receive the whole array back with the applied changes. Code sample: var array = []; array.name = "Page"; array.inside = []; array.inside.name = "Page inside"; array.inside.inside = []; array.inside.inside.name = "Page inside inside"; array.inside.inside.inside = []; function changeValue(array) { for (var ii in array) { if (typeof array[ii] === 'object') changeValue(array[ii]); if (array.name) { array.name = array.name + " changed"; } console.log(array); } } changeValue(array);
type: Question
has answer: http://stackoverflow.com/a/28140128
tagged with: recursion
has comment: http://stackoverflow.com/comment/44651669
tagged with: javascript
score: 0
tagged with: arrays
answer count: 1

http://stackoverflow.com/a/28260931
type: Answer
has comment: http://stackoverflow.com/comment/44879235
score: 1
upvote count: 1
has body: That's not a problem. The value 2e+7 is the same as 20000000, it's just a different way of showing the number. In some tools, large numbers are shown in scientific notation. The number 2e+7 means 2 * 107.
has comment: http://stackoverflow.com/comment/45164276
has comment: http://stackoverflow.com/comment/44879096
answers question: http://stackoverflow.com/q/28260889
has comment: http://stackoverflow.com/comment/44879138
downvote count: 0
has comment: http://stackoverflow.com/comment/44879005

http://stackoverflow.com/q/28227925
accepted answer: http://stackoverflow.com/a/28242829
has comment: http://stackoverflow.com/comment/44818972
has body: I tried to use coffee script recently, but I have some code like this if userAgent.match(/iPad/i) or userAgent.match(/iPhone/i) or userAgent.match(/iPoid/i) or userAgent.match(/Android/i) or userAgent.match(/IEMobile/i) or userAgent.match(/BlackBerry/i) console.log("This is a mobile device") else console.log("This is not mobile device") So the first line is very long, I want to make it multi-line.Maybe some code like this is much better, but as you know, this is wrong in coffee script. # This is the wrong code if userAgent.match(/iPad/i) or userAgent.match(/iPhone/i) or userAgent.match(/iPoid/i) or userAgent.match(/Android/i) or userAgent.match(/IEMobile/i) or userAgent.match(/BlackBerry/i) console.log("This is a mobile device") else console.log("This is not mobile device") or some code like this: # This is also wrong if userAgent.match(/iPad/i) or userAgent.match(/iPhone/i) or userAgent.match(/iPoid/i) or userAgent.match(/Android/i) or userAgent.match(/IEMobile/i) or userAgent.match(/BlackBerry/i) console.log("This is a mobile device") else console.log("This is not mobile device") So any way to correct this?
has comment: http://stackoverflow.com/comment/44818948
tagged with: coffeescript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44818867
has title: How to make one line coffee script code to multiline?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44819083
has answer: http://stackoverflow.com/a/28242829
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44819096
downvote count: 0
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/comment/44691827
has text: ctrl+shift+b will toggle your bookmark bar.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28160086
score: 0

http://stackoverflow.com/q/28251992
tagged with: regex
has title: regular expression for minimu two words
has body: I want to make a real name check, and should at last 2 normal words (a-z). E.g: If input is: 'real name' =&gt; true 'real name real and many words' =&gt; true 'name' =&gt; false I have this regex but it seems to don't work ^[a-zA-Z]+\s[a-zA-Z]+$ Any help? regexp for minim two words in javascript
has answer: http://stackoverflow.com/a/28252004
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28252004
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/44689073
type: QuestionComment
comment on: http://stackoverflow.com/q/28158891
score: 3
has text: Is `calc` called immediately after the `get` call? If not, just store the price in a global variable.
type: Comment

http://stackoverflow.com/a/28133349
has comment: http://stackoverflow.com/comment/44639286
score: 0
has body: Did you include the jquery library properly? I used to have this very same problem when I was just learning jquery. Try replacing this: with this: If you want to learn more about including libraries and file structures, I recommend this course on the command line. While not technically about javascript, it will help you understand file structures and how to navigate them.
has comment: http://stackoverflow.com/comment/44639327
answers question: http://stackoverflow.com/q/28133245
has comment: http://stackoverflow.com/comment/44639236
has comment: http://stackoverflow.com/comment/44639272
type: Answer

http://stackoverflow.com/comment/111203188
type: Comment
has text: @Aidin So how to ensure a deep copy?
comment on: http://stackoverflow.com/a/53442750
score: 0
type: AnswerComment

http://stackoverflow.com/a/28225297
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: I was able to use the this framework to get the desire solution that I wanted. https://github.com/davidjbradshaw/iframe-resizer My main file has this code: and my frame has this code. Which worked!
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28143841
answers question: http://stackoverflow.com/q/28143841

http://stackoverflow.com/q/28126419
type: AnsweredQuestion
has title: jQuery slideshow with random startpoint
type: Question
linked to: http://stackoverflow.com/q/2450954
tagged with: javascript
has answer: http://stackoverflow.com/a/28127085
accepted answer: http://stackoverflow.com/a/28127085
score: 0
tagged with: random
answer count: 1
tagged with: jquery
has body: I have my pictures in a list like this: And here is my script: $(function () { var duration = 6000; var speed = 700; var slideshow = $(".slideshow"); var pictures = slideshow.children('li'); var length = pictures.length; i = 0; j = 0; slidePicture = function () { pictures.eq(i).fadeOut(speed, function () { while(i == j) { i = Math.floor(Math.random() * length); } pictures.eq(i).fadeIn(speed); j = i; }); }; pictures.not(':first').hide(); setInterval(slidePicture, duration); }); Now this script always starts by showing the same image first. It cannot show the same image twice in a row, but it could show slide0.jpg, then slide1.jpg, then slide0.jpg again and so on. What I want is to Randomize the starting image so it's different every page load. When the page loads, create a random "playlist" of images (say first time loading the page the slideshow shows images 3, 1, 0, 5, 2, 4 in that order, next time it loads it's a different order). This is to ensure it doesn't accidently toggle between the same two images. I tried fixing the 2nd issue by randoming an array containing numbers 0-5 and then shuffling it but my javascript/jQuery skills are very poor and I'm not sure how to proceed. Any help is appreciated.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44797440
type: QuestionComment
has text: You can use the css `rotation` property and apply it conditionally with javascript
comment on: http://stackoverflow.com/q/28216920
score: 0
type: Comment

http://stackoverflow.com/q/28256021
answer count: 0
has comment: http://stackoverflow.com/comment/44876907
downvote count: 1
type: Question
score: 3
tagged with: javascript
upvote count: 4
has comment: http://stackoverflow.com/comment/45857154
favorite count: 0
has title: Cordova not running normally
type: UnansweredQuestion
has body: The problem is: I have index.html with this code: &lt;script type="text/javascript" src="../platforms/android/assets/www/cordova.js"&gt; When I run this file in a browser, there is alert: gap_init:2 Click "Ok" and I have second alert: [true] gap:[null,"App","overrideBackbutton","App1966010284"] In my console output I have: Endless loop processMessag failed: invalid message: " " Question: How I can fix this? Linux Ubuntu 14.04, cordova v. 4.2.0, phonegap v. 3.6.3-0.22.0 Thank you!
tagged with: phonegap-build
tagged with: cordova

http://stackoverflow.com/a/28142388
has comment: http://stackoverflow.com/comment/44656466
upvote count: 2
has body: You could use the following: var str = "woocommerce_click_and_pick_shipping_branch[14432]".match(/\[(\d*)\]/); if (str) { console.log(str[1]); // 14432 } Example Here
type: Answer
has comment: http://stackoverflow.com/comment/44656383
score: 2
has comment: http://stackoverflow.com/comment/44656397
answers question: http://stackoverflow.com/q/28142292
has comment: http://stackoverflow.com/comment/44656856
downvote count: 0
has comment: http://stackoverflow.com/comment/44656417

http://stackoverflow.com/a/28743926
answers question: http://stackoverflow.com/q/28172849
score: 0
type: Answer
has body: the exception you are receiving is not happening on the conversion, but you get a null pointer exception that I assume happens when you try to create the stream. var stream = new MemoryStream(byteArray); your variable is null, and then you try to draw a bitmap out of the SvgDocument which gets your stream that is null. You need to check why your MemoryStream is null/byteArray is invalid

http://stackoverflow.com/comment/44650818
type: Comment
comment on: http://stackoverflow.com/a/28139516
type: AnswerComment
has text: Ok. Did it - take a look into the plnkr, just added your proposal inside ModalInstanceCtrl in modal.js . But now the format doesn't look like the one I specified in the datepickers options. Any ideas on that?
score: 0

http://stackoverflow.com/comment/44770744
type: Comment
type: QuestionComment
score: 0
has text: @KevinB - And then, technically, it behaves like an array of chars
comment on: http://stackoverflow.com/q/28202249

http://stackoverflow.com/a/28225775
downvote count: 0
has body: Try this: echo '&lt;td&gt;&lt;input id="btnUpdate" type="submit" name="btnUpdate" value = "Update" onclick="updateButton("' . $row['CustomerID'] . '","' . $row['custEmail'] . '")" /&gt; &lt;/td&gt;';
upvote count: 3
answers question: http://stackoverflow.com/q/28225732
type: Answer
score: 3

http://stackoverflow.com/a/28129355
type: Answer
answers question: http://stackoverflow.com/q/28129274
has body: $('button').click(function() { $('.required').each(function(e) { e.preventDefault(); var form = $(e.currentTarget); //the form valueToEvaul = form.find('#valueToEval').val(); //the value to evaul if (valueToEvaul == '') { $(this).val("Please enter a value."); $(this).css("background", "#d42c43"); $(this).css("border-color", "#d42c43"); $(this).css("color", "#ffffff", "!important"); } else { return true; } }); }); Just remove the return false
has comment: http://stackoverflow.com/comment/44631699
score: 0

http://stackoverflow.com/comment/44807711
comment on: http://stackoverflow.com/q/28222276
type: Comment
type: QuestionComment
has text: It's similar to those in C#, if you happen to know about it.
score: 1

http://stackoverflow.com/comment/44763561
score: 0
type: QuestionComment
type: Comment
has text: Did you wait for the JS to finish as Alexei Levenkov mentioned?
comment on: http://stackoverflow.com/q/28198391

http://stackoverflow.com/a/28247155
upvote count: 1
has comment: http://stackoverflow.com/comment/44865209
type: Answer
has body: this is what I came up with. The HTML is a little bit limited due to the snippet, so you can modify it to attach to the body, document, or window and use the "scrollBy" method if you prefer. Remember to add the "resize" event so the scroll limit gets adjusted when the window resizes, otherwise you may run into problems. Hope this helps. var scrollInfo = { speed: 2, timeout: 15 }; function initScroll() { //attachScroll(document.getElementById("scrolling-content")); attachScroll(); } function attachScroll(el) { if (el && el.scrollHeight) { scrollInfo.element = el; scrollInfo.max = el.scrollHeight - el.clientHeight; } else { var h = window.innerHeight || document.documentElement.clientHeight; scrollInfo.element = window; scrollInfo.max = document.documentElement.offsetHeight - h; } } function doScroll() { if (scrollInfo.element) { if (scrollInfo.element.scrollTop !== undefined) { var st = scrollInfo.element.scrollTop - scrollInfo.speed; if (st > 0 && st < scrollInfo.max) { scrollInfo.element.scrollTop = st; } else { scrollInfo.speed *= -1; } } else if (scrollInfo.element.scrollBy) { var st; if (scrollInfo.element.pageYOffset !== undefined) { st = scrollInfo.element.pageYOffset; } else if (scrollInfo.element.scrollY !== undefined) { st = scrollInfo.element.scrollY; } else { st = document.documentElement.scrollTop; } st += scrollInfo.speed; if (st > 0 && st < scrollInfo.max) { scrollInfo.element.scrollBy(0, scrollInfo.speed); } else { scrollInfo.speed *= -1; } } } }; function stopScroll() { window.clearInterval(scrollInfo.interval); } window.addEventListener("load", initScroll, false); window.addEventListener("resize", initScroll, false); scrollInfo.interval = window.setInterval(doScroll, scrollInfo.timeout); Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Lorem ipsum dolor sit amet, consectetur adipiscing e…
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45043478
has comment: http://stackoverflow.com/comment/44859909
answers question: http://stackoverflow.com/q/28246578

http://stackoverflow.com/comment/79533012
comment on: http://stackoverflow.com/q/28137626
has text: Possible duplicate of [Real world example where event capturing is necessary / preferred?](https://stackoverflow.com/questions/24786769/real-world-example-where-event-capturing-is-necessary-preferred)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28213575
has comment: http://stackoverflow.com/comment/44790836
tagged with: mysql
linked to: http://stackoverflow.com/q/13840429
possible better answer: http://stackoverflow.com/a/28213733
type: Question
has answer: http://stackoverflow.com/a/28213733
has answer: http://stackoverflow.com/a/28214540
tagged with: javascript
has comment: http://stackoverflow.com/comment/44791862
has answer: http://stackoverflow.com/a/28737530
has title: Use JS to execute MySQL queries and the security issues it involves
upvote count: 4
tagged with: security
has body: I've been searching around the internet for a way to define a query in JavaScript, pass that query to PHP. Let PHP set up a MySQL connection, execute the query and return the results json encoded. However my concern is with the security of this method since users could tamper with the queries and do things you don't want them to do or request data you do not want them to see. Question In an application/plugin like this, what kind of security measures would you suggest to prevent users from requesting information I don't want them to? Edit The end result of my plugin will be something like var data = Querier({ table: "mytable", columns: {"column1", "column2", "column3"}, where: "column2='blablabla'", limit: "10" }); I'm going to let that function make an AJAX request and execute a query in PHP using the above data. I would like to know what security risks this throws up and how to prevent them.
has comment: http://stackoverflow.com/comment/44793771
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28726610
has comment: http://stackoverflow.com/comment/44790814
accepted answer: http://stackoverflow.com/a/28737530
tagged with: php
has comment: http://stackoverflow.com/comment/44790918
answer count: 4
has comment: http://stackoverflow.com/comment/44790865
type: AnsweredQuestion
score: 4

http://stackoverflow.com/comment/44619561
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28122839
has text: The only way would be `Ajax` or a form/link that would require a reload of the page.

http://stackoverflow.com/a/28218795
has body: Sails.js uses express. Which means any middleware for express will work, such as https://github.com/edwardhotchkiss/subdomain Here is the relivant documentation on the sails.js site. http://sailsjs.org/#/documentation/concepts/Middleware Example using the subdomain module config/http.js module.exports.http = { middleware: { removeSubDomain: require('subdomain')({base: 'yourdomain.com'}), // Now configure the order/arrangement of our HTTP middleware order: [ 'startRequestTimer', 'removeSubDomain', 'cookieParser', 'session', 'bodyParser', 'compress', 'methodOverride', 'poweredBy', '$custom', 'router', 'www', 'favicon', '404', '500' ] } }
answers question: http://stackoverflow.com/q/28202066
score: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28202066
type: Answer
upvote count: 4

http://stackoverflow.com/comment/44879042
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28260746
type: AnswerComment
has text: @Xotic750 you're right, forgot to test that case when the textarea is empty.

http://stackoverflow.com/comment/44764964
comment on: http://stackoverflow.com/q/28197121
type: Comment
has text: Yeah already had a look on that. See above. It's still not working. =( I try creating a jsfiddle for this.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44634101
score: 1
type: AnswerComment
has text: Yeah I saw the InnerSVG polyfill. But figured that had to be a simpler way, atleast for my tiny project. I just came up with my answer which fixes it for me.
type: Comment
comment on: http://stackoverflow.com/a/28130626

http://stackoverflow.com/q/28135676
tagged with: qml
has comment: http://stackoverflow.com/comment/44658608
has comment: http://stackoverflow.com/comment/44675273
tagged with: arrays
has title: Pushing & popping objects into an array using JS in Qt
tagged with: javascript
has comment: http://stackoverflow.com/comment/44672793
score: 0
has body: I'm trying to create dynamic objects in qml and save these objects into an array using the push() function inside of a JS file, here is my main.qml file: import "AidFile.js" as Jsfile var c = null c = Qt.createComponent("Lines.qml") k = c.createObject(gameCanvas) k.height = 1 k.width = grid.spacing k.x = image1.x - grid.spacing k.y = image1.y + image1.height / 2 Jsfile.enterKs(k) Jsfile.cons() &amp; here is the functions enterKs &amp; cons in AidFile.js file: var t = []; function enterKs(k) { t.push(k); } function cons(){ var i = t; var tester; for (var counter=0; counter&lt;=t.length; counter++){ tester = i.pop(); console.log(tester.x); console.log(tester.y); } } the thing is everytime i call the cons function only x &amp; y of the last object (k) is printed, which indicates that i array contains only one element (last one pushed), why is that happening although it should print the x &amp; y of all objects being pushed to the array using enterKs function. Any ideas would be appreciated.
has comment: http://stackoverflow.com/comment/44657605
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: qt

http://stackoverflow.com/a/28140455
has comment: http://stackoverflow.com/comment/44652718
score: 0
answers question: http://stackoverflow.com/q/28139841
type: Answer
has comment: http://stackoverflow.com/comment/44726643
has comment: http://stackoverflow.com/comment/44727021
has body: You can get change the rate as follows: var rate_string = $(str_rate).text(); var rate = parseInt(rate_string.substring(rate_string.indexOf("(") + 1,rate_string.indexOf(")")),10) + 1; $(str_rate).text("Rate! " + rate); But note I had a problem with your selector, and had to modify it to get the span area. Tom Here's all of the code changes I made: Rate! (62) With the following script $('input:radio').click(function (obj) { var str_rate = $(this).closest('div').find('span.rate'); var rate_string = $(str_rate).text(); var rate = parseInt(rate_string.substring(rate_string.indexOf("(") + 1,rate_string.indexOf(")")),10) + 1; $(str_rate).text("Rate! (" + rate + ")"); }); I don't think I changed the html, other than formatting.

http://stackoverflow.com/q/28146809
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28147237
tagged with: css
type: UnansweredQuestion
has body: So I have a little hobbyist-level background in Javascript, CSS, HTML, MySQL and PHP. I'm currently working on a website which features a list of business locations. I've set it up so that each location is listed on a page with it's own 'Contacts' link. The contact link activates JS which modifies the visible list of locations, making way for a list of locations-specific contacts at that organisation, off to one side. These contact lists all sit on display: none, in the background, and are selectively set to display: block, depending on the id of the calling link. Each contact list should also have an exit button, of sorts, to close the contact list for that location AND clicking on the Contacts link for any other location should update (replace) the displayed list of contacts appropriately. I think what I have should work, but I seem to be missing something. The problem is that the contacts will only display for the first location: Somerset. I would greatly appreciate any help in solving this issue :) Essential code: function hideAll() { var i, curr, ar = ["people_Somerset", "people_Latrobe", "people_Hobart", "people_Smithton", "people_Launceston"]; for (i = 0; i <= 4; i += 1) { curr = document.getElementById(ar[i]); if (curr.style.display === "block") { curr.style.display = "none"; } } } function hideTitle() { document.getElementById("staff_h3").style.visibility = "hidden"; } function showTitle() { document.getElementById("staff_h3").style.visibility = "visible"; } function makeWay() { //Modify CSS to make room for selected contact list var selection, i, j; // Narrow location list to 50% selection = document.getElementsByClassName("left_column"); j = selection.length; for (i = 0; i < j; i += 1) { selection[i].style.width = "50%"; } //Modify div.location selection = document.querySelectorAll("div.location"); j = selection.length; for (i = 0; i < j; i += 1) { selection[i].style.float = "none"; selection[i].style.width = "100%"; } //Change title width selection = doc…
has title: Selective display of divs via javascript
tagged with: hide
type: Question
answer count: 1
tagged with: javascript
tagged with: show
score: 0

http://stackoverflow.com/q/28244554
type: UnansweredQuestion
tagged with: php
has body: Im kinda new with the sockets stuff and Im trying to make a server on PHP to support websockets calls from my javascript currently my code looks like this &lt;?php class Websocket { private $server; private $sockets = []; public function create($host) { $this-&gt;server = stream_socket_server('tcp://localhost:8080', $errno, $errmsg); stream_set_blocking($this-&gt;server, 0); } public function run() { while(true) { $client = stream_socket_accept($this-&gt;server); if($client) { $data = stream_socket_recvfrom($client, 2048); if($data) { echo 'Client connected'.PHP_EOL; echo $data; $response = $this-&gt;handshake($data); stream_socket_sendto($client, $response); } } } } private function handshake($data) { $data = explode(PHP_EOL, $data); foreach($data as $header) { $current_header = explode(':', $header); if($current_header[0] == 'Sec-WebSocket-Key') { $accept = base64_encode(sha1(trim($current_header[1]).'258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true)); $response = 'HTTP/1.1 101 Switching Protocols'.PHP_EOL.'Upgrade: websocket'.PHP_EOL.'Connection: Upgrade'.PHP_EOL.'Sec-WebSocket-Accept:'.$accept.PHP_EOL.PHP_EOL; return $response; } } } } And my javascript is just a simple var socket = new WebSocket('ws://localhost:8080'); socket.onopen = function(event) { console.log('connected'); socket.send('hello'); } Currently the message connected appears on my chrome console but after that when the hello message is supposed to be sent I get this error "connection to: xxx was interrupted while the page was loading" So my question is after I have successfully send the handshake to the client how do I process messages? I know my code is always sending the handshake to new connections but on my server I will only see the first message beeing echoed (the http request) and not the "hello" one
score: 2
downvote count: 0
type: Question
upvote count: 2
tagged with: websocket
has title: PHP stream websockets
tagged with: javascript
has answer: http://stackoverflow.com/a/28244653
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/44864878
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28252990
has text: So, what's the issue exactly? You don't understand why `Object` is alerted?

http://stackoverflow.com/q/28204549
score: 1
favorite count: 0
tagged with: forms
type: Question
upvote count: 1
tagged with: .net
tagged with: javascript
tagged with: asp.net
has title: Validation of viewstate MAC failed due to form action
downvote count: 0
answer count: 0
type: UnansweredQuestion
has body: My question is, is there a different way besides form actions to post to other pages via the client side? I am sure the viewstate MAC error is happening because setting enableEventValidation="false" is no longer valid in web.config and I am using form actions. I have the form action attribute set in many pages and have previously posted to pages by changing this action attribute dynamically on the client side. When posting to another page via form actions, the viewstate will definitely be different. I cannot use the recommended PostBackUrl attribute because I want to set the action attribute dynamically on the client side. PostBackUrl renders when the page loads. I also do not want to use Server.Transfer because I want the URL to change. I am not using a web farm, and changing the validation key did not work either. This error is due to the form actions.
tagged with: c#

http://stackoverflow.com/q/28228005
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/44819302
has comment: http://stackoverflow.com/comment/44819461
tagged with: http://stackoverflow.com/tag/xml
has title: Google distance Matrix API value insert in Existing XML
answer count: 0
type: UnansweredQuestion
tagged with: php
type: Question
has body: Is it possible to insert the Google Distance Matrix API to my existing xml data? The xml data is produced by my PHP and I don't have an existing travel time included in my Database. I was thiniking if is it possible to upon parsing iteration of my xml data the computed travel time and distance of Google Distance Matrix API can be inserted? below is my AJAX call function searchNearMarkers(distance){ clearLocations(); document.getElementById('errorNotifs').innerHTML = ""; //document.getElementById('checkboxes').innerHTML = ''; var searchUrl = '...some url here...' downloadUrl(searchUrl, function(data){ var xml = parseXml(data); var markerNodes = xml.documentElement.getElementsByTagName("marker"); var bounds = new google.maps.LatLngBounds(); for (var i = 0; i &lt; markerNodes.length; i++){ var name = markerNodes[i].getAttribute("name"); var address = markerNodes[i].getAttribute("address"); var info = markerNodes[i].getAttribute("info"); var budget = markerNodes[i].getAttribute("budget"); var tts = markerNodes[i].getAttribute("tts"); var type = markerNodes[i].getAttribute("type"); var latlng = new google.maps.LatLng( parseFloat(markerNodes[i].getAttribute("lat")), parseFloat(markerNodes[i].getAttribute("lng"))); distMatLink[i]=(i,markerNodes[i].getAttribute("lat"),markerNodes[i].getAttribute("lng")); bounds.extend(latlng); if (i == (markerNodes.length - 1)){ bounds.extend(userPosLatLng); } } map.fitBounds(bounds); destinations = ""; for (var i = 0; i &lt; distMatLink.length ; i++){ destinations += distMatLink[i]; } var origin = posLat.toFixed(6)+','+posLng.toFixed(6); var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [origin], destinations: [destinations], travelMode: google.maps.TravelMode.WALKING, unitSystem: google.maps.UnitSystem.METRIC, avoidHighways: false, avoidTolls: false }, callback); function callback(response, status) { if (status == google.maps.DistanceMatrixStatus.OK) { var origins = response.originAddresses; var …

http://stackoverflow.com/comment/44717025
type: AnswerComment
comment on: http://stackoverflow.com/a/28173469
type: Comment
has text: please add the code to your answer. When your link will be broken no one can see what've you done
score: 1

http://stackoverflow.com/q/28240226
has body: I am building a web application to search for events using the backbone. In the home page, I have 10 images (that corresponds to the events) on right column and each of them have an id of event. In the left column have the markers that corresponds to the location of the images and each of the markers have an id of event too. I have a function that detects an event mouseover of the image, and when this event occurs the icon of the marker that corresponds to the image is changed. And when I do a mouseover of another image the icon before is changed again to the icon default. But my problem is when I do the mouseover the same image twice, the icon of the marker is not changed. Here's a gif to better understand the issue: the problem My code: ev.views.Home = Backbone.View.extend({ initialize: function(map, p, firstEntry){ var that = this; that.template = _.template(ev.templateLoader.get('home')); ev.router.on("route", function(route, params) { that.deleteMarkers(); }); that.map = map; that.firstEntry = firstEntry; that.p = p; // valor da pagina that.icons = []; that.render(that.map, that.p, that.firstEntry); }, local: function(map){ ... }, deleteMarkers: function(){ ... }, events: { 'click #search' : 'searchKey', 'click #maisFiltros' : 'maisFiltros', 'mouseover .back' : 'overImagem' }, overImagem: function(ev){ var target = $(ev.currentTarget); var id = $(target).data("id"); this.icons.push(id); var last = this.icons.length-2; if(typeof this.icons[last] !== 'undefined'){ if(this.icons[last] !== this.icons[last+1]){ for (var i = 0; i &lt; this.marcadores.markers.length; i++) { if(id == this.marcadores.markers[i].get('id')){ this.marcadores.markers[i].setIcon('http://maps.google.com/mapfiles/ms/icons/blue-dot.png'); } } if(this.icons.length !== 1){ this.marcadores.markers[last].setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png'); } } }else{ for (var i = 0; i &lt; this.marcadores.markers.length; i++) { if(id == this.marcadores.markers[i].get('id')){ this.marcad…
type: Question
has comment: http://stackoverflow.com/comment/44849937
tagged with: google-maps
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
score: 0
tagged with: backbone.js
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44861840
has title: Icon of marker does not change the second time on google maps

http://stackoverflow.com/q/28145217
has comment: http://stackoverflow.com/comment/44682069
tagged with: google-chrome-app
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/28183500
answer count: 1
downvote count: 1
has title: chrome.bluetooth.getDevices is not discovering a BLE device
tagged with: javascript
has answer: http://stackoverflow.com/a/28183500
tagged with: bluetooth
has body: Running the heart-rate-sensor example, I am unable to detect a BLE device (known-good heart-rate sensor evaluation kit) in the resulting callback after a chrome.bluetooth.getDevices call. Even If I attempt to periodically re-call getDevices every 5s: setInterval(chrome.bluetooth.getDevices, 5000, onDeviceSearchCompleted); and toy with the power on the ble device, I only see audio devices I previously connected to in my onDeviceSearchCompleted callback. The device is clearly advertising and discoverable as I can see it through this mac app.
has comment: http://stackoverflow.com/comment/44667191
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24880860
score: 1
tagged with: macos
favorite count: 0

http://stackoverflow.com/comment/44757560
type: QuestionComment
has text: @j08691 updated my answer. I know that cookies would work, maybe i'm missing something in my code.
score: 0
comment on: http://stackoverflow.com/q/28195282
type: Comment

http://stackoverflow.com/a/28167927
type: Answer
has comment: http://stackoverflow.com/comment/44705909
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44706453
accepted answer of: http://stackoverflow.com/q/28167869
has body: To start as hidden : swap 2 lines $("#somedata").removeClass("hidden"); $("#somedata").fadeToggle("slide"); To $("#somedata").fadeToggle("slide"); $("#somedata").removeClass("hidden");
has comment: http://stackoverflow.com/comment/44705661
has comment: http://stackoverflow.com/comment/44706142
downvote count: 0
answers question: http://stackoverflow.com/q/28167869
type: AcceptedAnswer

http://stackoverflow.com/comment/44654356
score: 0
type: Comment
has text: huh.. I just tried your answer and it doesn't work :(. I used the following script: http://bl.ocks.org/mbostock/3887051. data is an Array of Objects. So data[0][0] is undefined. Can you please clarify ?
type: AnswerComment
comment on: http://stackoverflow.com/a/28137229

chromium
tags question: http://stackoverflow.com/q/28190802
type: Tag
tag name: chromium
tags question: http://stackoverflow.com/q/28215017

http://stackoverflow.com/comment/45219521
comment on: http://stackoverflow.com/q/28236289
type: QuestionComment
type: Comment
has text: @nyuen, please see my update on top
score: 0

http://stackoverflow.com/comment/44642340
type: Comment
has text: Note that Google uses a "server-side selection script", I.e. they select the *.cache.js on the server side (based on User-Agent and Accept-Language headers) and don't use a *.nocache.js at all.
comment on: http://stackoverflow.com/a/28126183
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44915092
comment on: http://stackoverflow.com/q/28280022
type: Comment
type: QuestionComment
score: 0
has text: Hmmm...that is strange.

http://stackoverflow.com/q/28230147
type: Question
has body: I'm looking at using inheritance with jQuery UI widgets to help simplify some code I'm working on. However, I have the need to be able to operate on the base widget type, even though it was the inherited type that was initialised. So, for example, let's say that a widget bar inherited from a widget foo, and I initialised an object like so: $('.something').bar(); At times I'll need to be able to do this: $('.something').foo('someMethod'); I haven't been able to get something like this to work so far. Is there a way to do this?
tagged with: javascript
tagged with: jquery
tagged with: inheritance
has title: Polymorphism with jQuery UI Widgets
has answer: http://stackoverflow.com/a/35867382
has answer: http://stackoverflow.com/a/34354016
score: 0
answer count: 2
tagged with: user-interface
type: UnansweredQuestion
tagged with: widget

http://stackoverflow.com/comment/44906756
comment on: http://stackoverflow.com/a/28275554
has text: you mean replace the php script for search with json?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44768980
score: 0
type: Comment
type: QuestionComment
has text: Is there a reason you're using inline event handlers in the first place?
comment on: http://stackoverflow.com/q/28201351

http://stackoverflow.com/q/28204224
tagged with: node.js
type: AnsweredQuestion
has body: I want to execute the following 'query' on my node.js server: MongoDB: db.example.distinct('field') Expected result: [value1, value2, ..., etc] I tried this Javascript, but it doesn't work: db.get('example').distinct('field', function (err, array){...}); But I don't think monk has that method defined. Is there a way to do this?
upvote count: 3
tagged with: monk
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/28204511
tagged with: mongodb
downvote count: 0
answer count: 1
has title: Is there a way to call 'distinct' through monk?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28204511

http://stackoverflow.com/comment/44626240
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28126525
score: 1
has text: Yes, it's correct. FYI, the reason that your code does work on an older version, 1.1.1, and doesn't on the newer version because since AngularJS 1.2.x, it doesn't allow duplicate keys in repeaters anymore.

http://stackoverflow.com/a/28257793
type: Answer
has comment: http://stackoverflow.com/comment/44873795
has comment: http://stackoverflow.com/comment/44874428
accepted answer of: http://stackoverflow.com/q/28257674
has comment: http://stackoverflow.com/comment/44874154
has comment: http://stackoverflow.com/comment/44873684
score: 0
has comment: http://stackoverflow.com/comment/44873653
answers question: http://stackoverflow.com/q/28257674
type: AcceptedAnswer
has body: From your picture, I assume you want the parralax image to be right below the nav right?… which I think is fixed. Well, just do a margin-top: to the main-container, and it will put it right below the nav. Another way could be adding a new div class="top-fill" above main-container and make it the height of nav. Edit: Looks like I haven't answered all your question, but I haven't worked with that framework, neither too much with parralax, so I don't know how to fix the dissapearing issue.
has comment: http://stackoverflow.com/comment/44874391
has comment: http://stackoverflow.com/comment/44874237

http://stackoverflow.com/q/28135292
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44642689
type: UnansweredQuestion
tagged with: php
has body: I am developing a chrome extension to ajaxify every non ajax website like wikipedia. etc. It works fine but it fail to load the js files. So, I have written a script to load js files thats are required for the page by getting src attribute from tag. But the problem is when i am loading another page of that website every scripts are loaded again. So it is useless to make it with a purpose to reduce bandwidth. So, I want to know whether there is any way to match the script array of the new with its previous page. and to identify which scripts are new and load only them. var array1 = []; for (var i = 0; i &lt; jsn; i++) { var jssrc = document.getElementsByTagName("script")[i].src; array1.push(jssrc); } var array2 = [how to find out array script source of the new page] Array.prototype.diff = function(array2) { var ret = []; for(i in this) { if(array2.indexOf( this[i] ) &gt; -1){ ret.push( this[i] ); } } return ret; }; ajaxpagefetcher.load("ajax-script", "", true, array1.diff(array2);) How to find script src array of the new page that is to be loaded.. one more question, with out reloading the page if i delete the body tag through remove() function, are the scripts that already loaded also removed? Thanks I am waiting with eager for your replay....
has comment: http://stackoverflow.com/comment/44642717
type: Question
has answer: http://stackoverflow.com/a/28135402
has title: How to find if a javascript is already loaded or not?
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/44642635

http://stackoverflow.com/a/28254820
has comment: http://stackoverflow.com/comment/44868070
upvote count: 3
has comment: http://stackoverflow.com/comment/44868130
score: 3
has comment: http://stackoverflow.com/comment/44868228
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28254683
has comment: http://stackoverflow.com/comment/44868104
has body: app/themes/*/images/icons/*.png Code to try in Node console var g = require('glob'); g('app/themes/*/images/icons/*.png', function (er, files) { console.log(files); }); Should list the files that match
accepted answer of: http://stackoverflow.com/q/28254683
type: Answer

http://stackoverflow.com/comment/45833576
type: QuestionComment
comment on: http://stackoverflow.com/q/28183444
has text: Hi, @Fabio, are you referring to line 171. I tried but it didn't reach there. The above is print out from L149.
score: 0
type: Comment

http://stackoverflow.com/a/56095979
type: Answer
answers question: http://stackoverflow.com/q/28270333
has body: We're overthinking this. It's as simple as a standard button handler. The data-dismiss="modal" will make the dialog go away, and we'll still know that the button that we were interested in was clicked. $('#delete-file-modal').on('click','#delete-file-modal #confirm-delete-button', function (e) { e.preventDefault(); console.log('confirmed delete'); return false; });
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/28198491
has title: PHP generate POST form
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28198648
has body: I generate a form based on some data I get from a database. Here is my constructor: php_core.php <?php echo " "; //DISPLAY FUNCTION function display($x){ require("db_conx.php"); $sql = "SELECT * FROM polls WHERE id='$x' LIMIT 1"; $query = mysqli_query($db_conx, $sql); while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)){ $poll_id = $row['id']; $topic = $row['topic']; $startdate = $row['startdate']; $stopdate = $row['stopdate']; $active = $row['active']; $type = $row['type']; $title = $row['title']; $pwidth = $row['pwidth']; $borcolor = $row['borcolor']; $borwidth = $row['borwidth']; $fcolor = $row['fcolor']; $bfcol = $row['bfcol']; $bg = $row['bg']; $borrad = $row['borrad']; $abars = $row['abars']; $bcol = $row['bcol']; $brad = $row['brad']; } //DISPLAY THE POLL $aquery = "SELECT * FROM answers WHERE parent='$poll_id'"; $result = mysqli_query($db_conx, $aquery); echo ' '; echo ' '.$title.' '; echo ' '.$topic.' '; echo ' '; // SELECT ANSWERS if($type == 'single'){ while ($usersRow = mysqli_fetch_array($result, MYSQLI_ASSOC)){ echo ' '.$usersRow['content'].' '; } } else { $i = 0; while ($usersRow = mysqli_fetch_array($result, MYSQLI_ASSOC)){ echo ' '.$usersRow['content'].' '; $i++; } } //echo ' VOTE '; echo ' '; echo ' '; echo ' '; } // END OF THE DISPLAY FUNCTION ?> Here is how I display the form: <?php include("php_includes/php_core.php"); ?> Untitled Document <?php display('15'); ?> <?php if(isset($_POST['submit'])){ echo "Posted!"; ?> I don't know why, but it won't submit the values! The function outputs the form correctly, I've checked it by viewing the page source. I have no idea why it does not work, so I need your help. I've been modifying the script again and again, no result. An additional(optional) question about this script: Do you have any idea about how I can submit this form using AJAX without any additional HTML tags and refresh the function output without reloading the page? I found some ways, but I must wrap the function inside a div and I need to…
favorite count: 0
has answer: http://stackoverflow.com/a/28198640
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/28198648
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28198640
score: 1
tagged with: forms
type: Question
answer count: 2

http://stackoverflow.com/a/42257186
answers question: http://stackoverflow.com/q/28255284
accepted answer of: http://stackoverflow.com/q/28255284
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 14
score: 14
has body: You get that error from Chrome because, per the XHR specification, the setRequestHeader method should not set headers with a forbidden header name. Per the specification: These are forbidden so the user agent remains in full control over them. Instead, for Angular 1.x, set the cookie by using $cookies, and it will be included in subsequent xhr requests.

http://stackoverflow.com/comment/44791941
comment on: http://stackoverflow.com/q/28214143
type: Comment
type: QuestionComment
has text: but Dynamic_C is just for show purpose. I am not fetching anythng based on this parameter
score: 0

http://stackoverflow.com/comment/44637490
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28132125
has text: replace the `GET /users/me...` and the `GET /users/:id...` with one single handler that just does a check on what the param value is
type: Comment

http://stackoverflow.com/q/28160693
has answer: http://stackoverflow.com/a/28160947
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: css
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/28161192
upvote count: 2
type: UnansweredQuestion
has title: Using $index in angularjs ng-repeat to generate css classes
type: Question
has body: I am trying to generate css classes using $index in ng-repeat so I can have indidual control of each dom item. like so: do I need to use item_{$index}, item_{{$index}} Been trying many different ways and googled the question for a while but no answer I have also noticed that angular doesnt seem to like underscore(_) or dashes(-) in ng-class class names. Removing them allows the condition to work. Could this also be my problem in generating classes in ng-repeat? Thanks

http://stackoverflow.com/q/28213613
answer count: 2
downvote count: 3
has title: Want to disable refresh event of browser
has answer: http://stackoverflow.com/a/28213777
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44790845
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44791161
has answer: http://stackoverflow.com/a/28213688
accepted answer: http://stackoverflow.com/a/28213688
has body: I want to stop refresh the page in browser By using F5 key By using Rightclick mouse button By using Browser refresh button Above first I got it in javascript but I need to disable the browser refresh button. I got it answer of first option by code. function disableF5Btn(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); }; $(document).bind("keydown", disableF5Btn); But now i am not able to do the 2nd and 3rd option.
type: Question
has comment: http://stackoverflow.com/comment/44790827
has comment: http://stackoverflow.com/comment/44790955
tagged with: javascript
has comment: http://stackoverflow.com/comment/44790823
linked to: http://stackoverflow.com/q/1704533
score: -1
possible better answer: http://stackoverflow.com/a/28213777
upvote count: 2

http://stackoverflow.com/a/28258740
answers question: http://stackoverflow.com/q/28258688
has body: String concatenation in JavaScript is done using the + operator, not ;. document.getElementById("dateText").innerHTML = month + "/" + day + "/" + year;
score: 0
accepted answer of: http://stackoverflow.com/q/28258688
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44875469
type: Answer

http://stackoverflow.com/comment/44859973
comment on: http://stackoverflow.com/q/28250033
score: 1
has text: Your script is very vulnerable to attack. Dont use mysql, use mysqli and look up and use prepared statements. You are setting a post submit type in your form but then not using it. You need to go back to basics.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28221390
has comment: http://stackoverflow.com/comment/44806109
has answer: http://stackoverflow.com/a/28221446
answer count: 5
has comment: http://stackoverflow.com/comment/44806019
has body: for my own personal improvement, I was fiddling with closures and functions in JS, when I found this behaviour that deeply puzzles me. Take this function, assign it to a variable, and call it from two different HTML elements via jQuery: var print = function(){ console.log("Hello" ); }; document.getElementById('element1').onclick = print(); document.getElementById('element1').onclick = print; Why on earth is the second element, if clicked, to be the one that prints correctly "hello"? I always thought you need to put brackets after a function's name to call it. In fact, if I just call the function by itself (and not via a jQuery event) it works as expected: var print = function(){ console.log("Hello" ); }; print; //does nothing print() //prints "Hello" What I am missing here? Is something related to jQuery? Thanks in advance!
linked to: http://stackoverflow.com/q/7969088
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/44806226
possible better answer: http://stackoverflow.com/a/28221522
has comment: http://stackoverflow.com/comment/44805929
has answer: http://stackoverflow.com/a/28221522
has comment: http://stackoverflow.com/comment/44805960
type: Question
has answer: http://stackoverflow.com/a/28221577
accepted answer: http://stackoverflow.com/a/28221446
has comment: http://stackoverflow.com/comment/44806096
has comment: http://stackoverflow.com/comment/44806082
tagged with: javascript
has answer: http://stackoverflow.com/a/28221679
has answer: http://stackoverflow.com/a/28221669
has title: Call JS function with brackets
score: 2
tagged with: function
has comment: http://stackoverflow.com/comment/44806159
has comment: http://stackoverflow.com/comment/44805904
downvote count: 0
has comment: http://stackoverflow.com/comment/44806717
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/38594032
type: Answer
upvote count: 1
score: 1
has body: A bit late to the party, but as neliojrr mentioned you can correct this using javascript/jquery. However, I would be very tempted to make this much more generic: $('input[maxlength]').on('keydown', function(event) { var $this = $(this); if ($this.val().length &gt; parseInt($this.attr('maxlength'), 10)) { event.preventDefault(); } });
answers question: http://stackoverflow.com/q/28198466
downvote count: 0
has comment: http://stackoverflow.com/comment/108123478

http://stackoverflow.com/a/28127132
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44627601
has body: I would recommend using thead and tbody elements in your table. MDN link Then you only have to add data to the tbody, and clear the data in the tbody Id No. Name Address Information Budget Time to Spend Site Type
accepted answer of: http://stackoverflow.com/q/28127031
answers question: http://stackoverflow.com/q/28127031
has comment: http://stackoverflow.com/comment/44627724
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44896723
type: QuestionComment
comment on: http://stackoverflow.com/q/28270458
type: Comment
score: 7
has text: Why, just why? If you have to, ask for captcha at the beginning and then play the video. If you will ask every 30s, no one will watch the videos, ever. I know this isn't helpful, but I don't care, it had to be said.

http://stackoverflow.com/comment/44679476
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28153972
has text: Use absolute positioning: ` `

http://stackoverflow.com/q/28197718
has body: On an HTML5 canvas I can't find a method to make colored circles. I've been consulting this as a reference. Here is my current attempt var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillRect(20, 20, 100, 100); ctx.lineJoin = "round"; ctx.lineWidth = "cornerRadius"; &lt;canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"&gt; (Also on jsFiddle: http://jsfiddle.net/kvnm21r1/1/) I've tried using the canvas arc method, which creates a circle, but doesn't color it. I can't use the border-radius property, because ctx is not an element. Is there any way, I can transform my squares into circles? Thanks in advance.
has title: HTML5 Canvas - Changing a square into a circle
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/44762040
has answer: http://stackoverflow.com/a/28197872
has answer: http://stackoverflow.com/a/28197904
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28199280
has answer: http://stackoverflow.com/a/28199280
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
accepted answer: http://stackoverflow.com/a/28197904
upvote count: 2
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44761998

http://stackoverflow.com/q/28220456
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44804696
answer count: 0
has comment: http://stackoverflow.com/comment/44804156
has comment: http://stackoverflow.com/comment/44805395
type: Question
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/44804602
has title: Node Express 500 Error: Unknown encoding
has body: I am running an Express application on Nodejitsu. It's Node 0.8 and Express 3.4.0. The application works absolutely fine locally, but one of the routes has stopped working and returns the following error when I push to Nodejitsu: Express 500 Error: Unknown encoding at Buffer.toString (buffer.js:440:13) at Object.fs.readFileSync (fs.js:241:33) at handleCache (/opt/run/snapshot/package/node_modules/ejs/lib/ejs.js:65:21) at exports.renderFile (/opt/run/snapshot/package/node_modules/ejs/lib/ejs.js:206:14) at View.exports.__express [as engine] (/opt/run/snapshot/package/node_modules/ejs/lib/ejs.js:510:22) at View.render (/opt/run/snapshot/package/node_modules/express/lib/view.js:76:8) at Function.app.render (/opt/run/snapshot/package/node_modules/express/lib/application.js:504:10) at ServerResponse.res.render (/opt/run/snapshot/package/node_modules/express/lib/response.js:798:7) at exports.m2 (/opt/run/snapshot/package/routes/login.js:27:9) at callbacks (/opt/run/snapshot/package/node_modules/express/lib/router/index.js:164:37) I have nt changed anything about the route. I added a new route to the sme routing file which works, but should not affect this route). I haven't changes the view template in any way, or done anything I can think of to change the encoding. Given that Nodejitsu just takes my package.json and installs all the same modules, everything about the app should be identical. I'm not sure how to track down the issue since the Nodejitsu logs are identical to the output error and I can't reproduce locally. I tried commenting out the new route, and it had no effect.

http://stackoverflow.com/comment/44850008
type: Comment
comment on: http://stackoverflow.com/q/28244494
score: 0
type: QuestionComment
has text: Depends on server code. In Java servlet/ Filter You may set some default response for all client calls.. Every call would pass this.

http://stackoverflow.com/comment/44680734
type: Comment
has text: I really hate magento, somehow magento strips out the script when I add it. I add the text: test and below it the script, all I get in the source is test and no script... really really weird.. I think because of the ajax script the onepage checkout uses.
comment on: http://stackoverflow.com/a/28153355
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44655448
has text: How do you know what the server received, if you were just a visitor to the site? Or did you reproduce it on your own server? Because as glyuck said a control which is `disabled` (rather than `readonly`) should not be sent to the server at all, whether it's checked or not.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28141884

http://stackoverflow.com/comment/44621189
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28123687
has text: i can do that. but that isn't the only issue. as i stated, it is getting data from child as well. so for example if you have gift cardgo to home they would show up as one string when i do innerText on DIV. I am basically calling getElementByTagName(*) and calling innerText on all of them, excluding SCRIPT and NOSCRIPT

http://stackoverflow.com/a/28209620
has comment: http://stackoverflow.com/comment/44784292
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28209435
upvote count: 2
answers question: http://stackoverflow.com/q/28209435
has comment: http://stackoverflow.com/comment/44784231
score: 2
has body: Is this what you want? http://jsfiddle.net/fh6tg75s/2/ $(function () { $('.shopiteminfo_content_mobile_label').click(function () { $(this).next('.shopiteminfo_content_mobile_content').slideToggle(); $(this).parent().siblings().children().next().slideUp(); $(this).toggleClass("activetab"); $('.shopiteminfo_content_mobile_label').not(this).removeClass("activetab"); return false; }); $('.shopiteminfo_content_mobile_label').bind('touchstart', function (e) { $(this).trigger('click'); e.preventDefault(); }); });

http://stackoverflow.com/comment/44680730
has text: @Annisaini Did you look at the demo ?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28154507

http://stackoverflow.com/a/28131650
has comment: http://stackoverflow.com/comment/44642390
has comment: http://stackoverflow.com/comment/44637502
accepted answer of: http://stackoverflow.com/q/28131339
upvote count: 1
has body: Changes: OCE NA EUE EUW Track function Track_User(e){ e.preventDefault(); // XML request for check summoner name Summoner_Name = document.getElementById('Summoner_Name').value; Server_Name = document.getElementById('Server_Name').value; // Retrieves data about members in the group using ajax var xmlhttp = new XMLHttpRequest(); var url = "check_summoner_name.php?Summoner_Name=" + Summoner_Name + "&Server_Name=" + Server_Name; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { Update_Helpful_Output(xmlhttp.responseText); } else if (xmlhttp.readyState == 4 && xmlhttp.status == 404) { alert("Yeah I'm working, but I returned a 404.") } } xmlhttp.open("GET", url, true); xmlhttp.send(); } document.querySelector(".form-inline").querySelector(".btn").addEventListener("click", Track_User, false); OCE NA EUE EUW Track This will do it. No longer submitting via form, but using the track button to start the Ajax call. The problem lay in submitting the form. It just posted the form to nowhere without ever calling the ajax request. Now it does fire the ajax call.
answers question: http://stackoverflow.com/q/28131339
has comment: http://stackoverflow.com/comment/44642651
has comment: http://stackoverflow.com/comment/44664435
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44660937
type: Answer

http://stackoverflow.com/comment/44696515
score: 0
type: Comment
type: QuestionComment
has text: Why don't you just access the attribute on the scope via `scope.divid`?
comment on: http://stackoverflow.com/q/28162431

http://stackoverflow.com/comment/44630142
type: QuestionComment
comment on: http://stackoverflow.com/q/28128333
type: Comment
has text: @Core, post a sample of your **PHP** file.
score: 0

http://stackoverflow.com/comment/44893358
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28268609
has text: You need to get the `contentDocument` of the iFrame, and create the element in that scope, not with the `document` from the parent window.
type: Comment

http://stackoverflow.com/q/28163033
favorite count: 0
has answer: http://stackoverflow.com/a/28163109
type: AnsweredQuestion
has body: From MDN for NodeList: In some cases, the NodeList is a live collection, which means that changes in the DOM are reflected in the collection. For example, Node.childNodes is live: var parent = document.getElementById('parent'); var child_nodes = parent.childNodes; console.log(child_nodes.length); // let's assume "2" parent.appendChild(document.createElement('div')); console.log(child_nodes.length); // should output "3" In other cases, the NodeList is a static collection, meaning any subsequent change in the DOM does not affect the content of the collection. document.querySelectorAll returns a static NodeList. So .... kind of annoying! Is there any central reference for which methods return live lists and which ones return static lists, without having to check individually for all the various parts of the DOM API? Is there any rule at work here?
has comment: http://stackoverflow.com/comment/51703996
accepted answer: http://stackoverflow.com/a/28163742
has title: When is a NodeList live and when is it static?
tagged with: dom
type: Question
score: 86
tagged with: nodelist
upvote count: 86
tagged with: javascript
has answer: http://stackoverflow.com/a/28163742
possible better answer: http://stackoverflow.com/a/28163109
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/q/28240064
has answer: http://stackoverflow.com/a/35504140
has answer: http://stackoverflow.com/a/29794999
type: Question
has title: to get selected value from stars using jquery rateit plugin
tagged with: javascript
tagged with: jquery
tagged with: rating
score: 0
answer count: 3
has body: I am using rateit plugin of jQuery for star rating. here is the plugin http://rateit.codeplex.com/ My code: I need to get the rate value given in the star as an alert when i click the button. But for my code, it shows me null for all values. Suggest me some solutions.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/38672156

http://stackoverflow.com/q/28229512
has comment: http://stackoverflow.com/comment/44821878
type: Question
has answer: http://stackoverflow.com/a/28229855
score: 0
has comment: http://stackoverflow.com/comment/44822100
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have created the jquery dialog. It does not show the close(x) button in IE, but in FF it shows correctly. Please help me to solve this issue. Jquery Version: 1.11.1 Jquery UI version: 1.10.4 Code: Test Me. $( "#dialog" ).dialog({ width : 400, resizable : false, buttons: [ { text: "Yes", click: function() { $( this ).dialog( "close" ); } }, { text: "No", click: function() { $( this ).dialog( "close" ); } } ] });
has title: The close icon(X) is not visible for Jquery dialog box
has comment: http://stackoverflow.com/comment/44821932
has comment: http://stackoverflow.com/comment/44821949
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44821920

http://stackoverflow.com/a/40694366
answers question: http://stackoverflow.com/q/28270333
score: 2
downvote count: 0
upvote count: 2
has body: To extend @JoshCrozier's answer: It would be nice if they had a property like that associated with the hide.bs.modal/hidden.bs.modal events. As of writing this, there currently isn't This will emulate a similar behaviour, that attaches the clicked button as relatedTarget for later listeners: $( '.modal-footer .btn[data-dismiss="modal"]' ).on( 'click', function() { var target = this $( target ).closest( '.modal' ) .one( 'hide.bs.modal hidden.bs.modal', function( event ) { event.relatedTarget = target } ) } ) The selector and listener can be further optimized depending on how the modals are used in a project. For example: if you know you're not going to use hide.bs.modal you can just modify hidden.bs.modal's event instead.
has comment: http://stackoverflow.com/comment/121923859
type: Answer

http://stackoverflow.com/comment/44747444
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28188940
has text: Thanks that fixed it. Next issue is that my "real" texture is too big to be passed (256*256*256*4) so I guess I'll have to find some work around. Does it make sense to attach 256 textures of 256*256*4 to the shader? Thanks anyway

http://stackoverflow.com/comment/44688194
has text: @Mouser. yes, exactly
type: QuestionComment
comment on: http://stackoverflow.com/q/28158262
score: 0
type: Comment

http://stackoverflow.com/comment/44631927
type: QuestionComment
comment on: http://stackoverflow.com/q/28129486
has text: Just let your `hide` function take a parameter (the element), and don't make your `el` module-wide available. Just like you have done with `p_el` for `registerClick`.
score: 0
type: Comment

http://stackoverflow.com/a/28237698
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28237155
has body: $http already returns a promise, so using then() makes much more sense here because: you won't need to wait 1s every time you won't risk not getting the data if the requests takes longer than 1s Here's an example: var moviesController = app.controller('moviesController',function($scope, movieservice){ movieservice.getlist().then(function(res){ $scope.movies = res.data; }, function(err){ console.log('error:', err); }); }) }); There are some nice point about the actual differences between then and success here: Angular HttpPromise: difference between `success`/`error` methods and `then`&#39;s arguments. Also even after successful http request how can I make sure that it has key named 'status' in response set to true, if true then only resolve or reject. You'd have to modify your service to do that, similar to what you were doing in a controller: movieserviceObj.getlist=function(){ var defer=$q.defer(); $http({ url:'app/api/entertainment.php', data:$.param(dataString), method:'POST' }).then(function(res){ if (res.status === true) { defer.resolve(res); } else { defer.reject({error: 'Status not true'}); } }, function(err) { defer.reject(err); }) return defer.promise; } Info about route resolve: An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired.

http://stackoverflow.com/comment/44873322
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28257589
score: 0
has text: You're forgetting style property....instead of .width use .style.width

http://stackoverflow.com/q/28122291
has answer: http://stackoverflow.com/a/28122414
has comment: http://stackoverflow.com/comment/44776977
type: Question
has body: I am not seeing any stored data in the audience overview, but only real-time data. Furthermore, I am not getting any dimension hits, even though I set these values in Admin>Custom Definitions>Custom Dimensions. Is there something silly I am missing? Here's my code. I am running plugin_code (state) every time the history state changes. var ga = undefined function plugin_code (state) { if (typeof ga == "undefined") { window.GoogleAnalyticsObject = "ga" if (typeof window.ga == "undefined") { ga = window.ga = function () { window.ga.q = window.ga.q || [] window.ga.q.push (arguments) } window.ga.l = 1 * new Date () var ga_script_tag = document.createElement("script") var first_script_tag = document.getElementsByTagName("script")[0] ga_script_tag.async = 1 ga_script_tag.src = "//www.google-analytics.com/analytics.js" first_script_tag.parentNode.insertBefore (ga_script_tag, first_script_tag) } } ga('create', 'UA-xxxxxxxx-1', 'auto') state.gid = 1 // debug. if (state.gid) ga('set', 'dimension1', state.gid) if (state.a) ga('set', 'dimension2', state.a) ga('send', 'pageview', {'page': state.page, 'title': state.page}) }
tagged with: google-analytics
tagged with: javascript
score: 0
answer count: 1
tagged with: universal-analytics
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44786347
has title: I am only seeing real-time data in my Google Analytics (Universal Analytics) hits

http://stackoverflow.com/a/28186864
score: 2
accepted answer of: http://stackoverflow.com/q/28186664
upvote count: 2
has body: created jsfiddle example for the same:- http://jsfiddle.net/c2S5d/24/ added two inputs for fname and lname and fetched there values and set into the params.(As of now commented the code for ajax send) try above given link and enter some values into the text boxed and see the alert) code:- AJAX Request data
answers question: http://stackoverflow.com/q/28186664
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28191713
downvote count: 1
tagged with: javascript
type: UnansweredQuestion
upvote count: 0
has title: disable submit button on some text field value
tagged with: submit
has body: This is my html code for form Issue No: Issue Date: Item Code: Description: Bal Quantity: Issue Quantity: Remark: So I want to disable submit button if issue quantity is more than bal quantity and remain enable if issue quantity is less than bal quantity. And I am getting bal quantity on change of item code from ajax call. So how Do I do it??
tagged with: jquery
has answer: http://stackoverflow.com/a/28192212
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28191886
score: -1
answer count: 3
has answer: http://stackoverflow.com/a/28192059

http://stackoverflow.com/comment/44787194
type: AnswerComment
comment on: http://stackoverflow.com/a/28210169
has text: @Mr.Dung glad it helped. Do mark it as answer by clicking the tick mark
type: Comment
score: 0

http://stackoverflow.com/q/28263107
tagged with: javascript
has title: How do i go about fetching this musical file from mysql music table to js
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/45088812
has answer: http://stackoverflow.com/a/28263363
type: Question
has body: AM creating a musical playlist on a php website and i have this bellow code. How do i go about fetching this musical file from mysql music table to this js &lt;script type="text/javascript"&gt; var myPlaylist = [ { mp3:'mix/Masterkraft.mp3', oga: 'mix/Masterkraft.mp3', title:'Indomie(Remix)', artist:'Masterkraft', rating:4, duration:'0:30', cover:'mix/1.png' }, { mp3:'mix/Masterkraft.mp3', oga: 'mix/Masterkraft.mp3', title:'Indomie(Remix)', artist:'Masterkraft', rating:4, duration:'0:30', cover:'mix/1.png' } ]; &lt;/script&gt;
upvote count: 0
score: -2

http://stackoverflow.com/q/28141723
has answer: http://stackoverflow.com/a/28534706
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
has body: Ok, since Friday mid-evening EST from the comfort of my livingroom I have been investigating why certain websites seem to be unavailable and broken. I am a Verizon FIOS subscriber in Hudson Country NJ, for point of source reference. What I found is fascinating so far. I am neither a networking nor javascript expert, but perhaps I know enough to shoot my own foot off with a silly post here.... I noticed first: support.microsoft.com technet.microsoft.com instagram (? anecdotal from family...) tumblr.com .... many others Including hulu plus were failing and unable to be loaded, though other sites were working fine, mostly everything else was working fine. What I found is ... nslookups, all good, traceroutes (partially good), and curls without recursion definitely good. Checked Internet Pulse (and others): www.internetpulse.net - Fri-Now, big issue Sat morning with lots of errors on L3 peering, up to 14% packet loss Checked Digital Attack Map (and others): www.digitalattackmap.com - Typical, I guess, not an expert there but the attack volume over time didn't seem to indicate anything special Started Checking these sites with Chrome Dev View.... (where things got interesting): Main pages load, routes ok, recursion into imports/includes start Always fails on ajax.aspnetcdn.com includes for javascripts - Found first, ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js always fails, thought it was JQuery related. Then found that 1.7, and other .js's were failing Found connection reset was common with non https - Found curl: Unknown SSL protocol error in connection to ??? where applicable. Google referenced ajax works fine, so where I am going with this, is there a problem with anything that directly references, or indirectly: ajax.aspnetcdn.com/ajax/ But everything that either caches those scripts themselves or references: ajax.googleapis.com/ajax/ Is ok at the moment? Anyone able to confirm there is some nefarious issue with external references to the microsoft hosted scrip…
tagged with: network-programming
has title: All javascript from ajax.aspnetcdn.com/ajax/ broken? Breaking all external refs? Since Friday?
has answer: http://stackoverflow.com/a/34199327

http://stackoverflow.com/comment/44657979
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28143151
has text: it has more to do with the way jquery works, as I think

http://stackoverflow.com/comment/44763450
has text: I do, but I would like to see your code. You need `HtmlElement HtmlPage.Document.GetElementById()` to select the correct HTML element. Or other function that can be executed via `Document`.
comment on: http://stackoverflow.com/q/28198391
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/44724587
score: 0
type: Comment
has text: What we are looking for is called Hole Punching. This link might help you to understand and get this sorted : http://www.techytalk.info/hole-punching-with-magento-enterprise-edition-full-page-cache/ :)
comment on: http://stackoverflow.com/a/28176965
type: AnswerComment

http://stackoverflow.com/q/28261863
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/28265008
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44881414
has comment: http://stackoverflow.com/comment/44880929
type: UnansweredQuestion
has body: I have following code but it doesn't seems to be working since i am not getting any failure response on login. The Page just refreshes itself. I have jsp for login. It internally calls a javascript for validation and then transfers the data to another jsp page. Here are my files: Login.jsp Validate.jsp Login.jsp <%@ page language="java" %> <%@ page session="true" %> <%@ page import="java.sql.*,java.io.*,com.minglespot.MyFunctions"%> <%! String ErrCode="0",LoginCode="A";%> <% ErrCode = request.getParameter("ErrCode"); LoginCode = request.getParameter("LoginCode"); if(ErrCode!=null){ if(ErrCode.equals("1")){ %> <% } } %> Login Login User ID* Password* Register If you are not a registered user Register Now its free Validate.jsp: <%@ page language="java" %> <%@ page session="true" %> <%@ page import="java.sql.*,java.io.*,java.util.Random"%> <% java.sql.Connection con=null; java.sql.ResultSet rs=null,rs1=null; PreparedStatement stmt=null,stmt1=null; //Connection con=null; //ResultSet rs=null,rs1=null; //Statement stmt=null,stmt1=null; String UserID = request.getParameter("UserID"); String Password = request.getParameter("Password"); session.setAttribute("UserID",UserID); int flag=0; try{ Class.forName("com.mysql.jdbc.Driver"); System.out.println("Connecting to database..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/friendzavenue", "root", ""); System.out.println("con is:"+con); if(con != null) System.out.println("Connection Pool Database Connection Success"); //System.out.println("con is: "+ con); stmt = con.prepareStatement("select * from login where UserID = '"+UserID+"' and Password='"+Password+"'"); stmt1 = con.prepareStatement("Select * from basicdetails where UserID='"+UserID+"' and Password='"+Password+"'"); //String Query = "select * from login where UserID = '"+UserID+"' and Password='"+Password+"'"; //System.out.println(Query); rs = stmt.executeQuery(); System.out.println("stmt execution: "+rs); if(rs!=null){ //String Query1="Select * from…
has title: JSP-Javascript-JSP login flow not working
tagged with: java
has comment: http://stackoverflow.com/comment/44881892
type: Question

http://stackoverflow.com/q/28140379
has answer: http://stackoverflow.com/a/29401413
has answer: http://stackoverflow.com/a/28141854
score: 5
has body: trying to make this work.... I want to load nested data on two object model Ext.application({ name : 'MyApp', launch : function() { Ext.define('MyApp.model.Address', { extend: 'Ext.data.Model', entityName: 'Address', fields: [ { name: 'id', type: 'int' }, { name: 'addressLine', type: 'string' }, { name: 'city', type: 'string' }, { name: 'created', type: 'date', dateFormat: 'time', persist: false } ] }); Ext.define('MyApp.model.User', { extend: 'Ext.data.Model', entityName: 'User', fields: [ { name: 'id', type: 'int' }, { name: 'address', reference: 'Address' }, { name: 'name', type: 'string' }, { name: 'lastname', type: 'string' }, { name: 'created', type: 'date', dateFormat: 'time', persist: false } ] }); var user = new MyApp.model.User({ "id": 1, "name": "Pedro", "lastname": "Carbonell", "address": { "id": 1, "addressLine": "Bailen 22", "city": "Barcelona", "created": 1420668866000 }, "created": 1420668866000 }); console.info(user); console.info(user.getAddress()); }}); It's result on no error when created the user, but when I access to associated data via user.getAddress() it returned an exception: Uncaught Error: The model ID configured in data ("[object Object]") has been rejected by the int field converter for the id fieldext-all-debug.js Try to define proxy like memory or localstorage on model definitions, but the result it is the same. Ext fiddle: https://fiddle.sencha.com/#fiddle/h2d Any help will be appreciated!
accepted answer: http://stackoverflow.com/a/28157567
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28141854
favorite count: 0
tagged with: extjs
upvote count: 5
has answer: http://stackoverflow.com/a/28157567
tagged with: extjs5
answer count: 4
has answer: http://stackoverflow.com/a/28176673
has title: Extjs 5, data model association & load nested data
type: AnsweredQuestion
downvote count: 0
type: Question

http://stackoverflow.com/comment/44882837
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28136912
has text: Thank you so much, i'll look into doing that. :)

http://stackoverflow.com/a/28184582
answers question: http://stackoverflow.com/q/28184521
has body: On scroll event check whether target element offset top and document scroll top is same, if same then trigger function $(document).scroll(function(){ if($('.myTargetElement').offset().top == $(document).scrollTop()){ //Trigger function } });
score: 0
type: Answer

http://stackoverflow.com/comment/44689558
has text: maybe it because upgrade hapi version to 8.1.0?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28149025

http://stackoverflow.com/a/28181231
answers question: http://stackoverflow.com/q/28181175
upvote count: 3
downvote count: 1
has body: You can access its parent form like this data: $(this).closest(".confirm_appointment").serialize(), or something like this data: $this.parent().parent().serialize(),
has comment: http://stackoverflow.com/comment/44732685
has comment: http://stackoverflow.com/comment/44731905
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44732078
has comment: http://stackoverflow.com/comment/44731760

http://stackoverflow.com/q/28197453
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: Question
upvote count: 2
tagged with: twitter-bootstrap
answer count: 3
tagged with: css
accepted answer: http://stackoverflow.com/a/28197533
has answer: http://stackoverflow.com/a/28197662
possible better answer: http://stackoverflow.com/a/28197524
has answer: http://stackoverflow.com/a/28197524
has body: Can I center the content of div with center-block?? The following example does not work: &lt;div class="form-group"&gt; &lt;div class="center-block"&gt; &lt;input id="user_registrate" type="submit" value="Registrate" class="btn btn-success" /&gt; &lt;/div&gt; &lt;/div&gt; http://jsfiddle.net/jd93fL1x/2/ And this one works: &lt;div class="form-group"&gt; &lt;div&gt; &lt;input id="user_registrate" type="submit" value="Registrate" class="btn btn-success center-block" /&gt; &lt;/div&gt; &lt;/div&gt; http://jsfiddle.net/jd93fL1x/3/ I want two buttons centered, that is why I want the div with the center-block.
downvote count: 0
tagged with: javascript
has title: Center div content with Bootstrap (center-block)
has answer: http://stackoverflow.com/a/28197533

http://stackoverflow.com/comment/44852723
comment on: http://stackoverflow.com/q/28245752
score: 0
type: Comment
type: QuestionComment
has text: This is the exact file I was working with: https://raw.githubusercontent.com/honza/bibles/master/ESV/ESV.json

http://stackoverflow.com/a/28268225
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28268176
has comment: http://stackoverflow.com/comment/44892517
has comment: http://stackoverflow.com/comment/44892618
type: Answer
answers question: http://stackoverflow.com/q/28268176
upvote count: 3
has body: You're loading your script in the HTML head, and none of the DOM elements exist at that time, causing the addEventListener method to be called on undefined, which throws an error. Two solutions: either wrap the code in the window onload listener or simply load the script at the end of the HTML body
has comment: http://stackoverflow.com/comment/44892762
has comment: http://stackoverflow.com/comment/44892500
score: 3
has comment: http://stackoverflow.com/comment/44892574
has comment: http://stackoverflow.com/comment/44892510

http://stackoverflow.com/comment/44687248
type: Comment
type: QuestionComment
score: 2
has text: That's basically how this works. I haven't looked at the links, but to ensure interoperability, you have to make sure that matching character encoding, key sizes, padding algorithms, cipher modes and additional data like IV. RSA can be combined with AES which is called hybrid encryption (don't forget padding).
comment on: http://stackoverflow.com/q/28157827

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/28129649

http://stackoverflow.com/a/28161111
has body: The problem is that you're not returning anything in the event that the node is found. You can simplify your function by writing it like this: var findParent = function(data, childName) { for (var key in data) { if (key === childName || findParent(data[key], childName)) { return key; } } };
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28160993
answers question: http://stackoverflow.com/q/28160993

http://stackoverflow.com/q/28199272
type: Question
has body: I am new to spring rest and am having problem to map JSON object from jquery to controller. My jquery JSON object have some field absent which are present in java object on controller. Do I have to create new class to map such object or is there any way to map these objects without creating new class? Here are the code Controller: @RequestMapping(value = "/createTest", method = RequestMethod.POST,consumes="application/json") @ResponseBody public String createTest(@RequestBody TestJsonDTO testJson) throws JsonProcessingException, IOException { //.... TestJsonDTO: public class TestJsonDTO { private TestSet testSet; private List&lt;MainQuestion&gt; questionsInTest; //gettters and setters TestSet: public class TestSet implements Serializable { public TestSet() { } @Id @GeneratedValue private int id; private String name; private int fullmark; private int passmark; String duration; Date createDate = new Date(); Date testDate; boolean isNegativeMarking; boolean negativeMarkingValue; MainQuestion: public class MainQuestion implements Serializable { private static final long serialVersionUID = 1L; public MainQuestion() { } @Id @GeneratedValue private int id; private String name; and my jquery post method function createTest() { $.ajax({ type : 'POST', url : "http://localhost:8085/annotationBased/admin/createTest", dataType : "json", contentType : "application/json", data : testToJSON(), success : function() { alert("success") }, error : function(msg) { alert("error while saving test"); } }); } function testToJSON() { listOfQuestionForTest = questionToAdd;//array of ids of questions return JSON.stringify({ "testSet.name" : $('#testname').val(), "testSet.fullmark" : parseInt($('#fullmark').val()), "testSet.passmark" : parseInt($('#passmark').val()), "questionsInTest" : listOfQuestionForTest // "testDate":$('#testDate').value() }) } In JSON.stringify I am not sending all the fields in TestJsonDto. How can I map this?
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28200607
upvote count: 4
has comment: http://stackoverflow.com/comment/44766346
linked to: http://stackoverflow.com/q/5908466
downvote count: 0
answer count: 1
has title: Do we have to have to post json object with exactly same fields as in pojo object in controller?
tagged with: jquery
has comment: http://stackoverflow.com/comment/44765947
linked to: http://stackoverflow.com/q/28271304
favorite count: 0
tagged with: spring
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28200607
tagged with: java
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/28247319
has comment: http://stackoverflow.com/comment/119603709
upvote count: 13
has comment: http://stackoverflow.com/comment/88676372
score: 13
has body: Try using RegEx: var format = function(input) { var pattern = /(\d{4})\-(\d{2})\-(\d{2})/; if (!input || !input.match(pattern)) { return null; } return input.replace(pattern, '$2/$3/$1'); }; console.log(format('2015-01-25')); console.log(format('2000-12-01')); console.log(format('')); console.log(format(null)); Using String#split and Array#join, push &amp; shift: var format = function(input) { var array = (input || '').toString().split(/\-/g); array.push(array.shift()); return array.join('/') || null; }; console.log(format('2015-01-25')); console.log(format('2000-12-01')); console.log(format('')); console.log(format(null));
answers question: http://stackoverflow.com/q/28246788
downvote count: 0
type: Answer

http://stackoverflow.com/q/28166188
tagged with: jshint
has answer: http://stackoverflow.com/a/28166213
has body: My problem is similar to JSHint won't let me use 'forEach' in a 'for' loop We have about 2k JS lines in currently project, recently included jshint checking, one common issue is the below sample code would throw Don't make functions within a loop. sample code: var s1 = '12345'.split(''); var oo = { a: s1, b: s1, c: s1}; function odd(obj){ var tmp = []; for (var key in obj){ obj[key].forEach( function(val){ if(val%2>0) tmp.push(val); }); } return tmp; } odd(oo); my fix was: function odd(obj){ var tmp = [], tmpFn; tmpFn = function(val){ if(val%2>0) tmp.push(val); }; for (var key in obj){ obj[key].forEach(tmpFn); } return tmp; } I have checked, this works, but I am unsure if this is the right way to fix old code, would there be any unwanted side effects from this fix? or should I just ignore the warning, as the old code looks much cleaner? EDIT : I missed a for loop, updated sample code with it.
has comment: http://stackoverflow.com/comment/44702793
has comment: http://stackoverflow.com/comment/44702716
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44703490
tagged with: javascript
has comment: http://stackoverflow.com/comment/44703047
favorite count: 0
has comment: http://stackoverflow.com/comment/44702746
has comment: http://stackoverflow.com/comment/44702982
accepted answer: http://stackoverflow.com/a/28166213
has title: Jshint: Anonmyous function within a loop (Issue)
has comment: http://stackoverflow.com/comment/44703044
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10451865
has comment: http://stackoverflow.com/comment/44702812
upvote count: 1
has comment: http://stackoverflow.com/comment/44702817
type: Question
score: 1
has comment: http://stackoverflow.com/comment/44703100

http://stackoverflow.com/a/28212215
type: Answer
has comment: http://stackoverflow.com/comment/44826862
has comment: http://stackoverflow.com/comment/44790190
downvote count: 0
has body: Having to deal with IE 5, you poor soul. A quick answer to your question Is [\W\w] really the best way to match absolutely everything? Yes, JavaScript does not support the s modifier to make . match newlines. Doing [\W\w] basically tells the regex: "Match anything that is a word character, or anything that isn't a word character", you can see that absolutely every character falls in either of those categories. But, if you want a more reliable solution to deal with &lt;!-- html comments --&gt; and multiple forms on a page, best approach is something like explained in this SO answer but changed for HTML. This is what I would use: &lt;!--(?:(?!--&gt;)[\w\W])*--&gt;|(&lt;form(?:(?:(?!&lt;\/form&gt;|&lt;!--)[\w\W])|(?:&lt;!--(?:(?!--&gt;)[\w\W])*--&gt;))*&lt;/form&gt;) Look at the Debuggex Demo to see what matches you actually get. In JavaScript you can then expect the first capture group. If it's empty then that was just to get rid of the commented form like explained here.
score: 1
accepted answer of: http://stackoverflow.com/q/28209989
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44807791
answers question: http://stackoverflow.com/q/28209989

http://stackoverflow.com/q/28156794
tagged with: javascript
has answer: http://stackoverflow.com/a/28156837
answer count: 3
has answer: http://stackoverflow.com/a/28156997
has comment: http://stackoverflow.com/comment/44684955
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28156837
tagged with: ajax
has answer: http://stackoverflow.com/a/28157029
has title: Basic jquery deferred usage with ajax
has comment: http://stackoverflow.com/comment/44684902
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28157029
score: 0
has body: I am trying to rewrite code from How to capture asynchronous ajax response into a variable? to use jquery deferred functions. I started with : var html =""; $.ajax({ type:"POST", url: "Ajax/getHtml", data: { u : contents }, dataType: 'html', success: function(data) { html = data; }, error: function(jqXHR, textStatus, errorThrown) { console.log('error'); console.log(jqXHR,textStatus, errorThrown); } }); console.log('html', html); I am trying to turn this into a deferred function which can be resolved when the requested html page is returned. I have been reading http://learn.jquery.com/code-organization/deferreds/examples/ and http://jqfundamentals.com/chapter/ajax-deferreds to do this. So far I've come up with : var html_response = new $.Deferred(url){ $.ajax({ type:"POST", url: "Ajax/getHtml", data: { u : url}, dataType: 'html', success: html_response.resolve, error: html_response.reject }); }; This would be used as part of : html_response().done{ console.log('html', html); } What I am trying to do is when the get_html function returns html sucessfully (i.e get_html is resolved )grab the html and send it to the console. I'm having trouble figuring out how to put the pieces together here. Could someone advise me please.
linked to: http://stackoverflow.com/q/28137780
type: Question

http://stackoverflow.com/q/28237271
has body: I trigger a function using require() in my app.js file and the result returned is 'undefined'. I think this is due to the function being nested. What is the best way to return the nested value. I have tried the method below but the function appears to be asynchronous and the returned value is returned as undefined before the data is provided. app sample code -- app.get("/twitter/:handle", function (req, res) { var handle = req.params.handle; var twitter = require('./module/twitter'); var data = twitter.searchHandle(handle); console.log(data); res.sendStatus(data); }); module sample code - var twitter = { searchHandle: function(handle){ var dataToReturn; T.get('search/tweets', { q: handle, count: 100 }, function(err, data, response) { dataToReturn = data; }); return(dataToReturn); } }; module.exports = twitter;
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/23667086
answer count: 1
tagged with: nested
duplicate of: http://stackoverflow.com/q/23667086
tagged with: promise
has comment: http://stackoverflow.com/comment/44837799
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/28237359
has title: Return a nested function from inside a node module
type: Question

jstree
tags question: http://stackoverflow.com/q/28136426
tags question: http://stackoverflow.com/q/28167227
tags question: http://stackoverflow.com/q/28188417
tags question: http://stackoverflow.com/q/28215832
tags question: http://stackoverflow.com/q/28242418
type: Tag
tag name: jstree

http://stackoverflow.com/comment/44843891
score: 0
type: Comment
type: QuestionComment
has text: @MattBall Fixed my comment phrasing. The question is phrased differently, but is the same issue. Not quite sure if it's a dupe or not, right on the edge.
comment on: http://stackoverflow.com/q/28241338

http://stackoverflow.com/comment/44892490
type: Comment
comment on: http://stackoverflow.com/q/28264516
type: QuestionComment
has text: Are you getting a 'map is undefined' error in your browser? I think that your code in 'document ready' is being executed before that in 'window load' (which is where map is defined).
score: 0

http://stackoverflow.com/a/28147165
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28147010
has body: What you need to do is of course to add some css styling to the currently selected HTML-element, by telling the javascript what css class name you should add to the HTML-element. Create a css document and include a class into it like this: .test{ font-weight: bold; } Then reference to the css in the HTML of course like this: &lt;link rel="stylesheet" type="text/css" href="super.css"&gt; And in the end, tell the javascript what class to add to the html-element: $(document).ready(function() { $('ul#navigateTest li').keynavigator({activeClass: "test"}); });

http://stackoverflow.com/comment/44694431
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28161590
has text: Are there any errors in the console? If you print out `json.airport.name` using `console.log`, what shows up?
score: 0

http://stackoverflow.com/a/28269701
has comment: http://stackoverflow.com/comment/44918759
has comment: http://stackoverflow.com/comment/44914127
accepted answer of: http://stackoverflow.com/q/28269688
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28269688
has comment: http://stackoverflow.com/comment/44914183
has comment: http://stackoverflow.com/comment/44928032
downvote count: 0
has comment: http://stackoverflow.com/comment/44959621
has body: My issue is that I cannot access an object defined on the page controller from within the Sliding Panel Step, which has isolate scope. That precisely is the purpose of isolate scopes. You can pass in to the directive whatever you want using an attribute and setting the binding. So instead of trying to pass in the full scope, create an option object (with all the relevant data) and pass it in, like you're already doing in a few places.
score: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28215970
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28210033
has body: Alternatively to what Second Rikudo wrote, you can maintain a fork of CKEditor. If the changes that you're planning to do are not too deep you should not have any troubles with merging changes in the CKEditor code base back to your fork. The image plugin for instance is very stable right now and there were only few small changes made last year. Many developers maintain their forks of CKEditor and if you're not planning to rewrite entire plugin I recommend this way. However, if you're planning to make deep changes in the image plugin, the better way will be to create new plugin based on the original image plugin. This way you'll be able to get updates for the core of CKEditor and other plugins without any conflicts with your changes.
downvote count: 0
type: Answer

http://stackoverflow.com/q/28207913
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44780954
upvote count: 1
accepted answer: http://stackoverflow.com/a/28208279
has answer: http://stackoverflow.com/a/28208151
type: Question
has answer: http://stackoverflow.com/a/28208249
has comment: http://stackoverflow.com/comment/44781042
tagged with: javascript
answer count: 6
has body: i want to get value from select box and put that value to text box. and i tried with jquery but this is doesn't work. Here's my code : AA BB AA BB my jquery : $("[name=a]").change(function(){ var d = $(this).val(); console.log(d); $("[name=val]").val(d); }); i want to put value form select box and put that value to each textbox..
has title: how to get value in select box with array
downvote count: 0
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/44781126
has comment: http://stackoverflow.com/comment/44780915
possible better answer: http://stackoverflow.com/a/28208007
favorite count: 0
has answer: http://stackoverflow.com/a/28208279
has answer: http://stackoverflow.com/a/28208007
has answer: http://stackoverflow.com/a/28208178
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28208225

http://stackoverflow.com/q/28143317
type: Question
tagged with: ascii
has answer: http://stackoverflow.com/a/28143456
answer count: 3
has comment: http://stackoverflow.com/comment/44658341
possible better answer: http://stackoverflow.com/a/28143446
tagged with: validation
downvote count: 0
has comment: http://stackoverflow.com/comment/44658509
accepted answer: http://stackoverflow.com/a/28143456
favorite count: 0
has comment: http://stackoverflow.com/comment/44658487
score: 2
has comment: http://stackoverflow.com/comment/44658499
upvote count: 2
tagged with: fromcharcode
has body: I know the JavaScript that restricts entering some special characters or number, etc using charcode and ascii value. Is there anyway that I can block people entering any other language (I mean alphabet) expect English? More specifically how can I block people entering Chinese or some other non English alphabet name in the textbox and make them strictly enter only English alphabet name? Thanks
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28143398
has title: Block typing in any other alphabet than english
has answer: http://stackoverflow.com/a/28143446
tagged with: javascript
has comment: http://stackoverflow.com/comment/44658447
has comment: http://stackoverflow.com/comment/44658471

http://stackoverflow.com/a/28181511
score: 2
has body: I work for Temboo. The best place to start with Foursquare OAuth is by watching the short screencast below that explains everything you need to know about how Temboo simplifies OAuth. The video discusses working with the Fitbit API, but once you know how that one works you'll be able to use the Foursquare API in exactly the same manner. http://www.temboo.com/videos#oauthchoreos Setup instructions for the Foursquare OAuth Choreos can also be found here: https://temboo.com/library/Library/Foursquare/OAuth/ Hopefully this helps, but feel free to contact us via email (support AT temboo.com) if you have further questions - we're always happy to help.
has comment: http://stackoverflow.com/comment/44805679
has comment: http://stackoverflow.com/comment/44798836
has comment: http://stackoverflow.com/comment/44794671
has comment: http://stackoverflow.com/comment/57497701
has comment: http://stackoverflow.com/comment/57500969
has comment: http://stackoverflow.com/comment/44799234
downvote count: 0
has comment: http://stackoverflow.com/comment/44805775
has comment: http://stackoverflow.com/comment/44794581
has comment: http://stackoverflow.com/comment/57449302
has comment: http://stackoverflow.com/comment/57448190
upvote count: 2
answers question: http://stackoverflow.com/q/28178312
type: Answer

http://stackoverflow.com/a/28183639
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28182011
upvote count: 1
has body: This problem is solved. My office is under a proxy, so in FF - options- Advanced - Network - Connection - Settings, changes the settings to " Auto-detect", and the external package will be loaded properly. Thank you.
answers question: http://stackoverflow.com/q/28182011
downvote count: 1
score: 0

http://stackoverflow.com/q/28132044
tagged with: javascript
has answer: http://stackoverflow.com/a/28133140
has title: Javascript | Run function if HTML5 players is going to be used, don't run if Flash Player is avaiable
tagged with: http://stackoverflow.com/tag/html
score: 0
has body: I am trying to run a JS function only if HTML5 player is going to be used (I am using JWPlayer), I have been reading and I don't find a Javascript event that tell me when this is happening. I want this function to run if HTML5 player is going to be used (If user is on an Ipad/Android/etc), if it's on Desktop I want to ignore this function. Thanks
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44636734
type: Question
answer count: 1

http://stackoverflow.com/comment/87164305
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28237142
has text: I m failing to implant this.... can anyone give some fiddle. or example
type: AnswerComment

http://stackoverflow.com/q/28195447
tagged with: file
type: Question
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/131680925
has body: I'm currently building a little experiment. It's about having some sort of "emulator" written in C# that can run some "ROMs" that are programmed in HTML ( CSS, JS, .. ). To build there ROMs, I've programmed a little "compiler" that is using my JS based game engine and it's editor to pack the game / application into a single file ( the "ROM" ) that is basically just an encrypted ( or plain ) JSON file that contains the full HTML code ( in one of its attributes ), except that linked files are directly written into it. &lt;script src="./script/main.js"&gt;&lt;/script&gt; will turn into: &lt;script&gt; ...code... &lt;/script&gt; and the same with CSS. Images will be turned into Base64 String &lt;img src="http://www.img.com/img.png"/&gt; becomes &lt;img src="data:image/png;base64, R0lGODlhmwD....."/&gt; My problem is, to include font files into the CSS or HTML file. So maybe something like this @font-face { font-family: 'Open Sans'; src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v10/K88pR3goAWT7BTt32Z01m1tXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); } becomes @font-face { font-family: 'Open Sans'; src: local('Open Sans'), local('OpenSans'), url( ...magic... ) format('woff2'); } Does anybody know if this is possible, and if so, how I can implement that functionality ? Thank you for your suggestions.
has comment: http://stackoverflow.com/comment/44757679
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28195518
favorite count: 0
has answer: http://stackoverflow.com/a/28195518
has comment: http://stackoverflow.com/comment/44757633
tagged with: css
has title: Merge HTML, CSS, JS and Assets to one file
has comment: http://stackoverflow.com/comment/123935449
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44758084

http://stackoverflow.com/a/28263372
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28263242
accepted answer of: http://stackoverflow.com/q/28263242
score: 1
upvote count: 1
has body: Is there a rigorous definition of an “instance” of a constructor function? No. You could use the definition of instanceof, that is an object needs to inherit from the respective prototype object. But in the OOP sense, it usually is also implied that the object was constructed by a call to the constructor; or at least somehow implements the interface (same properties) as it would be set up in the constructor. Finally, what is the difference between f1 and f2 such that Chrome can distinguish between them when printing them to the console? That's something internal to Chrome, only for pretty-printing in the console (well, and maybe V8 does some other optimisations based on such a label). The two objects are indistinguishable from the JavaScript viewpoint.

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/28159595
type: Tag

http://stackoverflow.com/a/28240384
accepted answer of: http://stackoverflow.com/q/28240383
answers question: http://stackoverflow.com/q/28240383
has body: The solution was to instruct Grunt to wait as per the documentation by telling Grunt this is an asynchronous method and using a callback to indicate when we are done. grunt.registerTask('serveProxy', 'Start the proxy to the various servers', function() { var done = this.async(); var server = http.createServer(function(req, res) { // ... }); server.listen(80); });
downvote count: 0
upvote count: 3
type: AcceptedAnswer
type: Answer
score: 3

http://stackoverflow.com/q/28252362
has comment: http://stackoverflow.com/comment/44864003
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/15240221
has answer: http://stackoverflow.com/a/28252663
has body: Is there a difference in chaining functions (e.g. $('#id').function1().function2();) and using functions as a callback-function (e.g. $('#id').function1(function2());)? For example the following code does (to me) exactly the same thing when either clicking on div#nr1 or div#nr2, only that using the callback-function is much more verbose: PageTitle A B When is it recommended to use one or the other method?
has answer: http://stackoverflow.com/a/28252503
linked to: http://stackoverflow.com/q/9314235
type: Question
has comment: http://stackoverflow.com/comment/44863734
tagged with: javascript
has title: Is there a difference in chaining functions and using callback functions in jQuery?
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/comment/44944543
type: Comment
has text: I'm quite sure that the first method is more suitable for me. Thanks!
comment on: http://stackoverflow.com/a/28280448
score: 0
type: AnswerComment

http://stackoverflow.com/comment/79802734
has text: Adding `return false` to the end is useful if you're using jQuery UI's Autocomplete on the new HTML5 input number type and you just want the ID but still want to keep the text label for the autocomplete.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28232585
type: Comment

http://stackoverflow.com/comment/44722501
score: 0
comment on: http://stackoverflow.com/q/28176548
type: Comment
has text: Do you need to use IE to do this? I assume the right-click menu is disabled? You could analyze how it opens the window, and probably do some trickery.
type: QuestionComment

http://stackoverflow.com/a/28167912
answers question: http://stackoverflow.com/q/28166539
upvote count: 3
has body: The correct way of doing this would be Suggester.find({ id: suggestions.map(function(s) { return s.suggester_id; }) }) .then(completeSend); You call find once, and pass an array of IDs, once that's done, completeSend will be called with the array of results. You mentioned all of this is already being a part of a promise chain, in which case having a .then() there is bad practice (don't nest .then() calls!) If that's the case, then the correct way would be: // Some promise chain logic here .then(function(/* suggestions? */) { return Suggester.find({ id: suggestions.map(function(s) { return s.suggester_id; }) }); }) .then(completeSend);
has comment: http://stackoverflow.com/comment/44705696
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28166539
type: AcceptedAnswer

http://stackoverflow.com/q/28214143
has body: I want to change the 3rd parameter in my URL to a dynamic variable. Eg. if my URL is http://example.com/A/B/Fixed_var_C then i want it to be changed to http://example.com/A/B/Dynamic_C How can i achieve it by JQuery or javascript that too while the page loads? I tried implementing few methods but not a success. Below is one of the methods: window.history.pushState("object or string", "Title", "/new-url");
has answer: http://stackoverflow.com/a/28214279
score: 2
type: AnsweredQuestion
has title: Change URL parameter onpage load
downvote count: 0
linked to: http://stackoverflow.com/q/824349
has comment: http://stackoverflow.com/comment/44791872
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/44792002
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44791875
answer count: 2
possible better answer: http://stackoverflow.com/a/28214236
has comment: http://stackoverflow.com/comment/44791941
has comment: http://stackoverflow.com/comment/44791837
accepted answer: http://stackoverflow.com/a/28214279
favorite count: 0
has comment: http://stackoverflow.com/comment/44791907
has answer: http://stackoverflow.com/a/28214236
linked to: http://stackoverflow.com/q/17632472
has comment: http://stackoverflow.com/comment/44792780

http://stackoverflow.com/q/28148336
has comment: http://stackoverflow.com/comment/44668792
tagged with: directive
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44668415
has body: I'm writing my application's directives in a way of making used of isolated scope to clearly defined its dependencies in the parent scope. So I can always achieve this in my HTML component &lt;my-directive dependency-one="x" dependency-two="y"&gt;&lt;/my-directive&gt; This is the code for my directive angular.module("myapp").directive('myDirective', [function() { return { restrict: 'E', scope: { dependencyOne: '=', dependencyTwo: '=' }, templateUrl: "path/to/myDirective.html", link: function($scope){ //here goes the code for linking function } } }]); However, I've read some best practises in AngularJS community stated that we should avoid using Isolated Scope as much as possible, as it will increase the app's watchers and useless bindings. Only used Isolated Scope when you're writing component which is reused over the application. As far as I know, we have two possibilities which this: our directive does not create a child scope our directive create a child scope, which is prototypal inherit the parent scope We can prevent creating new scope and unnecessary bindings this way, but it will decrease the readability and clarity of directive's HTML markup, now we only have something like: &lt;my-directive&gt;&lt;/my-directive&gt; Looking at this code, I don't have an idea of what is required for the directive to perform, which is against the advantage of "declarative html" that AngularJS introduced. Anyone interested in this problem?
tagged with: javascript
has title: How to make AngularJS directive to clearly define its dependencies without isolating scope
has comment: http://stackoverflow.com/comment/44676497
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28155503
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
score: 2

http://stackoverflow.com/a/28239473
upvote count: 1
has comment: http://stackoverflow.com/comment/44840024
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28239422
downvote count: 0
has comment: http://stackoverflow.com/comment/44840125
answers question: http://stackoverflow.com/q/28239422
has body: Because inst.__proto__ == Rectangle.prototype. If you wanted to manipulate the prototype (i.e. from what it inherits) of your .prototype object, you would have needed to use Rectangle.prototype.__proto__ = Shape.prototype;
type: Answer

http://stackoverflow.com/q/28216830
has body: I have a javascript that upon process of an ajax call will get a certain value then store it in an array. I don't know why but I set my Array as a global variable but when I try to call it on another function the length returns 0; Why is it when I try to get the length of an array using a different function it returns zero? but when I include it after the for loop on the first function it can generate the length correctly? Isn't it when you declare a variable as GLOBAL it means that you can use it anywhere and in any functions? Please help me and make me realize my mistakes. Sorry for being a newb here is the actual code: var distMatLink = []; function searchNearMarkers(distance){ clearLocations(); document.getElementById('errorNotifs').innerHTML = ""; //document.getElementById('checkboxes').innerHTML = ''; var searchUrl = '...some url here...' downloadUrl(searchUrl, function(data){ var xml = parseXml(data); var markerNodes = xml.documentElement.getElementsByTagName("marker"); var bounds = new google.maps.LatLngBounds(); for (var i = 0; i &lt; markerNodes.length; i++){ var name = markerNodes[i].getAttribute("name"); var address = markerNodes[i].getAttribute("address"); var info = markerNodes[i].getAttribute("info"); var budget = markerNodes[i].getAttribute("budget"); var tts = markerNodes[i].getAttribute("tts"); var type = markerNodes[i].getAttribute("type"); var distance = markerNodes[i].getAttribute("distance"); var latlng = new google.maps.LatLng( parseFloat(markerNodes[i].getAttribute("lat")), parseFloat(markerNodes[i].getAttribute("lng"))); storeArray (i,markerNodes[i].getAttribute("lat"),markerNodes[i].getAttribute("lng")); bounds.extend(latlng); if (i == (markerNodes.length - 1)){ bounds.extend(userPosLatLng); } } map.fitBounds(bounds); }); countArray(); } function storeArray(i,lat,lng){ distMatLink[i] = "|"+lat+ "," +lng+""; } function countArray(){ alert(distMatLink.length); }
type: AnsweredQuestion
upvote count: 0
has title: Array gets empty when tried to run on a script
type: Question
has answer: http://stackoverflow.com/a/28217047
has comment: http://stackoverflow.com/comment/44797128
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44797134
possible better answer: http://stackoverflow.com/a/28217047
answer count: 2
downvote count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/44797506
favorite count: 0
has answer: http://stackoverflow.com/a/28217035
accepted answer: http://stackoverflow.com/a/28217035
has comment: http://stackoverflow.com/comment/44797062

http://stackoverflow.com/comment/44845929
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28242393
has text: no i am using angular js. but if needed i will use jquery.

http://stackoverflow.com/comment/44782031
type: Comment
type: QuestionComment
has text: That explains a lot, works now! Thank you, guys! OT: How do I set this as "asnwered" now?
comment on: http://stackoverflow.com/q/28208462
score: 0

http://stackoverflow.com/comment/44716570
comment on: http://stackoverflow.com/a/28173187
has text: Can you add some context around why this is the correct answer?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44797795
comment on: http://stackoverflow.com/q/28217125
type: Comment
score: 0
type: QuestionComment
has text: Though in this case the problem isn't the PHP, it's the javascript. However, this is EASILY diagnosed yourself if you use a simple debugger. See here: http://stackoverflow.com/questions/988363/how-can-i-debug-my-javascript-code

http://stackoverflow.com/q/28217437
tagged with: addeventlistener
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28217871
score: 0
has title: Making postMessage() and addEventListener() compatible with IE8
linked to: http://stackoverflow.com/q/9769868
accepted answer: http://stackoverflow.com/a/28217871
type: AnsweredQuestion
has body: I'm working on a project where we need to use both postMessage() and addEventListener(), but we want to make the application compatible with major browsers. Because there are still people (yes they exist, and yes they should be burned) using Internet Explorer 8, we need to make the above two methods compatible. I've written the code below, which takes care of making addEventListener() compatible by using attachEvent() instead as suggested in this answer. However, postMessage() is still not working and therefore I added in a timeout, as suggested on this website. This does not work, and I'm really struggling making the application compatible. It does not throw any errors, and I can also see my application has send a message to the iframe source, however the message is never handled. &lt;script type="text/javascript"&gt; function ready() { window.setTimeout(function() { document.getElementById("editor").contentWindow.postMessage("A", "domain here"); }, 0); } function receiveMessage(event) { if (event.origin !== "domain here") return; } window.setTimeout(function() { if (window.addEventListener) { window.addEventListener("message", receiveMessage, false); } else { window.attachEvent("message", receiveMessage); } }, 0); &lt;/script&gt; I have a similar script on my second page (which is being loaded in an iframe) which receives a message and sends a message back. Both messages are being send and received by all major browsers, so the question is: How can I make above script compatible with Internet Explorer 8? Once again: I agree we should not care about people using Internet Explorer 8, and should instead burn them for still using it: However that would mean we would've to burn our clients, something we cannot do. So yes, I really need to make it compatible. In case you are wondering: getElementById("editor") catches an iframe defined as follows: &lt;iframe src="frameListener.html" class="editor" id="editor" onload="ready()"&gt;&lt;/iframe&gt;
tagged with: internet-explorer-8
tagged with: postmessage
type: Question

http://stackoverflow.com/comment/85478449
has text: I have been facing this issue from a long time I have a backgroundImage - .backgroundImageProp::after{ background-image: url('https://republic-prod.azureedge.net/republic-prod/stories/promolarge/xxhdpi/15207762165aa53418177b5.jpeg'); background-repeat: no-repeat; } I want to pass the background-image dynamically, I have tried lot of options - but didnt help, please let me know how can I achieve this, I am new to react
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28269950
type: Comment

http://stackoverflow.com/q/28125053
linked to: http://stackoverflow.com/q/28110490
type: Question
linked to: http://stackoverflow.com/q/28115582
has body: I have lot of confused for the parsing year,month,day,hour.How to show for he given data. var parseDate =d3.time.format("%d %b").parse; var data=[{"key":[2000,0,1,0],"value":1000},{"key":[2000,1,1,1]},"value":2000},{"key":[2000,2,2,2]},"value":3000},{"key":[2000,4,4,4]},"value":5000}] i wrote the code is given below var data1 = data.map(function (d,i){return {key:parseDate((d.key[1])+" "+d.key[0]),value:+d.value}}); console.log(data1)
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28126035
type: UnansweredQuestion
has title: How to parse to get the data in d3.js
tagged with: d3.js

http://stackoverflow.com/comment/44779819
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28207350
type: AnswerComment
has text: Oh. Weird. It supports lots of other ES6 stuff; `.find()` certainly doesn't seem exotic.

http://stackoverflow.com/comment/44702856
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28166206
has text: can you create a fiddle of it

http://stackoverflow.com/q/28235102
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/44831837
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28240710
has comment: http://stackoverflow.com/comment/44832455
has answer: http://stackoverflow.com/a/28241117
type: UnansweredQuestion
tagged with: razor
has body: In my MVC view I need to get razor c# code to execute a javascript function at unpredictable times, way after the page has loaded. I have used a thread to simulate unpredictableness but ultimately instead of the thread it will be a WCF callback method that raises an event which runs the helper, but to eliminate session issues I have used the thread. Javascript to execute: &lt;script type="text/javascript"&gt; function DisplayNews(news) { alert(news); } &lt;/script&gt; Helper that runs the javascript (because sticking this directly in the below thread didn't work) @helper UpdateNews(string news) { &lt;script&gt; DisplayNews(news); &lt;/script&gt; } Thread that simulates unpredictableness/post page loading or non user invoked events @{ System.Threading.Thread T = new System.Threading.Thread(new System.Threading.ThreadStart(delegate { while (true) { System.Threading.Thread.Sleep(5000); UpdateNews("Some cool news"); } })); T.Start(); } If I stick a break point at UpdateNews("Some cool news"); I can see that it gets hit every 5 seconds as it should, but thats as far as it gets, nothing else happens. I can't stick a break point in the helper or the Javascript so I can't see where it stops working after that. Is this going to work at all or is there another way I should be approaching this? Any help would be greatly appreciated.
has title: MVC call Javascript from razor @Helper at unpredictable times
type: Question
tagged with: c#
answer count: 2

http://stackoverflow.com/a/28253769
has body: You can use sort() function of d3.js to change svg order. This is a sample code. // draw a circle d3.select("svg").append("circle").datum({type: "circle"}).attr({ cx: 100, cy: 100, r: 30, fill: "blue" }); // draw a triangle d3.select("svg").append("path").datum({type: "triangle"}).attr({ d: "M100,100 L150,150 V100 z", fill: "red" }); // Here, triangle is shown over circle, // because it is positioned after circle. // e.g. // &lt;svg&gt; // &lt;circle ... /&gt; // &lt;path ... /&gt; // &lt;/svg&gt; // re-order by sort() function d3.selectAll("circle, path").sort(function(d1, d2) { if (d1.type === d2.type) return 0; return d1.type === "circle" ? 1 : -1; }); // Here, circle is shown over triangle. // &lt;svg&gt; // &lt;path ... /&gt; // &lt;circle ... /&gt; // &lt;/svg&gt;
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28243431

http://stackoverflow.com/comment/44725972
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28177917
has text: Good question. Twitter bootstrap 2.3.x does not use fragments at all. Can you reproduce the error in a fiddle? Perhaps you are using some other library, trying to do something with the markup, like react.js or similar? Just theoretically.
type: QuestionComment

http://stackoverflow.com/q/28200083
favorite count: 0
upvote count: 1
tagged with: structure
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28215518
possible better answer: http://stackoverflow.com/a/28212001
score: 1
has answer: http://stackoverflow.com/a/28212001
tagged with: mysql
tagged with: treemap
type: Question
answer count: 2
downvote count: 0
tagged with: database
tagged with: javascript
has title: how to save tree data on database to analyze
accepted answer: http://stackoverflow.com/a/28215518
has body: I'm going to make web application with d3js. It will have tree map about something and able to add/delete by user. I wonder that how to save tree data on database. data could be var treeData = [ { "name": "Top Level", "parent": "null", "children": [ { "name": "Level 2: A", "parent": "Top Level", "children": [ { "name": "Son of A", "parent": "Level 2: A" }, { "name": "Daughter of A", "parent": "Level 2: A" } ] }, { "name": "Level 2: B", "parent": "Top Level" } ] } ]; or source,target A1,A2 A2,A3 A2,A4 actually it doesn't matter which structure I use because the data can save itself on my mysql database as "TEXT". But I want to analyze tree data on database such as select * from treemap where secondChildren = 'stackoverflow'; select * from treemap where root = 'c++' and lastChildren = 'java'; since my treemap will be dynamically made by user, I cannot make fields as much as children nodes. any idea do you guys have? :)

http://stackoverflow.com/q/28172961
type: UnansweredQuestion
score: 0
has title: Onsen UI navigator
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/37607445
has answer: http://stackoverflow.com/a/28183475
tagged with: onsen-ui
answer count: 2
has body: I'm looking for learn OnsenUi to replace Jquery in my phonegap project. I want to make a login page and after switch to a main page. To do that there is my html code : My App Page 1 Identifiant Password Resté connecté Connexion identifiant = {{ctrl.id}} password = {{ctrl.password}} Page 2 APP ` And my js : (function(){ var mbdGlobal = new Object(); var app = angular.module('myApp', ['onsen.directives']); app.controller('MyController', function($scope, $window){ this.id = ""; this.password = ""; this.connexion = function(){ mbdGlobal.id = this.id; mbdGlobal.password = this.password; mbdGlobal.stayConnected = JSON.parse(this.answer); alert(JSON.stringify(mbdGlobal)); //myNavigator.pushPage("app.html", { animation: "slide" }); }; }); })(); But when i start the application i only see the second page. Plz can you help me because the web site of Onsen don't give real exemple. Thanks.
tagged with: cordova

http://stackoverflow.com/q/28204183
answer count: 1
tagged with: javascript
score: 0
tagged with: regex
has title: Regex search for a phrase, return 'n' characters after phrase
type: UnansweredQuestion
has body: I have a large amount of text (lyrics) that I'm trying to search through. When a certain phrase, "higher than" appears, I want the code to return only the next 10 characters. Ex. "blah blah I'm higher than a plane in the sky blah blah blah" would return "a plane in" I can't seem to combine the .match or .substr methods, and I'm not sure how to phrase my initial regex search without having to have a ton of [/s/S] character sets. i'm looking at the .match method because I want an array of information for words following the given phrase. I'm stuck at /(higher than [\s\S][\s\S])/igm for the moment. Any help appreciated. New to JS, apologies in advance.
has comment: http://stackoverflow.com/comment/44774349
type: Question
has answer: http://stackoverflow.com/a/28204221

http://stackoverflow.com/comment/49087479
has text: Thanks for bearing with me.
type: AnswerComment
comment on: http://stackoverflow.com/a/30352727
type: Comment
score: 1

apache
tag name: apache
tags question: http://stackoverflow.com/q/28125821
tags question: http://stackoverflow.com/q/28203982
tags question: http://stackoverflow.com/q/28234337
tags question: http://stackoverflow.com/q/28206773
type: Tag
tags question: http://stackoverflow.com/q/28168690

http://stackoverflow.com/comment/44802543
type: QuestionComment
has text: Thank you, for example this sentence I could use some guidance in how to take down this problem, could say I could use some guidance in how to [enter specific technical requirement herel],
comment on: http://stackoverflow.com/q/28219419
score: 0
type: Comment

http://stackoverflow.com/comment/82963704
comment on: http://stackoverflow.com/a/28164108
has text: This could be revised with more explanation and be a featured answer. Excellent example.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29206953
upvote count: 1
answers question: http://stackoverflow.com/q/28166510
downvote count: 0
has body: I did a workaround. Maintain localstorage flag, data with current index of events data. use resume callback to add rest of the events using custom appointment plugin that you wrote. Each time your app resumes you increment index and add events data from next index. document.addEventListener('resume', this.resumeApp, false) resumeApp: function () { if (localStorage.getItem('updatecalendar') == 'false') { syncUpdatedCalendarWP8(); } },
type: Answer
score: 1

http://stackoverflow.com/a/28163939
answers question: http://stackoverflow.com/q/28163695
upvote count: 1
score: 1
downvote count: 0
has body: I am afraid its not possible, since you can access the page element once DOM is initialize. just go with $(function(){ //your code}), that will make your code run every time $(function(){ $('#status').fadeOut(); // dont rely on this to hide the loaded, use css below $('#preloader').delay(350).fadeOut('slow'); }); You can do this using CSS, to initially show the preloaded till page loads #preloader {display:block}
type: Answer

http://stackoverflow.com/a/28161548
has body: You have not provided all of the code. Somewhere, you're doing this: $(document) This works in jQuery, but it will not work with querySelector because it isn't a selector. Either remove that usage, or change your $ function to handle document. function $(e){ return e === document ? document : document.querySelector(e); }
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/44694398
accepted answer of: http://stackoverflow.com/q/28161504
answers question: http://stackoverflow.com/q/28161504

http://stackoverflow.com/q/28176061
has comment: http://stackoverflow.com/comment/44721479
type: Question
has comment: http://stackoverflow.com/comment/44730139
has comment: http://stackoverflow.com/comment/44721527
has answer: http://stackoverflow.com/a/28176180
answer count: 2
has body: After two days of research, I still can't find a solution. I'm using an image as the background to my bootstrap 2.3.2 site. I'm trying to figure out how to get the browser window to adjust to the height of each page. At first the background image was visible below the footer, which looked pretty stupid. All attempts at background-overflow: hidden; didn't work when applied to body or to the style sheet for the image. This is the code for the script that sorta worked: ` &lt;script type="text/javascript"&gt; var viewport = $(window).height(); $('.container-fluid').height(viewport); &lt;/script&gt; ` This got the image within the confines of the body, but produced scrolling no matter how high the browser window. This is the code being used for the image: body { margin-top: 0px; margin-bottom: 0px; background: none; background-overflow: hidden; } .full { background: url(http://test2.gandlconsultants.com/assets/img/big-pic-01.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-overflow: hidden; z-index: 999; } Could someone please tell me how to get the browser window to limit itself to the actual height of the page i.e. if page is only x number of pixels the browser window adjusts to the x height of the page. The page I'm writing this on does that. Thank you.
tagged with: javascript
has title: Page Height Equal Window Height
score: 0
has comment: http://stackoverflow.com/comment/44721340
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28176227

http://stackoverflow.com/comment/44650554
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28139344
type: Comment
has text: Where does "Gaussian" come into the picture? You mention it in the title, but it doesn't look like you do it, or want it. Did you mean "uniform distribution"?

http://stackoverflow.com/comment/51809050
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/31949478
has text: In your case, the pattern seems to be useless though. You don't need a `globalVar` at all, just do `User.findAsync({}).then(function(users){ console.log(users); mongoose.connection.close() });`?
type: Comment

http://stackoverflow.com/q/28180570
has answer: http://stackoverflow.com/a/28253680
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28253680
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/28180669
has title: Functions in Angular controller not activated on button click
has comment: http://stackoverflow.com/comment/44736500
has body: I am trying to make a contact me from with Angular. Right now, I have some input fields, a button, and an angular app as a script in the page to try and make things as simple as possible. I was trying to make sure things are talking to each other so I just put a console.log in my angular controller which I think should print to the console when I click the button. However, it just reloads the page every time. Below is the code that is showing this issue HTML: Name Email Message Contact Me JS: var contactApp = angular.module('contactApp', []) .controller('ContactCtrl', function ($scope, $http){ $scope.submit = function (name, email, message){ console.log('contact with controller') } }) Most code is just creating the HTML form, see angular app at the bottom.
has comment: http://stackoverflow.com/comment/44730496
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44739208
accepted answer: http://stackoverflow.com/a/28180669

http://stackoverflow.com/comment/44803364
has text: And instead of an tag, try to use another one : Rapport PDF
type: Comment
comment on: http://stackoverflow.com/a/28219934
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44652991
type: Comment
score: 0
has text: Thank you for your answer. But how do I implement it? Sorry, javascript I teach a few days.
comment on: http://stackoverflow.com/a/28140488
type: AnswerComment

http://stackoverflow.com/comment/44892748
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28267833
has text: ok thank's i removed the first link and adde googleapi i removed jQuery.noconflict() but same error May be i need to do an jquery tutorial ... i did 3 uses because i though that i had to do it
type: Comment

asp.net-mvc
tags question: http://stackoverflow.com/q/28229705
tags question: http://stackoverflow.com/q/28130623
tags question: http://stackoverflow.com/q/28131661
tags question: http://stackoverflow.com/q/28227698
tags question: http://stackoverflow.com/q/28147838
tags question: http://stackoverflow.com/q/28209900
tags question: http://stackoverflow.com/q/28277292
tags question: http://stackoverflow.com/q/28137908
tags question: http://stackoverflow.com/q/28176131
tags question: http://stackoverflow.com/q/28133041
tags question: http://stackoverflow.com/q/28199517
tags question: http://stackoverflow.com/q/28224551
tags question: http://stackoverflow.com/q/28144805
tags question: http://stackoverflow.com/q/28191459
tags question: http://stackoverflow.com/q/28165195
tags question: http://stackoverflow.com/q/28130798
tags question: http://stackoverflow.com/q/28147375
tags question: http://stackoverflow.com/q/28212880
tags question: http://stackoverflow.com/q/28201398
tags question: http://stackoverflow.com/q/28230247
tags question: http://stackoverflow.com/q/28167227
tags question: http://stackoverflow.com/q/28154638
tags question: http://stackoverflow.com/q/28259739
tags question: http://stackoverflow.com/q/28234498
tags question: http://stackoverflow.com/q/28150275
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28230246
tags question: http://stackoverflow.com/q/28169261
tags question: http://stackoverflow.com/q/28222785
tags question: http://stackoverflow.com/q/28207558
tags question: http://stackoverflow.com/q/28173122
tags question: http://stackoverflow.com/q/28244792
tags question: http://stackoverflow.com/q/28234519
tags question: http://stackoverflow.com/q/28125258
tags question: http://stackoverflow.com/q/28265620
tags question: http://stackoverflow.com/q/28235639
tags question: http://stackoverflow.com/q/28126187
tags question: http://stackoverflow.com/q/28235102
tags question: http://stackoverflow.com/q/28239488
tags question: http://stackoverflow.com/q/28193991
tags question: http://stackoverflow.com/q/28231976
type: Tag
tags question: http://stackoverflow.com/q/28278752
tags question: http://stackoverflow.com/q/28272026
tags question: http://stackoverflow.com/q/28148516
tags question: http://stackoverflow.com/q/28271418
tags question: http://stackoverflow.com/q/28237548

http://stackoverflow.com/q/28127794
downvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28127859
favorite count: 0
possible better answer: http://stackoverflow.com/a/28127815
tagged with: regex
has answer: http://stackoverflow.com/a/28127815
has body: :) First of all, sorry my bady english :p I was taking a look to the next js code fragment: var classes = element.className.split(/\s+/); That code will split the full classname of and element into an array containing every class... but, what's the difference between using .split(/\s+/), and using .split(" ")? i see the same result... I tested this with the next simple code in Chrome: I have the same result whether i use .split(" ") or .split(/\s+/): clase1 clase2 clase3-xD clase1 clase2 clase3-xD Do they have any relevant difference?
type: AnsweredQuestion
type: Question
has title: Difference between .split(/\s+/) and .split(" ")?
has answer: http://stackoverflow.com/a/28128029
score: 10
accepted answer: http://stackoverflow.com/a/28128029
has comment: http://stackoverflow.com/comment/44628497
upvote count: 11
answer count: 3

http://stackoverflow.com/q/28131481
answer count: 2
tagged with: function
possible better answer: http://stackoverflow.com/a/28131554
tagged with: header
tagged with: javascript
has comment: http://stackoverflow.com/comment/44636332
has title: Including in a library
has answer: http://stackoverflow.com/a/28131554
accepted answer: http://stackoverflow.com/a/28161903
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/44635599
has comment: http://stackoverflow.com/comment/44635651
has body: I have a few "div" sections that are called by my Javascript function using document.getElementById('ID_NAME').style.display='block'. My question, is there a way to include these "div's" in a .js, .css or another type of library sourced from my header? If I copy and paste the div code directly into the head it works fine, however, when I try to include it in my .js or .css libraries it wont execute. CODE &lt;script type="text/javascript&gt; function myFunction() { var a = window.location.href; var b = "http://www.myblog.com/"; if (a == b) { setTimeout(function(){ document.getElementById('EXAMPLE1').style.display='block';}, 3000);}} window.onload = myFunction(); &lt;/script&gt; &lt;div id="EXAMPLE1" class="offer_content"&gt; &lt;embed src="http://www.domain.com/" width="100%" height="100%"&gt; &lt;/div&gt; I know there has to be a way to insert "div" code into a library. I need some of my clients to "src" it into their own websites easily. Much appreciated Stack community! Jon
has answer: http://stackoverflow.com/a/28161903

http://stackoverflow.com/comment/44819963
score: 0
has text: Don't post your code in comments. Edit your post. That's the purpose of the feature!
comment on: http://stackoverflow.com/q/28228075
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47637047
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28201103
has text: Thanks @Gavin Simpson i solved my problem with you link

http://stackoverflow.com/comment/44668341
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28148255
has text: @BhojendraNepal: I don't understand what you're asking. The above works. You can't modify strings in-place in JavaScript, because the spec doesn't define any mutator methods for them. At all. So they're immutable until/unless a future specification chooses to create mutator methods for them (which is ***extremely*** unlikely).

http://stackoverflow.com/comment/44723532
type: Comment
type: QuestionComment
has text: marker is the checkbox for #allprograms. I want to be able to check and uncheck that but i want the function to relaod the search area.
score: 0
comment on: http://stackoverflow.com/q/28175986

http://stackoverflow.com/q/28273271
tagged with: google-chrome-extension
answer count: 1
has body: I intend to modify the display of existing websites. For example, when Google returns search results, can I customize the web page displaying (such as adding some bubble visualizations onto that page's blank places) ? Could it be done using browser plug-in or extension? Based on my knowledge, a browser extension, such as firefox or chrome extension, is usually for adding tiny icons to the address bar.
tagged with: browser-extension
favorite count: 0
has comment: http://stackoverflow.com/comment/44936159
tagged with: browser-plugin
has comment: http://stackoverflow.com/comment/44940645
accepted answer: http://stackoverflow.com/a/28273430
score: 2
type: AnsweredQuestion
has title: browser plug-in or extension, which to choose?
has answer: http://stackoverflow.com/a/28273430
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44937091
tagged with: javascript
has comment: http://stackoverflow.com/comment/44935389
upvote count: 3
has comment: http://stackoverflow.com/comment/44904341
tagged with: firefox-addon

http://stackoverflow.com/comment/45124586
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28198406
type: Comment
has text: @c.ouggag I couldn't really say why IPhone isn't rendering this correctly. What isn't working on the iPhone?

http://stackoverflow.com/q/28208165
tagged with: angularjs
has answer: http://stackoverflow.com/a/28208449
accepted answer: http://stackoverflow.com/a/28208449
has comment: http://stackoverflow.com/comment/44781228
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28208466
score: 21
upvote count: 21
has body: I am trying to use ng-class of angular. I have a function which returns the class based on the parameters we send it. How can i achieve it ? Here's what i tried: &lt;div ng-class="{ getClass(key) }" &gt; and in the controller: getClass = function(keyVal){ angular.forEach(myArray, function(value, id){ if(value.key === keyVal){ console.log(value.class); return value.class; } }); } Just returning a string works. but the moment I add this anfular.forEach, it stops. In debugger, the loop is working fine and returning the right data. I know it can be acheved by a filter, but I want to do this way only.
type: Question
has comment: http://stackoverflow.com/comment/44782614
downvote count: 0
tagged with: javascript
has title: Passing function with parameters in ng-class to get the class
answer count: 3
has answer: http://stackoverflow.com/a/28208466
has answer: http://stackoverflow.com/a/28212515
favorite count: 0

http://stackoverflow.com/a/28201840
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28201504
score: 1
upvote count: 1
has body: First of all, I probably wouldn't do it this way. Too many conversions to/from strings, etc... But, if you stay down this track then I would break down the problem into some small function segments that segregate the counting of available and unavailable seats. This would make the code a bit easier to manage and understand. Also, you have some globals which I would also avoid. Good luck

http://stackoverflow.com/a/28258104
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28258088
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44874358
accepted answer of: http://stackoverflow.com/q/28258088
has body: IDs have to be unique, that's why your code fails on the second row. Use classes instead. Also, your click() function might be looking for an element that's not created yet. Use on() instead, it works with dynamically added content. UPDATE So I am using classes now but it still doesn't work! $("form#form1 &gt; span[class^='hour'] &gt; button").on("click",(function(){ alert("!"); })); You needed to fix your on() selector: $(document).ready(function(){ window.sati = 1; $("#addSat").click(function(){ var sat = window.sati; $('form#form1').append('&lt;span class="hour' + sat + '"&gt;&lt;span class="numHour"&gt;' + sat + '&lt;/span&gt;&lt;input type="text" value="" name="subject"/&gt;&lt;button type="button" class="down"&gt;&amp;darr;&lt;/button&gt;&lt;button type="button" class="up"&gt;&amp;uarr;&lt;/button&gt;&lt;/span&gt;&lt;br/&gt;'); window.sati+=1; }); $("form#form1").on("click", "span[class^='hour'] &gt; button",function(){ alert("!"); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form id="form1"&gt;&lt;/form&gt; &lt;button id="addSat"&gt;Dodaj Sat&lt;/button&gt;
type: AcceptedAnswer

http://stackoverflow.com/a/28225170
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44814219
upvote count: 1
has body: Damn Miltox beat me too it. His is better though. Just to say the reason safari was weird was you had multiple tables set at 100% height each stacked on top of each other so they were adding up, you should have had one big table. Miltox's answer will have fixed that all anyway.
type: Answer
answers question: http://stackoverflow.com/q/28224694

http://stackoverflow.com/q/28208893
tagged with: javascript
has answer: http://stackoverflow.com/a/31803834
score: 4
has comment: http://stackoverflow.com/comment/44808823
has comment: http://stackoverflow.com/comment/44808405
has answer: http://stackoverflow.com/a/28226017
has answer: http://stackoverflow.com/a/41803992
accepted answer: http://stackoverflow.com/a/28226017
has comment: http://stackoverflow.com/comment/44793143
favorite count: 0
has comment: http://stackoverflow.com/comment/44809866
tagged with: angularjs
has body: This is a common issue, I see it a ton but nothing seems to work. Here is what I'm doing. I want to have some dynamic animations with my states, so basically login will do some cool animations and move into the actual interface. Now, I started nesting the views like this: $stateProvider .state('login', { url: '/login', title: "Login", views: { "master": { controller: "LoginController", templateUrl: "/components/login/login.html", authentication: false } } }) .state("logout", { url: "/logout", title: "Logout", authentication: false }) .state('foo', { url: '/', controller: "HomeController", views: { "master": { templateUrl: '/components/ui-views/masterView.html' }, "sidebar@foo": { templateUrl: '/components/sidebar/_sidebar.html' }, "header@foo": { templateUrl: '/components/header/_header.html' } } }) .state('foo.inventory', { url: '/inventory', title: "Inventory", views: { "content@foo": { controller: "InventoryController", templateUrl: "/components/inventory/inventory.html" } } }); So while running this I need to redirect to logout, but it gets stuck. It won't move from this logout state at all. Here is how I'm handling that: function run($http, $rootScope, $cookieStore, $state, $templateCache, $timeout, AuthService, modalService, const) { var timeout; FastClick.attach(document.body); $rootScope.globals = $cookieStore.get('globals') || {}; if ($state.current.name !== 'login' &amp;&amp; !$rootScope.globals.guid) { $state.go('login'); } else if ($state.current.name == 'login' &amp;&amp; $rootScope.globals.guid) { $state.go('foo'); } $rootScope.$on('$stateChangeStart', function (event, next, current, fromState, fromParams) { var authorizedRoles = next.level != undefined ? next.level : 1, needAuth = next.authentication != undefined ? next.authentication : true; if (needAuth) { if (!AuthService.isAuthorized(authorizedRoles, true)) { event.preventDefault(); if (AuthService.isAuthenticated()) { $rootScope.$broadcast(const.auth.notAuthorized); $state.go('foo', {}); } else {…
has title: UI Router $state.go is not redirecting?
possible better answer: http://stackoverflow.com/a/31803834
has answer: http://stackoverflow.com/a/41803271
upvote count: 4
answer count: 4
has comment: http://stackoverflow.com/comment/44809335
has comment: http://stackoverflow.com/comment/44783241
has comment: http://stackoverflow.com/comment/44810040
downvote count: 0
has comment: http://stackoverflow.com/comment/44782707
type: Question
type: AnsweredQuestion
tagged with: angular-ui-router

http://stackoverflow.com/a/28168942
has body: I found the path specifier from jquerys $.cookie in this top answer below. $.cookie(cookieName, items.join(',') , { path: '/' }); from my code. why are my jquery cookies not available across multiple pages?
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28168679
type: Answer
accepted answer of: http://stackoverflow.com/q/28168679
score: 0

http://stackoverflow.com/a/28206740
type: AcceptedAnswer
downvote count: 0
has body: An Ajax call is an efficient way for a client to request some specific information from a server in a one-shot type of approach. A webSocket is best for a situation where you're doing rapid fire communication from client to server (so many requests that you benefit from a persistent connection) or when you want the server to be able to send data to the client at will (since you have to have a persistent connection to send data from server directly to client). Using a one-shot webSocket (where you create the webSocket, use it and then close it) for an occasional request of data from client to server is not the most optimal way to do things because there is additional overhead to setting up the webSocket that is not present in the ajax call as the two ends negotiate whether both sides support webSockets and agree to change the protocol from http to webSocket. A one-shot webSocket connection would look like this: client establishes TCP socket to server client sends initial HTTP request with webSocket upgrade headers server responds that it is OK to upgrade to webSocket protocol client sends message server receives message and sends response client receives response client closes TCP connection An Ajax call would look like this: client establishes TCP socket to server client sends HTTP request to server server receives request and sends response client receives response client closes connection And, when coding in the browser, the Ajax call is automatically closed (since it is designed for one-shot requests) so the client doesn't even have to code that last step. So, if you're just requesting some information from the server upon an end-user click, then it seems likely that an Ajax call is a more efficient approach (and simpler to implement).
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/28204720
answers question: http://stackoverflow.com/q/28204720

http://stackoverflow.com/comment/44770373
has text: `getValues` doesn't return an array. http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.form.Basic-method-getValues
score: 0
comment on: http://stackoverflow.com/q/28202056
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28250984
type: Question
has title: Applying CSS on a subString using DOM
accepted answer: http://stackoverflow.com/a/28251200
tagged with: javascript
score: 0
answer count: 3
has body: Here is the JS code in which I am splitting a String using ":" . So a String given by: Habit #1: Have you established dedicated business checking account(s)? Would split into: [0]=Habit #1 and [1]=Have you established dedicated business checking account(s)? Now I want to apply CSS to [0]. titles=document.getElementsByClassName("title"); for(var i=0;i&lt;titles.length;i++){ titles[i].innerHTML.split(":")[0].style.cssText="color:aqua;"; } Any modification you guys suggest to the existing code?
tagged with: css
has answer: http://stackoverflow.com/a/28251078
has answer: http://stackoverflow.com/a/28251200
possible better answer: http://stackoverflow.com/a/28251175
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28251175

http://stackoverflow.com/a/28127783
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/28127585
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28127585
score: 3
has body: Objects in Javascript are passed by reference. That is, only one object is created and the symbol that represents that object can be used but it will refer to the same object always. Lets take a deeper look: If I'm understanding your example correct, this part var temp = {} var arr = [] temp['a'] = ['a'] arr.push(temp) console.log(arr); Creates a local variable temp to which you add ['a'] to. You then push that into arr. So at this point, arr references the object temp and looks like this: [ { a: [ 'a' ] } ] When you do this: temp['b'] = ['b'] arr.push(temp); console.log(arr); The temp symbol which points to the original object containing ['a'] is updated, and so the arr will also get updated, so arr contains this at that point: [ { a: [ 'a' ], b: [ 'b' ] }, { a: [ 'a' ], b: [ 'b' ] } ] Finally, You then do this instead: temp = {}; temp['a'] = ['a'] temp['b'] = ['b'] arr.push(temp); console.log(arr); This creates a separate global variable temp, onto which you add both ['a'] and ['b']. This is global because it does not have the var keyword in the declaration/initialization. This then gets pushed into the arr. However, since it's a global variable and not the original local variable, you see this instead: [ { a: [ 'a' ] }, { a: [ 'a' ], b: [ 'b' ] } ]
type: AcceptedAnswer

http://stackoverflow.com/a/28220012
answers question: http://stackoverflow.com/q/28175982
score: 0
has body: That cost a lot of whiskey and time :D Thank you Luca for your answers. Writing to disk is still not an option, because "parking" the file on disk would use valuable milliseconds on the server-side. I divided the transaction into two parts, because posting the selected ID via ajax did not work in my (up there) posted example. First I Post the values into $_SESSION - variables. Then (success-State) I open the link to the php-PDFgenerator. What I did was to create a server-sided file which stores the IDs into a Session-Variable : writesession.php session_start(); $_SESSION['arr_certificate_id']= $_POST['arr_id']; ajaxified.php // put all the checked rows into array (e.g. "101,105,107") $("#tools_savepdf").click(function(){ arr_id = []; $('.checkbox').each(function(){ if ( $(this).is(':checked') ){ arr_id[arr_id.length] = $(this).val(); } }); // open realtime-generated PDF $.ajax({ type: "POST", url: "writesession.php", data: { arr_id:arr_id }, async: "true", success: function(data){ window.open('createpdfs.php'); } //success }); //ajax }); // click Then I modifies the pdfcreator-File to read the session-variables. createpdfs.php $pdf_id_arr = $_SESSION['arr_certificate_id']; [...] Now that "createpdfs.php" is a hard link without any "POSTS" is works just fine.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28175982
type: Answer

http://stackoverflow.com/a/28143346
has comment: http://stackoverflow.com/comment/44658797
has comment: http://stackoverflow.com/comment/44690120
has body: If you want to relatively easily analyse how it's working (step by step), I would advise to you to use Timeline from Chrome DevTools, which is pretty handy tool to this kind of stuff. Last, but not least, Philip Roberts gave a great talk at JSConf EU, which gives a deep understanding on how the event loop works, which you might find useful to solve you issue.
score: 0
answers question: http://stackoverflow.com/q/28143151
type: Answer

http://stackoverflow.com/q/28269139
type: Question
has answer: http://stackoverflow.com/a/28269478
tagged with: javascript
score: 0
has title: Tooltip not working as expected
has comment: http://stackoverflow.com/comment/44894428
answer count: 1
has comment: http://stackoverflow.com/comment/44894568
tagged with: d3.js
type: UnansweredQuestion
has body: I would like my tooltip to write the date and the value on hover. It should also update date and value as you travel the value line on the chart. I'm able to write one value but the date returns undefined and the value does not update as expected. I'm new to D3 so I'm confused. Any help would be appreciated. I posted a jsfiddle here: [1]: http://jsfiddle.net/tommy6s/6L832q7e/ Thank you! //draw tooltip div var tooltip = d3.select(".wrapper").append("div") .attr("class", "tooltip"); tooltip.append("p") .attr("class", "date") .html("&lt;strong&gt;" + d.date + "&lt;/strong&gt;"); tooltip.append("p") .attr("class", "value") .html("&lt;span&gt;" + d.value + "&lt;/span&gt;"); //tooltip code var path = svg.selectAll("path"); path.on('mouseover', function(d){ tooltip.select('p', '.date').html(d[0].date) tooltip.select('p', '.value').html('$ ' + d[1].value) tooltip.style('display', 'block'); }); path.on('mouseout', function(){ tooltip.style('display', 'none'); }); path.on('mousemove', function(d){ tooltip.style('left', (d3.event.pageX + 20) + 'px') .style('top', (d3.event.pageY + 0) + 'px') });

http://stackoverflow.com/q/28261780
has answer: http://stackoverflow.com/a/28261868
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44880737
score: 0
has title: NodeJS async callback not succeeding?
tagged with: asynchronous
tagged with: node.js
has body: I'm trying to implement a scraper using async.map feature to iterate over an array, do some logic and then map them to different values. async.map($('.listing tr').toArray(), GetLink, function(err, results) { if (err) throw err; console.log(results); }); It uses the cheerio module to loop through all table rows to get their links, then completes some logic on them (gets the information from the page it is linked). var GetLink = function(tablerow, callback) { var nameElement = $(tablerow).children().first().find('a'); var link = nameElement.attr('href'); I then use the 'got' module (a faster/more barebones version of request) to get the pages html. got(link, function(error, html, resp) { if (!error) callback(null, html); // Sends the HTML back as an array result. } } However the async.map callback [function (err, results)] is never ran even though callback is a valid function from that scope. Any information would be appreciated.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28261868
type: Question

http://stackoverflow.com/q/28158262
has answer: http://stackoverflow.com/a/39242744
has comment: http://stackoverflow.com/comment/44688194
has comment: http://stackoverflow.com/comment/44687952
has comment: http://stackoverflow.com/comment/44688101
has comment: http://stackoverflow.com/comment/44687999
has comment: http://stackoverflow.com/comment/65799228
has comment: http://stackoverflow.com/comment/44688064
has answer: http://stackoverflow.com/a/39263608
has title: Detect AltGr key using JavaScript
has body: How can I clarify ALT+CTRL and ALTGR key press? I found this code here as possible solution, but it's doesn't work: if (event.ctrlKey &amp;&amp; event.altKey) { } This code is true for alt+ctr and for altGr as well. I have situation like this: for alt+ctrl+e (for example e, it's no matter) I want one thing and for altGr+e another, how can I do this? If anyone have some idea, please tell me.
type: Question
has comment: http://stackoverflow.com/comment/44688281
has comment: http://stackoverflow.com/comment/44688050
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/65809536
has comment: http://stackoverflow.com/comment/44688063
tagged with: keyboard
favorite count: 0
has comment: http://stackoverflow.com/comment/44688129
has comment: http://stackoverflow.com/comment/44687901
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/39237076
score: 6
linked to: http://stackoverflow.com/q/8562528
upvote count: 6

http://stackoverflow.com/a/28259427
has comment: http://stackoverflow.com/comment/44876749
has comment: http://stackoverflow.com/comment/44876598
has comment: http://stackoverflow.com/comment/44876574
has comment: http://stackoverflow.com/comment/44876702
answers question: http://stackoverflow.com/q/28259355
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28259355
has comment: http://stackoverflow.com/comment/44876584
has body: Did you want a pure Javascript version? http://plnkr.co/edit/55h5cmxOAZeNTGbKzedA?p=preview setInterval(function thing() { var b1 = document.getElementById('box1'); var b2 = document.getElementById('box2'); if(b1['style'].display == 'none') { b1['style'].display = 'block'; b2['style'].display = 'none'; } else { b1['style'].display = 'none'; b2['style'].display = 'block'; } }, 10000);
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/28142440
has body: Just make a file with the snippet to be included first and do this: src/first.js var Ethereal = function() { // define Ethereal class constructor and stuff } src/Game.js Ethereal.Game = function() { // init game code } Then in the gulpfile: gulp.task('build', function() { return gulp.src(['src/first.js', 'src/*.js']) .pipe(concat('ethereal.js')) .pipe(gulp.dest('build')) .pipe(rename('ethereal.min.js')) .pipe(uglify()) .pipe(gulp.dest('build')); }); This will output build/ethereal.js as var Ethereal = function() { // define Ethereal class constructor and stuff } Ethereal.Game = function() { // init game code } or just use http://browserify.org/ and require the Ethereal module in every module that implements it.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28142177
answers question: http://stackoverflow.com/q/28142177
has comment: http://stackoverflow.com/comment/44658663
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44815564
type: Comment
comment on: http://stackoverflow.com/a/28226116
has text: The thing your missing is a lot of his conditionals are like `if (a + b == someValue) { \\ add a bunch of stuff } else if (a - b == someValue) { \\ subtract a bunch of stuff } which can be easily generalized.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44683794
type: Comment
comment on: http://stackoverflow.com/a/28148947
type: AnswerComment
has text: Interesting approach! I will look into this.
score: 0

http://stackoverflow.com/comment/44865306
has text: so do you want to set the hrefs of all anchors to one thing except for the pages that are in `Site_dont_go` ? I am pretty confused
comment on: http://stackoverflow.com/q/28253288
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28240175
has comment: http://stackoverflow.com/comment/44841383
has comment: http://stackoverflow.com/comment/44841438
has comment: http://stackoverflow.com/comment/44841421
downvote count: 0
answers question: http://stackoverflow.com/q/28240051
type: Answer
has comment: http://stackoverflow.com/comment/44841404
has body: something like this? i changed the structure a little of the html and initially hid the description span using style="display:none;". also, by switching the html around a butting the click descriptions span inside the paragraph .desc, you didnt need to finick with .parent() or anything like that. $(document).ready(function() { var title = "TITLE HERE"; var location = "THIS IS THE LOCATION"; var dept = "something about DEPT"; var description = "im describing something"; $('#jobs-list-2').append(" " + title + "" + ", " + location + " " + "Department: " + dept + " "); $('#jobs-list-2').append(" " + description + " Click for Details "); $('#jobs-list-2').on("click", ".details_btn", function () { console.log('click'); $(this).closest('.desc').find('.description').show(); }); });
upvote count: 1
score: 1

http://stackoverflow.com/a/28229938
has body: In a single line you can remove like $('#selectionid option').filter('[value="option1"],[value="option2"]').remove(); Demo
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28229858
answers question: http://stackoverflow.com/q/28229858
type: AcceptedAnswer
type: Answer
score: 2
upvote count: 3

http://stackoverflow.com/comment/44697481
has text: Seriously, where did you learn about `style` with `document.write`?
comment on: http://stackoverflow.com/q/28163255
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/44811627
has text: I've already tested them all, they are all valid
comment on: http://stackoverflow.com/q/28223505
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44836577
has text: I want my form to input textarea or select checkbox
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28237611

http://stackoverflow.com/q/28177139
accepted answer: http://stackoverflow.com/a/28179596
type: Question
tagged with: tooltip
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44725378
has comment: http://stackoverflow.com/comment/44723934
has body: I've been trying to manipulate the bootstrap tooltip's positioning without success. Attempt #1: stuff.tooltip({ container: 'body', placement: function(tip, el) { // played with tip, but it still add style: top, left at the end... } }); Attempt #2: stuff.tooltip({ container: 'body', placement: 'top' }).on("show.bs.tooltip", function() { // don't have access of the tip here }); Attempt #3: stuff.tooltip({ container: 'body', placement: 'top' }).on("shown.bs.tooltip", function() { // doing anything to the tip at this point would cause visible change }); Any ideas?
has title: How to change Bootstrap style before it is shown?
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28179596
tagged with: position
tagged with: twitter-bootstrap
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44723668
upvote count: 1

http://stackoverflow.com/comment/44893047
comment on: http://stackoverflow.com/a/28268326
type: AnswerComment
score: 0
has text: no, the problem is getElementById("Gridview1") returns null object.
type: Comment

http://stackoverflow.com/comment/44627539
type: QuestionComment
comment on: http://stackoverflow.com/q/28127036
type: Comment
has text: I had a pretty hard time decoding your message. Had to use my dev tools to go through your fiddle.
score: 0

http://stackoverflow.com/comment/108970808
comment on: http://stackoverflow.com/a/59119270
type: AnswerComment
score: 0
type: Comment
has text: Thanks This works perfectly for me. But in case I want to draw the line with different color instead of the points in different color - as per the current value - where should I be making the changes?

http://stackoverflow.com/q/28259019
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44879222
tagged with: css
has comment: http://stackoverflow.com/comment/44878280
has comment: http://stackoverflow.com/comment/44879719
has comment: http://stackoverflow.com/comment/44879374
type: Question
has comment: http://stackoverflow.com/comment/44879362
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28261074
possible better answer: http://stackoverflow.com/a/32803788
has comment: http://stackoverflow.com/comment/44878718
has answer: http://stackoverflow.com/a/32803788
has comment: http://stackoverflow.com/comment/44878610
has title: Make DIVs in Accordion/Collapsible stay fixed at top and bottom of page
has comment: http://stackoverflow.com/comment/44881194
answer count: 2
has comment: http://stackoverflow.com/comment/44878737
has comment: http://stackoverflow.com/comment/44878422
has body: Ok i'll try very hard to explain exactly what I'm trying to accomplish. I know that if I want a div to stay at the bottom of a page I can simply do this.. blah text But I don't want this to always be at the bottom of the page.. I have code like this.. ...... ...... ...... ..repeated 20 times or w/e.. I want to do something like http://www.snyderplace.com/demos/collapsible.html BUT i really don't want to use someone elses library if at all possible... I'm open to using jQuery etc, just don't want to use someone elses library if all possible unless its very bare bones and not a FULL library. I only know how to hide and show the current ones HTML. I know i would prolly have to do something like.. if (e.id = "firstDiv") { secondDiv.style.display = 'none'; thirdDiv.style.display = 'none'; } elseif { .... .... } Ok so what I want to be able to do is if i have a TON of data inside the [firstDiv] and its so much data that the page has a scroll bar and the [secondDiv] and [thirdDiv] would normally pushed all the way down the page... I want [secondDiv] and [thirdDiv] to stack ontop of eachother and always at the bottom of the page... But then if I click on [secondDiv] then the [firstDiv] contents will obviously disappear, but I want [firstDiv] to stay at top of page no matter what, then [secondDiv] to be right under neath it which will then show its HTML while [thirdDiv] will still stay static at the bottom of the page.... Then if I was to click on [thirdDiv] then it would just then be [firstDiv] [secondDiv] and [thirdDiv] stacked in order at the very top while now of course showing the HTML of the [thirdDiv]... LOOOONG explaination later i'm wanting to do a Collapseable system that hides the other divs content while keeping them in order HOWEVER the twist is that the divs below the [firstDiv] always still show up at the bottom of the page no matter what. Hopefully this makes sense!
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44876443
accepted answer: http://stackoverflow.com/a/28261074

http://stackoverflow.com/comment/47962546
has text: packery has an opt-in to position the elements using percentages (`"percentPosition": true`) but the problem persists, which leads me to think it's the browser layout engine accumulating rounding errors: http://jsfiddle.net/akw6m9x1/20/
comment on: http://stackoverflow.com/q/28137801
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28272135
score: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/73156637
type: Answer
upvote count: 4
has body: var d = new Date(); var n = d.toLocaleDateString(); I think this will give you desired output.
answers question: http://stackoverflow.com/q/28271904

http://stackoverflow.com/a/28175080
downvote count: 0
has comment: http://stackoverflow.com/comment/44720377
type: Answer
has comment: http://stackoverflow.com/comment/44719618
has comment: http://stackoverflow.com/comment/44720068
has body: To extract the selected text, you could walk the selection for text nodes only and concatenate them. var content = window.getSelection().getRangeAt(0).cloneContents(); var treeWalker = document.createTreeWalker(content, NodeFilter.SHOW_TEXT); var text = ''; while (treeWalker.nextNode()) { text = text.concat(treeWalker.currentNode.nodeValue); } console.log(text); EDIT How to wrap a selection with an identifier string: String.prototype.splice = function( idx, rem, s ) { return (this.slice(0,idx) + s + this.slice(idx + Math.abs(rem))); }; var range = window.getSelection().getRangeAt(0); range.startContainer.nodeValue = range.startContainer.nodeValue.splice(range.startOffset, 0, '[highlight]'); range.endContainer.nodeValue = range.endContainer.nodeValue.splice(range.endOffset, 0, '[/highlight]'); splice courtesy of this post
has comment: http://stackoverflow.com/comment/44720174
upvote count: 1
answers question: http://stackoverflow.com/q/28173274
has comment: http://stackoverflow.com/comment/44720243
score: 1
has comment: http://stackoverflow.com/comment/44719413
has comment: http://stackoverflow.com/comment/44719248

http://stackoverflow.com/q/28182007
answer count: 0
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: jspdf
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
has title: Add text to existing PDF with any JS like jspdf.js
has body: Is possible to add for example text to exsiting PDF file with JS? For example with jspdf.js? Thank you.
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/44745701
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28188660
type: Comment
has text: This is completely wrong. Files had to be min.css and min.js rather than `0.2.min`. I think that alchemists have fixed the issue rapidly I reported this in [their issue tracker](https://github.com/GraphAlchemist/Alchemy/issues/343#issuecomment-71804741). This has nothing to do with `head` and `text/javascript.

http://stackoverflow.com/q/28149815
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44672899
tagged with: module
accepted answer: http://stackoverflow.com/a/28153781
tagged with: youtube-javascript-api
tagged with: iframe
tagged with: youtube-api
has body: I'm trying to put this code in an module function: $(document).ready(function() { VIDEO.onYouTubeIframeAPIReady(); } var VIDEO = (function (my, $){ var tag = document.createElement('script'); var onPlayerStateChange; tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; my.onYouTubeIframeAPIReady =function() { player = new YT.Player('player', { height: '490', width: '880', videoId: SONG.getArtistId(), playerVars: { controls:1, showinfo: 0, rel: 0, showsearch: 0, iv_load_policy: 3 }, events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange, 'onError': catchError } }); } function onPlayerReady(event) { if(typeof(SONG.getArtistId()) == undefined) { console.log("undefineeeed"); } event.target.playVideo(); } var done = false; function onPlayerStateChange(event) { if (event.data == YT.PlayerState.PLAYING &amp;&amp; !done) { // setTimeout(stopVideo, 6000); done = true; } if(event.data == YT.PlayerState.ENDED) { location.reload(); } } function catchError(event) { if(event.data == 100) console.log("De video bestaat niet meer"); } function stopVideo() { player.stopVideo(); } return my; }(VIDEO || {}, jQuery)); The problem is: even it's self-executing, nothing happens and the iFrame is not shown. I'm trying to do this because it's part of an assignment. We have to work in modules.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44670891
has title: Youtube iFrame API 'YT is undefined'
type: Question
has comment: http://stackoverflow.com/comment/44671276
has answer: http://stackoverflow.com/a/28153781

http://stackoverflow.com/comment/44651457
comment on: http://stackoverflow.com/q/28139972
type: Comment
has text: yeah just access it there, what is the issue
score: 3
type: QuestionComment

http://stackoverflow.com/comment/44668694
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28146745
has text: @BenjaminGruenbaum: That's a point, namely that my code will miss messages when two of them are dispatched synchronously! This means that the rest of my question, namely in which order processing takes place, becomes irrelevant.

http://stackoverflow.com/comment/44814181
has text: You're looking for something like: `document.getElementsByTagName('tr').length`?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28225439
type: QuestionComment

http://stackoverflow.com/comment/77932733
type: QuestionComment
comment on: http://stackoverflow.com/q/28158021
score: 0
has text: What is the use case for this kind of behaviour? What is the benefit, especially for users?
type: Comment

http://stackoverflow.com/comment/44864172
type: Comment
comment on: http://stackoverflow.com/a/28226346
has text: @Noah If you're getting `undefined`, that almost surely means that you're not returning anything from your functions. For example, you're not returning anything from the `getUserData` and `getVideoData` functions you showed us. I can only presume that the rest of your functions are similar. Not only does this mean that they won't pass a value forward, it _also_ means that you won't be able to await them. The promise chain will just go on to the next item in the chain.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/44798204
comment on: http://stackoverflow.com/q/28215821
type: QuestionComment
type: Comment
has text: I'm just assuming that you're using some serverside language in which you can change the html that will be sent to the browser.
score: 0

http://stackoverflow.com/comment/44954705
comment on: http://stackoverflow.com/a/28257330
score: 0
type: AnswerComment
has text: One question: How do I send the value of `` to --> ` `? The way it is now, the value of the `input` is null, but on the Dropbox example listed above, the `input` value is equal to the `` value.
type: Comment

http://stackoverflow.com/q/28176725
tagged with: highcharts
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28177277
has body: I need to create 9 pie charts with the same options in a single page, I'm using the following function to create them: function newChart(series_id, div_name) { this.chart = { height: 450, marginBottom: 70 }, this.title = { floating: true }, this.subtitle = { floating: true }, this.legend = pie_legend, this.tooltip = tooltip_, this.plotOptions = { pie: { showInLegend: true, size: '100%', borderWidth: 2, borderColor: 'black', point: { events: { mouseOut: function () { setTranslation(this, false); }, mouseOver: function () { setTranslation(this, true); }, click: function () { var drilldown = this.drilldown; if (isNumber(drilldown)) { chart3.series[0] = chart3.drilldown.series[drilldown]; require(['jquery', 'charts'], function ($, charts) { $(function () { var tempScrollTop = $(window).scrollTop(); charts.pie(div_name, chart3); $(window).scrollTop(tempScrollTop); }); }); chart3.colors = chart_colors; } else { chart3.series[0] = series_id.series[0]; require(['jquery', 'charts'], function ($, charts) { $(function () { var tempScrollTop = $(window).scrollTop(); charts.pie(div_name, chart3); $(window).scrollTop(tempScrollTop); }); }); chart3.colors = ["#FF7070", "#FFC870", "#B0DDC2", "#82CA9D", "#409661"]; } } } }, dataLabels: { enabled: false } }, series: { dataLabels: { style: { fontWeight: 'bold', fontSize: '16px' } } } }, this.colors = ["#FF7070", "#FFC870", "#B0DDC2", "#82CA9D", "#409661"], this.series = [], this.drilldown = { series: [] } } ; On the click event I want to use the same object I'm creating to create the functions. However I can't find a way to make it dynamic, if I manually change chart3 for chartX, they're individually created correctly and work correctly. My question is how do I get the chart object inside the click function, I can't use 'this' because in that scope it's retrieving a point in the chart (a slice of a pie chart in this case). So I want to get something like: click: function () { var drilldown = this.drilldown; if (isNumber(drilldown)) { …
accepted answer: http://stackoverflow.com/a/28177277
downvote count: 0
has title: Highcharts - Getting chart on click event
type: Question
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44722678
upvote count: 1

http://stackoverflow.com/a/28163080
has comment: http://stackoverflow.com/comment/44775146
has body: Try giving min-width and min-height a try. min-width: 100%; min-height: 100%;
score: 0
answers question: http://stackoverflow.com/q/28162888
type: Answer

http://stackoverflow.com/a/28174791
has comment: http://stackoverflow.com/comment/44718915
has comment: http://stackoverflow.com/comment/44719328
accepted answer of: http://stackoverflow.com/q/28174748
type: AcceptedAnswer
score: 1
answers question: http://stackoverflow.com/q/28174748
has body: Use .height(): $('.page').height(page_height);
type: Answer
upvote count: 2
downvote count: 1

http://stackoverflow.com/q/28262345
tagged with: token
has comment: http://stackoverflow.com/comment/44881781
has body: I am new to JWT, I am trying to create a simple JWT in javascript, send it to a controller (using web-api), check it in sql database. when I googled the net I found a examples like: //HEAD {"typ":"JWT", "alg":"HS256"} //claims { "Id": 445566, "name": "Meme Jhon", "password": "ticktack" } //and signature. I want to create in Javascript my First JWT but i feel something is missing.. what is the full structure? it's not seem logical to start only with the head (like example above..)I need a full example or explaination or a link to a full example. Thank you
answer count: 1
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/44881747
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44882550
has title: How to create JWT in Javascript
score: 3
tagged with: json-web-token
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/44883252
has comment: http://stackoverflow.com/comment/44887278
has comment: http://stackoverflow.com/comment/133691836
downvote count: 0
has answer: http://stackoverflow.com/a/28266110
tagged with: javascript
has comment: http://stackoverflow.com/comment/133710816

http://stackoverflow.com/q/28232312
has comment: http://stackoverflow.com/comment/44827846
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44827410
has title: Get dynamic Class Names
has comment: http://stackoverflow.com/comment/44828778
tagged with: getelementsbyclassname
has comment: http://stackoverflow.com/comment/44828992
type: Question
has comment: http://stackoverflow.com/comment/44827535
tagged with: javascript
tagged with: dom-events
has comment: http://stackoverflow.com/comment/125943000
score: 0
has comment: http://stackoverflow.com/comment/44826772
tagged with: http://stackoverflow.com/tag/html
has body: For testing I have the alert, so the problem seem to be before the alert. it throws errors at: var firstPrevClass= &quot;categClass&quot;+PrevClass; var newCategory = document.getElementsByClassName(firstPrevClass); Uncaught TypeError: undefined is not a function Basically in function addCategory I want to create dynamically new divs with different class names (which is creating dynamically). After that I want to append the new category after the last category. In function addField I want to put a new field at the category which selected from the selection box. In function getClass I get the selected className so I can create a new field in the selected div. How to do it? /*add new category to SelextBox*/ function addCategory() { var categoryValue = document.getElementById("newCateg").value; var y = document.getElementById('selectCategory'); var option = document.createElement("option"); var hid = document.getElementById("nextValue").value; var newClass = "categClass" + hid; option.setAttribute("class", newClass); option.value = categoryValue; option.text = categoryValue; y.add(option); var PrevClass = hid-1 ;/*i do this to get the first previous class*/ var firstPrevClass= "categClass"+PrevClass; alert(newClass); var newCategory = document.getElementsByClassName(firstPrevClass); var div = document.createElement('div'); div.setAttribute('class',newClass ); var a = document.createElement('a'); a.setAttribute('class', 'titles'); var input_checkC = document.createElement('input'); input_checkC.setAttribute('type', 'checkbox'); input_checkC.setAttribute('class', 'check'); var textNodeCateg = document.createTextNode(categoryValue); div.appendChild(a); div.appendChild(input_checkC); div.appendChild(textNodeCateg); var last = newCategory.length; newCategory[last].appendChild(div); document.getElementById("nextValue").value++; alert(newClass); } function getClass(sel) { var x =sel.options[sel.selectedIndex].className; document.getElementById("submitSelection").value=x; } fu…

lodash
tags question: http://stackoverflow.com/q/28268380
tags question: http://stackoverflow.com/q/28244883
tags question: http://stackoverflow.com/q/28242987
tags question: http://stackoverflow.com/q/28221165
tag name: lodash
tags question: http://stackoverflow.com/q/28266912
type: Tag
tags question: http://stackoverflow.com/q/28267501
tags question: http://stackoverflow.com/q/28213295
tags question: http://stackoverflow.com/q/28267852
tags question: http://stackoverflow.com/q/28238963
tags question: http://stackoverflow.com/q/28184948
tags question: http://stackoverflow.com/q/28265516
tags question: http://stackoverflow.com/q/28273300

mouseover
tags question: http://stackoverflow.com/q/28127097
tags question: http://stackoverflow.com/q/28232422
tags question: http://stackoverflow.com/q/28181832
tags question: http://stackoverflow.com/q/28222396
tags question: http://stackoverflow.com/q/28189360
type: Tag
tag name: mouseover
tags question: http://stackoverflow.com/q/28169758

http://stackoverflow.com/comment/44696518
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28162171
has text: Especially useful for short elements: `var alphabet = "abcdefghijklmnopqrstuvwxyz".split("")` instead of `["a", "b", …]`

http://stackoverflow.com/a/28225852
has comment: http://stackoverflow.com/comment/44814948
score: 0
has body: in your js file add the following $(document).ready(function() { $('.src_date').datepicker({ format: 'yyyy-mm-dd', autoclose: true }) ; this might help you
type: Answer
answers question: http://stackoverflow.com/q/28222430

http://stackoverflow.com/q/28250625
favorite count: 0
has title: Call JavaScript method in Chrome extension from web page button click
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28258231
has comment: http://stackoverflow.com/comment/44861266
upvote count: 0
type: Question
tagged with: javascript
score: -1
has body: I have a add this chrome extension in to Chrome. I took the extension code from here. Now I want to trigger this extension from my web page "tack shot" button click something like following: take shot Can anybody help me to resolve this?
linked to: http://stackoverflow.com/q/26090563
tagged with: google-chrome-extension
answer count: 1
downvote count: 1
tagged with: dom-events

http://stackoverflow.com/a/28213688
score: 0
type: Answer
upvote count: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28213613
answers question: http://stackoverflow.com/q/28213613
has body: You can prevent from right click like $(document).bind('contextmenu', function (e) { e.preventDefault(); alert('Right Click is not allowed'); }); Demo
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44790880

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/28234496
tags question: http://stackoverflow.com/q/28133763
tags question: http://stackoverflow.com/q/28185881
tags question: http://stackoverflow.com/q/28179214
tags question: http://stackoverflow.com/q/28172849
tags question: http://stackoverflow.com/q/28198832
tags question: http://stackoverflow.com/q/28228963
tags question: http://stackoverflow.com/q/28257909
tags question: http://stackoverflow.com/q/28190910
tags question: http://stackoverflow.com/q/28189109
tags question: http://stackoverflow.com/q/28234004
tags question: http://stackoverflow.com/q/28204923
tags question: http://stackoverflow.com/q/28149857
tags question: http://stackoverflow.com/q/28270350
tags question: http://stackoverflow.com/q/28232333
tags question: http://stackoverflow.com/q/28243431
tags question: http://stackoverflow.com/q/28155279
tags question: http://stackoverflow.com/q/28133976
tag name: svg
tags question: http://stackoverflow.com/q/28166351
tags question: http://stackoverflow.com/q/28130824
tags question: http://stackoverflow.com/q/28129956
tags question: http://stackoverflow.com/q/28217217
tags question: http://stackoverflow.com/q/28130411
tags question: http://stackoverflow.com/q/28243011
tags question: http://stackoverflow.com/q/28226677
tags question: http://stackoverflow.com/q/28188522
tags question: http://stackoverflow.com/q/28259167
tags question: http://stackoverflow.com/q/28186109
tags question: http://stackoverflow.com/q/28195197
tags question: http://stackoverflow.com/q/28179576
tags question: http://stackoverflow.com/q/28149730
tags question: http://stackoverflow.com/q/28249941
tags question: http://stackoverflow.com/q/28213417
tags question: http://stackoverflow.com/q/28267275
tags question: http://stackoverflow.com/q/28156873
tags question: http://stackoverflow.com/q/28201029
tags question: http://stackoverflow.com/q/28169026
tags question: http://stackoverflow.com/q/28235792
tags question: http://stackoverflow.com/q/28140800
tags question: http://stackoverflow.com/q/28124373
tags question: http://stackoverflow.com/q/28149832
tags question: http://stackoverflow.com/q/28150414
tags question: http://stackoverflow.com/q/28240796
tags question: http://stackoverflow.com/q/28231327
tags question: http://stackoverflow.com/q/28195193
tags question: http://stackoverflow.com/q/28197121
tags question: http://stackoverflow.com/q/28276964
tags question: http://stackoverflow.com/q/28270661
type: Tag
tags question: http://stackoverflow.com/q/28246742

http://stackoverflow.com/comment/44873976
comment on: http://stackoverflow.com/q/28257914
type: Comment
type: QuestionComment
score: 2
has text: possible duplicate of [Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference](http://stackoverflow.com/questions/23667086/why-is-my-variable-unaltered-after-i-modify-it-inside-of-a-function-asynchron)

http://stackoverflow.com/comment/44635839
type: AnswerComment
type: Comment
has text: to manage user information such as send a message to all users in the system (if you could kindly assist me with that as well I will be unbelievably grateful), and other task that shouldn't be allowed by the user. I just do not want any user who register to be able to access that page but only certain user
comment on: http://stackoverflow.com/a/28131206
score: 0

http://stackoverflow.com/a/28198257
answers question: http://stackoverflow.com/q/28187962
score: 1
has comment: http://stackoverflow.com/comment/44764809
accepted answer of: http://stackoverflow.com/q/28187962
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44765159
type: Answer
has comment: http://stackoverflow.com/comment/44764489
upvote count: 1
has body: First, the Fiddle isn't working because you have it set to load your javascript onLoad which is wrapping your functions in a different scope and so they aren't available on the window. Changing it to load the javascript No wrap - in &lt;head&gt; (or &lt;body&gt;) will help it work. Then you need to have something that is checking for the value and enabling disabling the minus button. function checkTotal() { var moneyTotal = +document.getElementById('money-total').innerHTML; var cost = +document.getElementById('cost').innerHTML; if (cost &gt; moneyTotal) { document.getElementById('minus').setAttribute('disabled', 'disabled'); } else { document.getElementById('minus').removeAttribute('disabled'); } } Then you would need to call this at the end of the add, minus, and even the function you have defined in setInterval so that as money gets added it checks. This code only adds the disabled attribute to the button, so any styling would need to be handled either by the code or through CSS and setting/removing class names or something similar. There are perhaps different ways to do this through data binding or using an event model as part of a framework, but those are a more substantial topic that can't really be covered in this answer.

http://stackoverflow.com/comment/44759946
has text: Oh you want newid to increase. Not just idnumber. Sorry. You should assign a new value to newid inside you click function
comment on: http://stackoverflow.com/q/28196602
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28136812
has body: Preceding the alert with the transformation to a number (JavaScript Number() Function) will fill theNumber with what is indeed a number: var theNumber = Number(prompt("Pick a number", "")); alert(theNumber + 10 + " sums to your number");
score: 0
answers question: http://stackoverflow.com/q/28136677
has comment: http://stackoverflow.com/comment/44645825
has comment: http://stackoverflow.com/comment/44645634
type: Answer

http://stackoverflow.com/comment/44692540
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28160602
type: Comment
has text: What is an assumed variable?

http://stackoverflow.com/q/28206205
upvote count: 1
has title: Solution to add zero in output URL
has answer: http://stackoverflow.com/a/28206426
downvote count: 1
type: Question
has body: I need a script for adding zeros after URL like shown below.. The zeros should keep on adding for the next one :) https://www.google.co.in/?gws_rd=ssl=0 https://www.google.co.in/?gws_rd=ssl=00 https://www.google.co.in/?gws_rd=ssl=000 https://www.google.co.in/?gws_rd=ssl=0000 I did try this but no use. function randomString(length, chars) { var result = ''; for (var i = length; i &gt; 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))]; return result; } var rString = randomString(32, '0');
has answer: http://stackoverflow.com/a/28206608
has comment: http://stackoverflow.com/comment/44778167
answer count: 3
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/28206325
type: UnansweredQuestion

http://stackoverflow.com/comment/44828245
has text: Please take a look a this: http://stackoverflow.com/questions/5359224/parsererror-after-jquery-ajax-request-with-jsonp-content-type , it seems you are experiencing the same issue. Are you returning the value correctly?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28232794
type: QuestionComment

http://stackoverflow.com/comment/44775106
type: QuestionComment
has text: `$` is the jQuery object alias, so there is jQuery present here. Make sure you have it included in the ` ` element (and is the first thing you import if jQuery libraries are also being used).
comment on: http://stackoverflow.com/q/28204251
score: 0
type: Comment

http://stackoverflow.com/a/28206167
has body: I'm not completely understand you question, and also not an expert as @PSL in angular. If you just want to pass some data into the controller, maybe below code can help you. I copied a piece of code from the project: .state('masthead.loadTests.test',{ url: '/loadTests/:id', templateUrl: 'load-tests/templates/load-test-entity.tpl.html', controller: 'loadTestEntityCtrl', data: { pageTitle: 'loadTests', csh: '1005' }, resolve: { // Get test entity data before enter to the page (need to know running state) LoadTestEntityData: [ '$stateParams', '$state', 'LoadTestEntity', 'LoggerService', '$rootScope', function ($stateParams, $state, LoadTestEntity, LoggerService, $rootScope) { // Get general data return LoadTestEntity.get({id: $stateParams.id},function () { }, // Fail function () { // When error navigate to homepage LoggerService.error('error during test initiation'); $state.go('masthead.loadTests.list', {TENANTID: $rootScope.session.tenantId}); }).$promise; } ] } }) Here the LoadTestEntityData is the data we injected into the controller, LoadTestEntity and LoggerService are services needed for building the data. .factory('LoadTestEntity', ['$resource', function ($resource) { return $resource( '/api/xxx/:id', {id: '@id'}, { create: {method: 'POST'}, update: {method: 'PUT'} } ); }]) Hope it helps!
type: Answer
answers question: http://stackoverflow.com/q/28205914
score: 0

http://stackoverflow.com/a/28137179
downvote count: 0
score: 7
accepted answer of: http://stackoverflow.com/q/28134271
has comment: http://stackoverflow.com/comment/44653663
upvote count: 7
type: AcceptedAnswer
has body: Any helper function with promise looping I have seen actually made it much worse than what you can do out of the box with recursion. It is a little nicer with .thenReturn but yeah: function readFile(index) { return new Promise(function(resolve) { setTimeout(function() { console.log("Read file number " + (index +1)); resolve(); }, 500); }); } // The loop initialization Promise.resolve(0).then(function loop(i) { // The loop check if (i &lt; len) { // The post iteration increment return readFile(i).thenReturn(i + 1).then(loop); } }).then(function() { console.log("done"); }).catch(function(e) { console.log("error", e); }); See it in jsfiddle http://jsfiddle.net/fd1wc1ra/ This is pretty much exactly equivalent to: try { for (var i = 0; i &lt; len; ++i) { readFile(i); } console.log("done"); } catch (e) { console.log("error", e); } If you wanted to do nested loops it is exactly the same: http://jsfiddle.net/fd1wc1ra/1/ function printItem(item) { return new Promise(function(resolve) { setTimeout(function() { console.log("Item " + item); resolve(); }, 500); }); } var mdArray = [[1,2], [3,4], [5,6]]; Promise.resolve(0).then(function loop(i) { if (i &lt; mdArray.length) { var array = mdArray[i]; return Promise.resolve(0).then(function innerLoop(j) { if (j &lt; array.length) { var item = array[j]; return printItem(item).thenReturn(j + 1).then(innerLoop); } }).thenReturn(i + 1).then(loop); } }).then(function() { console.log("done"); }).catch(function(e) { console.log("error", e); });
has comment: http://stackoverflow.com/comment/44653645
has comment: http://stackoverflow.com/comment/60922623
type: Answer
answers question: http://stackoverflow.com/q/28134271

http://stackoverflow.com/comment/44900369
score: 0
has text: Either you can add a script block after the html region that gets updated and assign the new value to the variable or you can add a polling to your page which continuously monitor the value change.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28272614

http://stackoverflow.com/comment/44927968
comment on: http://stackoverflow.com/a/28285928
type: AnswerComment
has text: @slicetoad - Thanks for the comprehensive answer. I will look at this tonight and let you know!
score: 0
type: Comment

http://stackoverflow.com/a/28272281
answers question: http://stackoverflow.com/q/28271986
score: 0
has body: Why are you binding the autocomplete on keyup.... Rather you should bind it once. Also, before rebinding it you shoud destroy the existing instance.
type: Answer

http://stackoverflow.com/q/28143421
has title: AngularJS Problems with FileReader and $scope.$watch?
has answer: http://stackoverflow.com/a/28143464
favorite count: 0
tagged with: angularjs
upvote count: 1
tagged with: filereader
accepted answer: http://stackoverflow.com/a/28143464
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28143806
score: 1
has answer: http://stackoverflow.com/a/28143806
type: Question
has body: I've got a weird one (for me at least) that hopefully someone will be able to help with. Maybe I'm just thinking about this the wrong way or something. Attempting to work with files in javascript is completely new to me. I've got a directive whose template looks like this: Upload In the controller for the directive, I am doing this: $scope.onFileSelect = function() { reader = new FileReader(); reader.onload = function() { $scope.file_contents = this.result; }; reader.readAsArrayBuffer($scope.files[0]); //debugger; $scope.$watch('file_contents',function(file_contents) { console.log(file_contents); if (angular.isDefined(file_contents)) { ... bunch of code attempting to deal with file_contents ... } }); }; I choose a file, then click the Upload button. The console.log of (file_contents) is undefined. Only when I click the button the second time, does it have a value. If I uncomment the debugger, $scope.file_contents has a value by the time I'm checking it. So, file_contents takes a moment to get set (which is expected), but the $watch never seems to notice? Is there some strange reason for this? Does $watch not work with FileReader objects? Edit 1: Okay. Here's some more information. Following PSL's advice, I now have the code as such: $scope.onFileSelect = function() { reader = new FileReader(); reader.onload = function() { file_contents = this.result; upload_file($scope.files[0],file_contents); }; reader.readAsArrayBuffer($scope.files[0]); }; upload_file = function(file,file_contents) { <lots of cool file_contents-y stuff> }; Why am I still getting $digest errors? I have no $watches any more. I don't do anything with $scope within upload_file. There's no stack trace from the $digest error to help me, either. All I get is: Error: [$rootScope:inprog] $digest already in progress http://errors.angularjs.org/1.3.0-beta.10/$rootScope/inprog?p0=%24digest What's doing this?
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/44732540
comment on: http://stackoverflow.com/a/28173762
type: Comment
has text: @Jashwant Hi, I'm glad you liked it :-) You're right I didn't provide enough detail to go with my answer. Now I have updated my answer with some logic on how to code works - I hope it helps. If you still have questions, then just let me know, and I'll try give some more insight how the code works.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28180470
tagged with: angularjs
type: Question
score: 0
answer count: 1
has title: Passing a factory return value to view in Angularjs
tagged with: angularjs-scope
accepted answer: http://stackoverflow.com/a/28180550
tagged with: javascript
type: AnsweredQuestion
has body: I have a html view, angularjs controller and a authentication service. Here is the code: Index.html: Base.html: Logged in as {{user.username}} Login app.js: $stateProvider .state('base', { url: "", templateUrl: "Base.html", resolve: { user : function(AuthSvc){ AuthSvc.isLoggedIn().then(function(res){ return res; }, function(res){ return res; }); } }, controller: 'PanelCtrl' }) Controller.js: appControllers .factory("AuthSvc", ['$http', '$q', 'messageCenterService', '$rootScope', '$state', function ($http,$q, messageCenterService,$rootScope, $state) { return { login: function (credentials, form) { var defer = $q.defer(); $http.post('/api/auth/login', credentials) .success(function (response) { form.$setPristine(); messageCenterService.remove(); messageCenterService.add('success', 'You are now logged in!', {status: messageCenterService.status.next }); $state.go('base.posts.content'); defer.resolve(response); }) .error(function (response) { messageCenterService.remove(); messageCenterService.add('danger', response.flash, {status: messageCenterService.status.unseen}); defer.reject(); }); return defer.promise; }, isLoggedIn: function () { var defer = $q.defer(); $http.get('api/auth/check').success( function (res) { defer.resolve(res); }).error(function (err) { defer.reject(false); }); return defer.promise; }, appControllers.controller('PanelCtrl', ['$scope', 'user', 'AuthSvc', 'vcRecaptchaService', '$idle', function ($scope, user, AuthSvc, vcRecaptchaService, $idle, ) { $scope.user = user; $scope.credentials = {"email": "", "password": "", "remember": ""}; $scope.login = function (form) { AuthSvc.login($scope.credentials, form) .then(function(res){ $scope.user = res; }); }; After the page loads a user property is resolved in the state configuration and this is available in the html as a scope property. The problem I am having is when the user logins the user property on the scope is not updating, previously I had the user property on the $rootScope but I want it to becom…
has answer: http://stackoverflow.com/a/28180550

http://stackoverflow.com/comment/44665695
score: 0
comment on: http://stackoverflow.com/q/28137908
type: Comment
type: QuestionComment
has text: It could be as simple as `$.post('@Url.Action("yourActionName", "yourControllername")', $('form').serialize(), function (data) { // do something });`

http://stackoverflow.com/q/28209499
tagged with: http://stackoverflow.com/tag/html
has title: How to select a particular part of the div using jQuery?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28209535
type: Question
has comment: http://stackoverflow.com/comment/44783675
score: -2
has answer: http://stackoverflow.com/a/28209535
has body: This is my HTML: admin: ok bye Me: good bye. I want to select: Me: good bye. I tried using: $(this).find('.from').last().text(); But this returns: Me:
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44783673
downvote count: 3

http://stackoverflow.com/a/28324193
accepted answer of: http://stackoverflow.com/q/28234498
answers question: http://stackoverflow.com/q/28234498
has body: There are lots of methods to get a user's authentication information and then use that to request an AuthID from your report server. It depends on what functionality you want to give your user. If your users only need read access you can lock down the user account on your server. Use HTTPS to reach the report server for better security.
has comment: http://stackoverflow.com/comment/45188624
has comment: http://stackoverflow.com/comment/45005419
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44627745
type: Comment
has text: Jahh, many thanks, nightly.mozilla.org, fine works **THE** event.keyCode, BUT the AltLeft not released by release, but must press again. Is it a bug, or system setup problem?... This button the prefix for menu hotkeys, sorry... We had better use window.addEventListener(), because it supplies control button events, too.
type: QuestionComment
comment on: http://stackoverflow.com/q/28124405
score: 0

http://stackoverflow.com/comment/44830972
type: QuestionComment
has text: That's why add a new element with some id, and use that element to display the message text instead of your password text box.
comment on: http://stackoverflow.com/q/28232582
score: 0
type: Comment

http://stackoverflow.com/comment/44723900
score: 0
type: AnswerComment
type: Comment
has text: it displays the values and empty stars... not working... :-( Anyway thanks for your support.
comment on: http://stackoverflow.com/a/28174854

http://stackoverflow.com/comment/44803970
has text: I think that code is from ESAPI4JS, is it not? I do not have access to that library.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28220288
type: AnswerComment

http://stackoverflow.com/q/28242393
has body: I have a html table. the rows of this table are generated automatically by aangular js ng-repeat. I want to get values of each row and column of that table in c# codebehind. Here is my aspx code: Name Quantity {{aMedicine.Name}} {{aMedicine.Quantity}} and script is here: how i get the added rows of the table in c# codebehind?
type: UnansweredQuestion
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44845929
has answer: http://stackoverflow.com/a/28243563
has comment: http://stackoverflow.com/comment/44845621
score: -1
has comment: http://stackoverflow.com/comment/44845854
has comment: http://stackoverflow.com/comment/44845530
answer count: 1
tagged with: javascript
tagged with: asp.net
favorite count: 0
tagged with: angularjs
downvote count: 1
has title: how I get the values of each row and column of a html table in c# codebehind which are dynamically generated by angularjs ng-repeat
upvote count: 0

http://stackoverflow.com/a/28198173
type: Answer
has comment: http://stackoverflow.com/comment/44783507
answers question: http://stackoverflow.com/q/28198049
score: 0
has body: Your code was with a "," Try this: plotOptions : { series : { colorByPoint : true, pointPadding : 0, groupPadding : 0 } }, Here is your demo: http://jsfiddle.net/zgypy32h/5/ http://jsfiddle.net/zgypy32h/4/

http://stackoverflow.com/q/28183621
answer count: 3
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/87987399
tagged with: jquery
has title: How can I detect if text is paste using right-click
has comment: http://stackoverflow.com/comment/87988368
favorite count: 0
has answer: http://stackoverflow.com/a/28184119
has body: If I paste text using ctrl c and ctrl v on table1(For example on "Apple"), duplicate text on input on table2 still change, but If i paste using right click and paste,duplicate input on table 2 does NOT change. :( Ive created two different event(keyup and change) but nothing seems to work when text is paste using right click. Please see below : Keypress fiddle demo $(document).off('keydown').on('keydown', $('#table1 tbody tr td input:eq(0)'), function (e) { var oldValue =$(e.target).val();//get the input value before keypress or edit $(document).on('keyup', $('#table1 tbody tr td input'),function(e){ $('#table2').find('td input').each(function(){ if($(this).val() === oldValue){ $(this).val($(e.target).val()); } $(document).off('keyup'); }); }); }); on change fiddle demo var oldValue; $(document).on('keydown', '.main', function (e) { oldValue = $(this).val(); foo(oldValue); }); var newValue; $(document).on('keyup', '.main', function (e) { newValue = $(this).val(); foo(oldValue); }); function foo(oldValue) { $('#table1').find('tbody tr').find('td input').change(function (i) { var orig = $(this).val(); $('#table2 tbody tr').find('td input').each(function (i) { if (oldValue == $(this).val()) { $(this).val(orig); } }); }); }
linked to: http://stackoverflow.com/q/28422338
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28184104
tagged with: css
has comment: http://stackoverflow.com/comment/87986090
has comment: http://stackoverflow.com/comment/44736650
downvote count: 0
accepted answer: http://stackoverflow.com/a/28184041
type: Question
possible better answer: http://stackoverflow.com/a/28184119
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28184041

http://stackoverflow.com/q/28236834
tagged with: knockout.js
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28240082
type: UnansweredQuestion
has body: I currently have the following objects that I am using to map some JSON data to: function Regions() { var self = this; self.regions = ko.observableArray([]); self.addRegion = function () { // add a region }; self.removeRegion = function (region) { // remove a region }; } function Region() { var self = this; self.region = ko.observable(""); self.products = new Products(); } function Products() { var self = this; self.products = ko.observableArray([]); self.addProduct = function () { // add a product }; self.removeProduct = function (product) { // remove a product }; } function Product() { var self = this; self.name = ko.observable(""); self.price = ko.observable(""); } I am attempting to map the JSON response from the server by doing: ko.mapping.fromJS(appViewModel, {}, new Regions()); This is working fine except for that the functions on the Products object are being overwritten by the mapping plugin whereas the functions on the Regions object are still there. Is there a way of doing this so that I can keep my functions on the Products object?
tagged with: knockout-mapping-plugin
upvote count: 1
has comment: http://stackoverflow.com/comment/44835941
score: 1
has title: knockoutjs mapping plugin removing functions from objects

http://stackoverflow.com/comment/44878350
type: Comment
type: QuestionComment
has text: I personally would recommend python for this. Regular expression would cut down your work load.
comment on: http://stackoverflow.com/q/28258579
score: 0

http://stackoverflow.com/a/28280801
has body: I want to thank everyone for their input, but the working solution that I found was to modify the bootstrap JS to allow for an autofocus on toggleClass of the OPEN for the dropdowns. Everyone gets kudos!
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28279796

http://stackoverflow.com/comment/44789017
has text: @MadBrozzeR: *"To win a small bit of performance while iterating..."* I can't see any gain by using your own object over a native array, can you explain where you think you'll get that gain? *"...or just not to have it overloaded with extra methods."* The "extra" methods don't "load" individual array instances in any way at all. Individual array instances have only their own properties, the "extra" methods are on the *prototype* that sits behind them. There is zero cost associated with them on a per-object basis.
type: QuestionComment
comment on: http://stackoverflow.com/q/28210667
score: 1
type: Comment

http://stackoverflow.com/comment/44653887
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28141020
type: Comment
has text: @Ben - what is "using bind to create instances of functions on the prototype". I don't understand what that phrase means. Your code illustrates using `.bind()` in the constructor to create a temporary stub function that always uses this object when it is called. That new "bound" function is a local variable used only inside the constructor.

http://stackoverflow.com/a/28209513
type: Answer
has comment: http://stackoverflow.com/comment/44783690
has body: I don't believe you can request specific portions of a web page. JSoup is basically a web client class, and the web client has no control over what the server sends it. The server is the one that dictates what is sent, so you can't really request a segment of a webpage without requesting the entire web page. Do you have access to this webpage, or is it an external website?
has comment: http://stackoverflow.com/comment/44785720
score: 0
answers question: http://stackoverflow.com/q/28209398
has comment: http://stackoverflow.com/comment/44783649

facebook-javascript-sdk
tags question: http://stackoverflow.com/q/28204107
tags question: http://stackoverflow.com/q/28201454
tags question: http://stackoverflow.com/q/28268488
tag name: facebook-javascript-sdk
tags question: http://stackoverflow.com/q/28218321
type: Tag

http://stackoverflow.com/comment/44762996
type: QuestionComment
comment on: http://stackoverflow.com/q/28183161
score: 0
type: Comment
has text: this is the problem : http://plnkr.co/edit/9Ndmv6R0ebWWNN6Ab3yz

video
tags question: http://stackoverflow.com/q/28208332
type: Tag
tags question: http://stackoverflow.com/q/28203617
tags question: http://stackoverflow.com/q/28270458
tags question: http://stackoverflow.com/q/28129741
tags question: http://stackoverflow.com/q/28123766
tags question: http://stackoverflow.com/q/28270365
tags question: http://stackoverflow.com/q/28255035
tags question: http://stackoverflow.com/q/28165333
tags question: http://stackoverflow.com/q/28262934
tag name: video
tags question: http://stackoverflow.com/q/28189400
tags question: http://stackoverflow.com/q/28134517
tags question: http://stackoverflow.com/q/28225743
tags question: http://stackoverflow.com/q/28195567
tags question: http://stackoverflow.com/q/28204016

http://stackoverflow.com/q/28137714
answer count: 1
tagged with: javascript
favorite count: 0
has body: I know how to get longitude and latitude via HTML5 on mobile phone. But problem is how to get user's location everytime before user access google map on my site (locations/map). I need it because I'm using haversine sql to collect data up to 100km around user's location. I was thinking about submitting form with longitude and latitude values, but is is not really efficient since user can directly open url of map (locations/map) and then no values will be posted. Problem is that I have to use javascript to get lat and lng values, but I'm not sure what is the best way to send ti to sql query Haversine SQL select("6371 * acos(cos(radians(:MOJLAT)) * cos(radians(geolat)) * cos(radians(geolong) - radians(:MOJLONG)) + sin(radians(:MOJLAT)) * sin(radians(geolat)) )) AS distance_query HAVING distance_query &lt;= 100"); addParams([':MOJLAT'=&gt;$_POST["geolat_beforeaction"], ':MOJLONG'=&gt;$_POST["geolong_beforeaction"]]); HTML5 geolocation if(navigator.geolocation) { var options= { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }; navigator.geolocation.getCurrentPosition ( function(position) { find(position); }, function() { //handleNoGeolocation(true); }, options ); } function find(position) { //data to post to database. fill input fields with longitude and latitude var geoLat, geoLong; if(geoLat=$("#geolat")) { geoLat.val(position.coords.latitude); } if(geoLong=$("#geolong")) { geoLong.val(position.coords.longitude); } }
tagged with: http://stackoverflow.com/tag/html
has title: Getting longitude and latitude of user before action
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28138226
tagged with: php
downvote count: 1
type: Question
score: -1
tagged with: google-maps
upvote count: 0

http://stackoverflow.com/comment/44665086
has text: This also works very nice, but the CSS transition rule is surely more lightweight. But I'll consider UI if I'll need more effects. By the way, is there any way to animate a disappearing DIV (adding hidden class), when the resizing DIV below also moves up?
comment on: http://stackoverflow.com/a/28141778
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44677466
has text: _"I tried using if(isset($_POST['getid']))) but that causes a ton of issues on the php side."_ - What errors did this cause? The code should have been wrapped in the `if` block to stop further execution if `getid` is not defined. Then optionally, log the error or handle a case where `getid` is not defined.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28153017
type: QuestionComment

http://stackoverflow.com/a/28198666
accepted answer of: http://stackoverflow.com/q/28198596
score: 20
type: Answer
answers question: http://stackoverflow.com/q/28198596
has comment: http://stackoverflow.com/comment/44764434
has comment: http://stackoverflow.com/comment/44765501
upvote count: 20
has comment: http://stackoverflow.com/comment/44763889
has comment: http://stackoverflow.com/comment/44764174
type: AcceptedAnswer
downvote count: 0
has body: try adding quotes, as: var pro = $('#properties').find("option[value='"+user_property.replace(' ','-')+"']"); or better break it down to: var replaced = user_property.replace(' ','-'); var pro = $('#properties').find("option[value='"+replaced+"']"); if you want to check for text like "property name" then you could directly do: var pro = $('#properties').find("option[value='"+user_property+"']");

http://stackoverflow.com/a/28165581
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28163274
answers question: http://stackoverflow.com/q/28163274
type: Answer
upvote count: 4
downvote count: 0
score: 4
has body: You are getting this error because you are calling sendMail inside the onEdit() trigger. You cannot call URLFetch or MailApp methods inside onEdit.

http://stackoverflow.com/q/28237031
score: 0
downvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/5404839
favorite count: 0
has answer: http://stackoverflow.com/a/28237108
accepted answer: http://stackoverflow.com/a/28237108
type: AnsweredQuestion
has title: Jquery Countdown from x seconds to 0 in format hh:mm:ss
type: Question
has body: I have multiple html elements with the class "countdown": 00:01:35 00:00:30 and so on.. Now I want make a timer that countdown the value to 00:00:00, and then the page should be reload. This I have in my script: // Countdown setInterval(function(){ $(".countdown").each(function(){ var seconds = $(this).data('seconds'); if(seconds > 0) { second = seconds - 1; $(this).data('seconds', second) $(this).html(second ) } }); }, 1000); This works perfectly for seconds ... but can somebody help me to convert this into the hh:mm:ss format? in php there is the awesome function gmdate("H:i:s", $seconds) function.. I wonder there is some similar in JS? And - how can I trigger the page reload if $(this).data('seconds') has 0? Thanks for reply :)
tagged with: javascript
tagged with: jquery
tagged with: date
has comment: http://stackoverflow.com/comment/44835694
upvote count: 2

http://stackoverflow.com/a/28217047
type: Answer
answers question: http://stackoverflow.com/q/28216830
has comment: http://stackoverflow.com/comment/44803219
has body: The issue you will most probably be having is that you are executing the .length function even before the AJAX request has been completed. You must set the global variable in the callback of the AJAX request. Something similar to these lines if using jQuery: $.ajax({ url: url, success: function(responseData, status){ if(status == 'success') { myglobalarray = parse(responseData); } } }); Something similar to these lines if using plain Javascript: xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { myglobalarray = parse(xmlhttp.responseText); } }
has comment: http://stackoverflow.com/comment/44797698
score: 0

http://stackoverflow.com/comment/64714127
comment on: http://stackoverflow.com/a/29794999
has text: It wouldn't work for me.I am not getting any value.Is there any other way to get the selected star value
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28285078
type: Answer
score: 8
downvote count: 0
upvote count: 8
has body: Well, this is not the most elegant solution since you really should leverage the asyncValidators in angular 1.3.x and then create your custom validation directives. Resources http://plnkr.co/edit/s4jJAOqehBkFUC9osMsy?p=preview found in the post by this guy. Possibly here http://odetocode.com/blogs/scott/archive/2014/10/16/working-with-validators-and-messages-in-angularjs.aspx And of course in the docs But be cautious as this is not in any way a complete example ready to be used. It's mostly here for demo purpose and to sort of give you an idea where to start. I have not bothered with clearing any previous errors, revalidating the form or taken into account other validation errors. Awesomeness Imagine your controller looks like this $scope.serverValidations = {}; $scope.attemptSignUp = function(){ Api.validateEmail($scope.email).then(angular.noop, function(data){ $scope.serverValidations = data for(prop in $scope.serverValidations){ if($scope.signUpForm[prop]){ angular.forEach($scope.serverValidations[prop],function(validation){ $scope.signUpForm[prop].$setValidity(validation.type, false); }); } } }); } and your response data containing validation errors look like this { email:[ {type:'unique', message:'This email is already in use'} ], name:[ {type:'maxlength', message:'Your name is to long, get a new one :)'} ] }; Then in your HTML you could do like this You don't have a name? {{validation.message}} Here's a dirty Codepen for you: http://codepen.io/anon/pen/yyzMgG?editors=101 When you press submit, after 2 seconds (the time it takes to hit the fake server) your server validations are presented.
answers question: http://stackoverflow.com/q/28157377

http://stackoverflow.com/comment/44752738
type: Comment
has text: Perfect, that was exactly what I was after. I'd tried using `reversed` but I just got [this](http://jsfiddle.net/7pqc95t5/). Looks like `top` and `height` were what I needed to use.
comment on: http://stackoverflow.com/a/28192449
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44853719
comment on: http://stackoverflow.com/q/28246253
type: Comment
type: QuestionComment
score: 0
has text: Not sure the using statement is required as you don't seem to actually be using the mstream anywhere in that block.

http://stackoverflow.com/comment/44726597
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28178648
has text: Two different elements sharing the same id, not sure how well that will work.

http://stackoverflow.com/comment/44839526
comment on: http://stackoverflow.com/q/28239089
score: 0
type: QuestionComment
type: Comment
has text: you can always regex format the strings before you compare

http://stackoverflow.com/comment/44800316
type: QuestionComment
has text: All it is doing is returning `window`
score: 1
comment on: http://stackoverflow.com/q/28218342
type: Comment

http://stackoverflow.com/comment/44827115
type: QuestionComment
has text: try $compile, or plunker
comment on: http://stackoverflow.com/q/28231367
score: 0
type: Comment

http://stackoverflow.com/q/28122053
has title: How to use variable id as selector in jQuery
type: Question
has comment: http://stackoverflow.com/comment/44618507
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28122141
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I found a fiddle for a selectbox here: http://jsfiddle.net/davidThomas/5Eebm/ that works nicely but i need to have a dynamic # of selectboxes which means a dynamic # of ids. Being brand new to jQuery and javascript, how would I go about creating a variable selector in the jq if, for instance I were to use a dynamic [idx] value in my php to increment each id by 1 (e.g.: prophlist_1, choose_1; prophlist_2, choose_2; etc). Any insight at all would be very appreciated. here's the fiddle code: Prophecy 1 text Prophecy 2 text Prophecy 3 text Prophecy 4 text Prophecy 5 text Prophecy 6 text Prophecy 7 text Prophecy 8 text Prophecy 9 text Prophecy 10 text Title 1 Title 2 Title 3 Title 4 Title 5 Title 6 Title 7 Title 8 Title 9 Title 10 $('#choose').change( function(){ var i = this.selectedIndex; $('#update').text($('#prophlist li').eq(i).text()); });
type: UnansweredQuestion

http://stackoverflow.com/comment/44848491
comment on: http://stackoverflow.com/q/28243115
type: QuestionComment
type: Comment
has text: Define “word”. Is “tax-free” one word or two? How about “日本国”?
score: 0

http://stackoverflow.com/q/28149591
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/10750631
tagged with: javascript
tagged with: ajax
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44670520
answer count: 0
type: UnansweredQuestion
tagged with: xmlhttprequest
has body: I have coded an AJAX GET request using a XMLHttpRequest object. My problem is that the request is never hitting the server side code. I had a look at many forums and at stackoverflow and I dont really know what I am missing. My JS code function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var response = xmlhttp.responseText; } } xmlhttp.open("GET", "login.aspx/GetData", true); xmlhttp.setRequestHeader("Content-Type", "application/json"); xmlhttp.send(null); } Server side code - login.aspx [WebMethod] public static string GetData() { return "break here"; } Looking at the Network tab in developer tools, I see that it cannot find the method as the error code is 505 (Internal Server Error) Can this work within an aspx page? maybe only wrks in a asmx service? Is there anything in the code that I have not done or is wrong? Thanks
has title: XMLHttpRequest - Hitting serverside aspx method - 505 Internal Server Error
score: 0
has comment: http://stackoverflow.com/comment/44670470
has comment: http://stackoverflow.com/comment/44670478
has comment: http://stackoverflow.com/comment/44672936
has comment: http://stackoverflow.com/comment/44670505

http://stackoverflow.com/comment/44817675
score: 0
type: Comment
has text: @Barmar - of course, the user has full control. I'm trying to prevent a rogue extension from accessing privileged data (like a CSRF token) without the user's knowledge.
type: QuestionComment
comment on: http://stackoverflow.com/q/28227093

http://stackoverflow.com/q/28182466
has comment: http://stackoverflow.com/comment/44734435
has body: I am making a simple script to write data from an input in cookies, the code works perfectly in a simple HTML: jsfiddle, when i pass the same code to wordpress I get the following error: Uncaught SyntaxError: Unexpected token u perhaps some basic backend problem however I do not know. Jquery var cookie = $.cookie('myDemoCookie'); var attrCookie = $.cookie('attrCookie'); // If the cookie has been set in a previous page load, show it in the div directly: if (cookie) { var values = $.parseJSON(cookie); var li; for (var v in values) { li = $('&lt;li&gt;&lt;a href="' + values[v] + '"&gt;' + values[v] + '&lt;/a&gt;&lt;/li&gt;'); $('.jq-text').append(li).show(); } } $('.fields a').click(function(e) { var text = $('#inputBox').val(); var values = $.parseJSON($.cookie('myDemoCookie')); if (!values) { values = []; } values.push(text); console.log(values); // Setting a cookie with a seven day validity: $.cookie('myDemoCookie', JSON.stringify(values), { expires: 7, path: '/' }); $(".jq-text").append('&lt;li&gt;&lt;a href="' + text + '"&gt;' + text + '&lt;/a&gt;&lt;/li&gt;'); e.preventDefault(); }); $('#form1').submit(function(e) { e.preventDefault(); })
type: Question
linked to: http://stackoverflow.com/q/13022178
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44734406
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44734233
tagged with: php
has title: Uncaught SyntaxError: Unexpected token only in Wordpress
has comment: http://stackoverflow.com/comment/44734341
has comment: http://stackoverflow.com/comment/44734439
answer count: 0
tagged with: cookies
tagged with: wordpress

http://stackoverflow.com/a/28122362
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28122339
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28122339
has body: 5021251000801111111 is larger than the greatest integer that JS can represent precisely. Because that lost precision, you get 5021251000801111000 instead. &gt; Number.MAX_SAFE_INTEGER 9007199254740991 Use a string instead.
score: 2

http://stackoverflow.com/q/28205925
type: Question
tagged with: spring-boot
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has body: I am trying to make a REST call to YQL in a Spring Boot application. Even when I set 'format=json', the call returns 'application/javascript' which results in this message: org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.dilteam.research.YqlQueryResult] and content type [application/javascript;charset=utf-8] Here's the method (processTicker) &amp; the associated class (YqlQueryResult): public void processTicker(String ticker) { RestTemplate restTemplate = new RestTemplate(); String query = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%3D'YHOO'&amp;format=json&amp;callback=?"; YqlQueryResult qr = restTemplate.getForObject(query, YqlQueryResult.class); System.out.println("result" + qr.results); } @JsonIgnoreProperties(ignoreUnknown = true) public class YqlQueryResult { public String results; } What am I doing wrong?
tagged with: yql
answer count: 1
accepted answer: http://stackoverflow.com/a/28211441
has title: YQL returns application/javascript even when format=json is requested
tagged with: spring
has answer: http://stackoverflow.com/a/28211441
type: AnsweredQuestion

http://stackoverflow.com/comment/44900146
type: Comment
type: QuestionComment
score: 1
has text: Like their [demo](https://github.com/scottcheng/cropit/blob/master/demo/form.html), you'll have to assign it to a hidden field, and convert it bytes[] at the server side. From the code, it seems it exports to base64 or datauri. Identify it first and do the conversion as required.
comment on: http://stackoverflow.com/q/28272026

http://stackoverflow.com/comment/44715222
type: Comment
has text: @tymeJV First one, do you have any idea about it (certain order)?
type: QuestionComment
comment on: http://stackoverflow.com/q/28172956
score: 0

http://stackoverflow.com/q/28262940
has body: I'm using c3 + d3 + javascript to create a line chart in a webpage. I managed to create a code that was working fine locally, but when I uploaded it to my server, the code stopped working. I explain the problem below: Problem: c3.generate is not throwing errors when uploaded to server JSFiddle: http://jsfiddle.net/xq6wmyvp/10/ var chart; function initialize(path) { try { c3.generate({ bindto: '#chart', data: { x: 'label', url: path, type: 'line', }, axis: { x: { type: 'categories', label: { text: 'days', }, }, y: { label: { text: 'yield', }, tick: { format: d3.format(".2%") } } }, }); } catch (err) { return false; } return true; } var path1 = 'https://gist.githubusercontent.com/SamMorrowDrums/f571240047c0344a4af8/raw/433eae455570b64edcdc7ece39416b468b612f49/test.csv'; alert(initialize('blabla')); Code explanation: the code (in the fiddle) has a function that initializes a chart with a line graph using some data. The path to the data is given as a variable to that function (which is called 'initialize(path)'). This function uses c3.generate to create the graph. If the data is not available or does not exist, c3.generate throws an error (this works locally, but not when uploaded to a server - this is the problem) and the function (initialize) returns false. If the data exists, the graph is loaded and 'initialize' returns true. Problem Restated: after uploading the code to a server, the function 'initialize(path)' only returns 'true', even if the data is not available/non-existent. I don't know how to solve this. Can you help me? Thanks for reading! (Github link to problem: https://github.com/masayuki0812/c3/issues/960)
has title: c3.generate not throwing error
type: Question
answer count: 1
tagged with: javascript
tagged with: c3
score: 0
linked to: http://stackoverflow.com/q/951791
has comment: http://stackoverflow.com/comment/44892791
accepted answer: http://stackoverflow.com/a/28283192
tagged with: d3.js
has comment: http://stackoverflow.com/comment/44918368
has comment: http://stackoverflow.com/comment/44891096
has answer: http://stackoverflow.com/a/28283192
type: AnsweredQuestion

http://stackoverflow.com/q/28190910
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/28276767
has body: I am very new to d3 and svg, this may sound very naive. I have one force layout graph and one Circle pack and want to show them both on one page side by side. I went to the "Multiple layouts on same page (multiple force layouts same page)" questions but not able to understand how can I put these layout in div element. This one is Force layout - This is my circle pack (sample from mbostock) - Please help me put these in one page using div.
has title: Circle Pack & Force layout on same page?
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28276767
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20864034

http://stackoverflow.com/q/28165967
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28169495
tagged with: javascript
has title: How can I filter some very complicated looking JSON data and use it for markers in leaflet.js?
tagged with: filter
has answer: http://stackoverflow.com/a/28166795
score: 0
type: UnansweredQuestion
tagged with: maps
tagged with: leaflet
has body: I get my data from the Austin, Texas public data sets. Here's the filtered raw data, downloadable in .json format I want to use... https://data.austintexas.gov/dataset/New100/4ehx-iwqv Now, I've figured out how to use a .json file to create markers, but I have so much data in the .json file it would take far too many hours than I have to make all of the 165 I need to make. How can I filter this so that the .leaflet markers only use the information I need? I specifically need to filter for name, latitude, and longitude.
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28259308
has answer: http://stackoverflow.com/a/28259445
has body: On http://dev.coinjabber.com/site/evrnyc.com the google map with the element ID googgleMap loads the correct address at first, but then suddenly turns grey. Why is that?
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44876376
has comment: http://stackoverflow.com/comment/44876555
has comment: http://stackoverflow.com/comment/44876444
score: -1
type: Question
has title: Google map turns grey after loading correctly at first
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44876543
favorite count: 0
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/44876402

http://stackoverflow.com/a/44092117
has comment: http://stackoverflow.com/comment/75206010
downvote count: 0
has comment: http://stackoverflow.com/comment/82788025
answers question: http://stackoverflow.com/q/28122964
type: Answer
score: 2
has body: They changed it from delete to remove in their node js module.
upvote count: 2

http://stackoverflow.com/comment/44881833
has text: Can you show what is inside the post var?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28262337

http://stackoverflow.com/comment/44827158
has text: Tank your for your help, but i´ve done the same as you and the problem I have is that i need a new window without tabs, address bar and without toolbars.
type: Comment
comment on: http://stackoverflow.com/q/28192234
score: 0
type: QuestionComment

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/28237926
tags question: http://stackoverflow.com/q/28279046

http://stackoverflow.com/q/28131447
answer count: 1
tagged with: ngroute
has answer: http://stackoverflow.com/a/28131465
tagged with: ng-view
tagged with: angularjs
has title: AngularJS Routing including multiple JS files and directories
type: AnsweredQuestion
has body: Im fairly new to Angular and have a problem with the routing, I set it up quite simply but it is still not working. index.html: {{1+1}} Loading... app.js: 'use strict'; var app = angular.module('app', [ 'ngRoute', 'billing' ]); app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/billing', {templateUrl: 'components/billing/billing.html', controller: BillingCtrl}) .otherwise({redirectTo: '/billing'}); }]); components/billing/billing.js: 'use strict'; var billing = angular.module('billing', []); billing.controller('BillingCtrl', [function($scope) { var model = { user: "Adam", items: [{ action: "Buy Flowers", done: false }, { action: "Get Shoes", done: false }, { action: "Collect Tickets", done: true }, { action: "Call Joe", done: false }] }; $scope.todo = model; }]); components/billing/billing.html: Hello world {{todo.user}} From what I have read, it should include the billing.html in the ng-view since it is the default routing. But all I get is 'Loading...'. Any help is very much appreciated!
accepted answer: http://stackoverflow.com/a/28131465
type: Question
tagged with: javascript
tagged with: routes
score: 0

http://stackoverflow.com/comment/44734337
comment on: http://stackoverflow.com/q/28182398
type: QuestionComment
has text: @PM77-1 yep. That's awesome. That's a kick ass way to do it :)
score: 0
type: Comment

http://stackoverflow.com/comment/44812134
type: QuestionComment
has text: hey, would you be able to provide us with a demo so that we can see whats going on? (like a jsfiddle)
comment on: http://stackoverflow.com/q/28224036
score: 0
type: Comment

http://stackoverflow.com/q/28237370
has comment: http://stackoverflow.com/comment/44837040
has comment: http://stackoverflow.com/comment/44836597
has comment: http://stackoverflow.com/comment/44836220
answer count: 0
has body: I am writing some code to automatically update some data on a page. I have written this function to show the user when this will occur, however the page flashes white every now and again on the title update. I have tested on chrome and IE and the flash does not occur. There is no other function on a timer as I have not yet written the update function, hence the alert("updated") window.setInterval(function(){ window.start-=1; var minutes = Math.floor(window.start/60); var seconds = window.start % 60; if(seconds&lt;10) seconds = "0"+seconds; if(window.start&lt;0){ alert("updated"); window.start=300; } document.title = "update in - "+minutes+":"+seconds; }, 1000);
type: Question
has comment: http://stackoverflow.com/comment/44836131
tagged with: firefox
tagged with: javascript
has title: Firefox flashes white on title updates
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion

http://stackoverflow.com/a/28138520
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28138095
type: Answer
upvote count: 1
has body: Here's a solution that makes use of CoffeeScript syntax (since you asked for a CoffeeScript answer and then deleted that request?): kitchen = food: [".bacon",".bananas"] drinks: [".soda",".beer"] apps: ['.fritters','.wings'] allGroups = Object.keys(kitchen).map (key) -&gt; kitchen[key] allValues = [] allGroups.forEach (group, i) -&gt; otherValues = Array.prototype.concat.apply [], allGroups.slice(i + 1) group.forEach (v1) -&gt; otherValues.forEach (v2) -&gt; allValues.push(v1 + v2) console.log(allValues) Here is the plain JS version: var kitchen = { food: [".bacon", ".bananas"], drinks: [".soda", ".beer"], apps: ['.fritters', '.wings'] } var allGroups = Object.keys(kitchen).map(function(key) { return kitchen[key]; }); var allValues = [] allGroups.forEach(function(group, i) { var otherValues = Array.prototype.concat.apply([], allGroups.slice(i + 1)); group.forEach(function(v1) { otherValues.forEach(function(v2) { allValues.push(v1 + v2); }); }); }); console.log(allValues)

http://stackoverflow.com/comment/44784005
type: QuestionComment
comment on: http://stackoverflow.com/q/28198049
score: 0
has text: @HristoIvanov It could work (in fact, It seems that work) but I think I would prefer another *better* solution.
type: Comment

http://stackoverflow.com/q/28219881
has comment: http://stackoverflow.com/comment/44805587
tagged with: html-table
score: 0
has answer: http://stackoverflow.com/a/28221403
answer count: 2
has body: On my website I have a schedule optimization for semester, classes, times, and locations. After optimization is run, several tables of choices show up. I want to show an empty semester in the table. here is an example of what I mean: I know my table looks ugly, but I can't put blanks in the table to make the columns / side complete because i'm running complex calculations on the data in the table that would get disrupted if I were to put blanks in (it would try to do look-ups on blanks). I can't tell it to ignore the box if it's a blank either (Just go with me here). So, is there a way to add a note in that area that says "No classes for this semester" programmatically? The results are often different sizes so I can't like hardcode in a location on my website for the note. I need it to just know where to go. I didn't think this was possible but wanted to pose the idea to you guys. Ideas? This would be the end goal: --tons of results in form of tables --- one example result: IF it is even possible to close in the table so it's a complete box that would be great. ****I NEED A JAVASCRIPT / JQUERY SOLUTION UPDATED: Based on the replies so far, I tried this: if(classes.length === 0){ var $noClasses = $('&lt;td&gt;&lt;/td&gt;').html('No Classes available'); $noClasses.colSpan = "3"; $table.append($noClasses); } and this gave me
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28970792
has title: How to add a note with an oddly shaped Javascript table
has comment: http://stackoverflow.com/comment/44803187
type: Question
has answer: http://stackoverflow.com/a/28970792
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28221403

http://stackoverflow.com/a/28293995
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/45153174
answers question: http://stackoverflow.com/q/28270978
has comment: http://stackoverflow.com/comment/45160397
has comment: http://stackoverflow.com/comment/45122456
has body: Found my solution Instead of javascript doing the hardwork. js will just put the generated string into the clipboard, and fire a keystroke. This keystroke will be detected by AHK (http://ahkscript.org/). And then AHK can do the rest.
has comment: http://stackoverflow.com/comment/44956526

http://stackoverflow.com/comment/67188373
has text: This is not for AngularJS!
comment on: http://stackoverflow.com/a/28152583
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44852080
has text: and I can also see the content, so it definitely succeed, but why it doesn't call the success callback
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28244899

http://stackoverflow.com/comment/44649855
score: 1
type: QuestionComment
has text: can check `event.target` . Still not totally clear what the criteria is. Can you create a demo in jsfiddle.net or plnkr.co. Might also want to look at using something like http://draggabilly.desandro.com/
comment on: http://stackoverflow.com/q/28139088
type: Comment

http://stackoverflow.com/q/28168051
tagged with: twitter-bootstrap
score: 0
tagged with: ruby-on-rails
answer count: 1
has title: Bootstrap Dropdown Button
has comment: http://stackoverflow.com/comment/44706462
has comment: http://stackoverflow.com/comment/44706369
type: UnansweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/44706397
type: Question
has body: I am currently using Bootstrap 3, with Ruby on Rails and I'm having some issues with a dropdown button. The button does drop down and shows the list items, but upon clicking on one I'm taken to the top of the page and no list item was selected. Here's the code for the dropdown button - html.erb file How many? 1 2-9 10+ My knowledge of JS is non-existent so I've been looking at other people's questions but I'm still unable to work it out. The script also in the html.erb file When running the app the Javascript console throws up a 404 not found for bootstrap.js. I currently have the bootstrap under Vendor/assets/javascripts/bootstrap.js Should the bootstrap JS files be under app/assets/javascripts? Hopefully someone is able to shed some light on what I'm doing wrong.
has comment: http://stackoverflow.com/comment/44706027
has answer: http://stackoverflow.com/a/28168677

http://stackoverflow.com/q/28184804
linked to: http://stackoverflow.com/q/13957354
answer count: 1
has comment: http://stackoverflow.com/comment/44778999
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/44779080
favorite count: 0
linked to: http://stackoverflow.com/q/15763358
tagged with: d3.js
tagged with: hierarchy
type: UnansweredQuestion
upvote count: 1
tagged with: tree
has title: Drawing a collapsible indented tree with d3.xml instead of d3.json
has answer: http://stackoverflow.com/a/28629476
has body: I am able to get the collapsible indented tree to work properly with a JSON sample file; however, I cannot modify the code to use an XML file. Below are my sample JSON file, sample XML file, and attempt to modify .js file to use XML instead of JSON. I think that these are the key areas of code that I have to modify but not sure: d3.xml("d3/simple-flare.xml", "application/xml", function (error, flare) { flare.x0 = 0; flare.y0 = 0; update(root = flare); }); ... function update(source) { // Compute the flattened node list. TODO use d3.layout.hierarchy. var nodes = tree.nodes(root); ... // Update the links… var link = svg.selectAll("path.link") .data(tree.links(nodes), function (d) { return d.target.id; }); simple-flare.json { "name": "flare", "children": [ { "name": "analytics", "children": [ { "name": "cluster", "children": [ {"name": "AgglomerativeCluster", "size": 3938}, {"name": "CommunityStructure", "size": 3812}, {"name": "MergeEdge", "size": 743} ] }, { "name": "graph", "children": [ {"name": "BetweennessCentrality", "size": 3534}, {"name": "LinkDistance", "size": 5731} ] }, { "name": "optimization", "children": [ {"name": "AspectRatioBanker", "size": 7074} ] } ] }, { "name": "animate", "children": [ {"name": "Easing", "size": 17010}, {"name": "FunctionSequence", "size": 5842}, { "name": "interpolate", "children": [ {"name": "ArrayInterpolator", "size": 1983}, {"name": "ColorInterpolator", "size": 2047}, {"name": "DateInterpolator", "size": 1375}, {"name": "Interpolator", "size": 8746}, {"name": "MatrixInterpolator", "size": 2202}, {"name": "NumberInterpolator", "size": 1382}, {"name": "ObjectInterpolator", "size": 1629}, {"name": "PointInterpolator", "size": 1675}, {"name": "RectangleInterpolator", "size": 2042} ] }, {"name": "ISchedulable", "size": 1041}, {"name": "Parallel", "size": 5176}, {"name": "Pause", "size": 449}, {"name": "Scheduler", "size": 5593}, {"name": "Sequence", "size": 5534}, {"name": "Transition", "size": 9201}, {"name": "Transitioner", "siz…
type: Question

http://stackoverflow.com/a/28197080
accepted answer of: http://stackoverflow.com/q/28196960
has comment: http://stackoverflow.com/comment/44760748
has comment: http://stackoverflow.com/comment/44762922
has comment: http://stackoverflow.com/comment/44761001
has comment: http://stackoverflow.com/comment/44762606
has comment: http://stackoverflow.com/comment/44761988
has body: Access to the parent of that element and compare. $(".column").each(function(index, value){ // If isn't the parent you're looking for.. if($(this).parent().attr('id') != 'projectWidgets'){ continue; } // the rest of your code } EDIT: According to the answers below, new code: I'm assuming that the code you post (var selectedTabIndex = $('#tabs').tabs('option', 'active');) gives the HTML content, am I right? If so, use instead something like this: $tabSelected = $('#tabs').tabs('option', 'active'); and all you have to do is find the .column. $tabSelected.find('.column').each(function(index, value){ }); EDIT 2: According to the jQuery Tab documentation: Since the activate event is only fired on tab activation, it is not fired for the initial tab when the tabs widget is created. If you need a hook for widget creation use the create event. So, take care, you might need create event also. The below code should do the trick. $('#tabs').tabs({ activate: function(event, ui){ $(this).find('.column').each(function(i, value){ }); } });
has comment: http://stackoverflow.com/comment/44762487
upvote count: 1
has comment: http://stackoverflow.com/comment/44762804
has comment: http://stackoverflow.com/comment/44762059
has comment: http://stackoverflow.com/comment/44760643
answers question: http://stackoverflow.com/q/28196960
score: 1
has comment: http://stackoverflow.com/comment/44761951
has comment: http://stackoverflow.com/comment/44762423
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44760848
has comment: http://stackoverflow.com/comment/44760943
type: Answer

http://stackoverflow.com/comment/44660158
comment on: http://stackoverflow.com/q/28144173
score: 0
type: Comment
type: QuestionComment
has text: Well, @Aaditmshah has been fooled by his own test results…

http://stackoverflow.com/a/62675672
answers question: http://stackoverflow.com/q/28250520
has body: If your element id is quantity-row_111, you can get the original value and the new value by : console.log("new value="+ document.getElementById('quantity-row_111').value ); console.log("Original value="+ document.getElementById('quantity-row_111').defaultValue); Look at the console log for the result.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44893925
score: 2
comment on: http://stackoverflow.com/a/28268882
type: Comment
has text: Well, you could consider hovering over the javascript tag in the question.
type: AnswerComment

http://stackoverflow.com/comment/50881185
score: 0
has text: I had the same issue and managed to resolve it: http://stackoverflow.com/a/31457046/2842657
type: Comment
comment on: http://stackoverflow.com/q/28278503
type: QuestionComment

http://stackoverflow.com/q/28275173
has answer: http://stackoverflow.com/a/28276009
answer count: 1
tagged with: jquery
has body: I add variable length list in a view with jquery. $("#addItemday").click(function() { $.get("/Course/AddDayNewRow", function(data) { $("#DayEditorRows").append(data); }).fail(function(xhr, err) { alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status); alert("responseText: " + xhr.responseText); }); }); for every partialview, set a index value.for example &lt;input name="Days.index" autocomplete="off" value="96633b1d-9c0c-4760-9ca8-474ac28bd52a" type="hidden"&gt; I want to add a script for every partialview. var objCal1 = new AMIB.persianCalendar("objCal1", "dateid"); After append PartialView, i want to get last item added. $("input[id*='Date']").last(function () { var ??? = new AMIB.persianCalendar(???, $(this).attr('id'));}); How do i get last item addes, and set name for this variable?
accepted answer: http://stackoverflow.com/a/28276009
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has title: How to add dynamic a javascript variable in jquery?
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/q/28176864
tagged with: jquery-masonry
has answer: http://stackoverflow.com/a/28227200
tagged with: javascript
tagged with: jquery-isotope
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28227200
has body: I've been looking at this theme http://clapat.ro/berger/ and the way it does it's grid in the middle of it. I've been snooping through the javascript files and it looks like it's auto sizing the '.item' class based on the width. I'm trying to replicate this sort of sizing but with my novice understanding of jQuery I can't decipher his code easily or understand the way he's sizing his grid elements automatically. I've made a little JS Fiddle for myself http://jsfiddle.net/7L9aey1c/ function MasonryPortfolio() { if( $('#portfolio-wrap').length &gt; 0 ){ var $container = $('#portfolio'); $container.isotope({ itemSelector: '.item', gutter:0, transitionDuration: "0.5s" }); $(window).on( 'resize', function () { var winWidth = window.innerWidth; columnNumb = 1; var attr_col = $('#portfolio').attr('data-col'); if (winWidth &gt;= 1466) { $('#portfolio-wrap').css( {width : 1360 + 'px'}); $('#portfolio-wrap.no-gutter').css( {width : 1280 + 'px'}); var portfolioWidth = $('#portfolio-wrap').width(); if (typeof attr_col !== typeof undefined &amp;&amp; attr_col !== false) { columnNumb = $('#portfolio').attr('data-col'); } else columnNumb = 3; postWidth = Math.floor(portfolioWidth / columnNumb) $container.find('.item').each(function () { $('.item').css( { width : postWidth - 80 + 'px', height : postWidth * 0.75 - 80 + 'px', margin : 40 + 'px' }); $('.no-gutter .item').css( { width : postWidth + 'px', height : postWidth * 0.75 + 'px', margin : 0 + 'px' }); $('.item.wide').css( { width : postWidth * 2 - 80 + 'px' }); $('.no-gutter .item.wide').css( { width : postWidth * 2 + 'px' }); $('.item.tall').css( { height : postWidth * 1.5 - 80 + 'px' }); $('.no-gutter .item.tall').css( { height : postWidth * 1.5 + 'px' }); $('.item.wide-tall').css( { width : postWidth * 2 - 80 + 'px', height : postWidth * 1.5 - 80 + 'px' }); $('.no-gutter .item.wide-tall').css( { width : postWidth * 2 + 'px', height : postWidth * 1.5 + 'px' }); }); } else if (winWidth &gt; 1024) { $('#portfolio-wrap').css( {w…
answer count: 1
has comment: http://stackoverflow.com/comment/44832593
has comment: http://stackoverflow.com/comment/44818272
score: 0
type: AnsweredQuestion
has title: Auto Sizing Isotope
type: Question
linked to: http://stackoverflow.com/q/28212194

http://stackoverflow.com/a/29858423
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28145397
score: 2
has body: Write your own loader: my_project/my_loaders/filename-loader.js: module.exports = function(source) { var injection = 'var __filename = "' + this.resourcePath + '";\n'; return injection + source; }; Add it to your pipeline and make sure to add also the configuration: resolveLoader: { modulesDirectories: ["my_loaders", "node_modules"] } See the documentation on how to write a loader.
has comment: http://stackoverflow.com/comment/47864611
downvote count: 0

sinon
tags question: http://stackoverflow.com/q/28238074
tags question: http://stackoverflow.com/q/28219880
tags question: http://stackoverflow.com/q/28265054
tags question: http://stackoverflow.com/q/28232117
tag name: sinon
type: Tag

http://stackoverflow.com/q/28175042
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28175676
has comment: http://stackoverflow.com/comment/44719469
has comment: http://stackoverflow.com/comment/44719125
has comment: http://stackoverflow.com/comment/44720193
type: Question
has comment: http://stackoverflow.com/comment/44720363
has comment: http://stackoverflow.com/comment/44720246
has title: Finding out which website a user is coming from using Javascript
tagged with: javascript
has body: So using javascript, I'd like to know if there's a way to find out where a user is coming from, save it to a variable and use that address later. For example: I give an ad banner to various websites, and when a user clicks on the banner, they come to my online store, and if they buy anything, I want to know which website they came from, and how much they spent shopping on my website. Is there a way to do that with javascript? Is there a way to use a cookie to store the inbound url, and then after someone buys something, just email that someone coming from "websiteHere.com" bought something on your website? and then the cookie gets deleted, or is that bad practice?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28175760

http://stackoverflow.com/q/28130317
has body: I can get a solid clearColor in threejs, but is there a way to achieve a gradient clearColor. Or some similar way to achieve a little more depth in my sky, maybe with lights? Here's my relevant code: renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setClearColor( 0x3dc800 ); var light = new THREE.HemisphereLight( 0xffffff, 0xeeeeee, 0.75 ); light.position.set( 0.5, 1, 0.75 ); scene.add( light ); scene.fog = new THREE.Fog( 0x4ff904, 0, 750 );
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44636678
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44638306
has answer: http://stackoverflow.com/a/37198557
favorite count: 0
accepted answer: http://stackoverflow.com/a/37198557
linked to: http://stackoverflow.com/q/20495302
tagged with: three.js
score: 6
possible better answer: http://stackoverflow.com/a/28157816
has answer: http://stackoverflow.com/a/28157816
upvote count: 6
type: AnsweredQuestion
has title: gradient clearColor in threejs

http://stackoverflow.com/comment/45092083
has text: It seems that the `onclick="void(0)"` approach is what is recommended on Apple’s Safari Web Content Guide https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW6
comment on: http://stackoverflow.com/a/28242273
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28237979
has body: Just use JQuery to check that at least one has been filled in. function validate_form() { var valid = $('input[type=checkbox]:checked').length == 0 || $('textarea#mytextarea').val() == ""; if(valid) { alert ( "You need to select something" ); }
has comment: http://stackoverflow.com/comment/44837137
has comment: http://stackoverflow.com/comment/44837361
answers question: http://stackoverflow.com/q/28237611
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28237611
type: Answer

http://stackoverflow.com/comment/47318362
type: AnswerComment
score: 0
type: Comment
has text: I have run across limits depending on the Server Side REST API. (Ex. SharePoint's REST API limits to 1000)
comment on: http://stackoverflow.com/a/29584730

http://stackoverflow.com/q/28208321
has title: jQuery - clone() images without re-downloading them
linked to: http://stackoverflow.com/q/934012
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44781720
tagged with: php
has comment: http://stackoverflow.com/comment/44781664
score: 2
has comment: http://stackoverflow.com/comment/44781609
answer count: 0
tagged with: caching
type: Question
upvote count: 2
has body: So if you clone() an img element, then the browser will retrieve the images src the same way it did for the original element. This means that either a new HTTP request is initiated, or it fetches it from cache. What I am trying to do is clone() images without having to re-load them. One (sort-of) solution is to cache them with Etag and Last-Modified, so that the browser just initiates new HTTP connections which return with 304, and the image isn't actually downloaded. But the problem is, if the image source changes between the original page load, and when the image is cloned, then the clone image will be different from the original. Another solution I came up with, is to set an Expires header of time() + 1 year on the images. That way every time an image is cloned, it is automatically fetched from the cache. Then, on every page load, append the current timestamp to the image src so that it loads a new one (skipping the cache). But the problem with that is that now images can never be cached. I would like to implement an Etag and Last-Modified cache for when the images are loaded during page load. Is there any way to clone an image directly?
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: image

http://stackoverflow.com/comment/44782920
type: QuestionComment
has text: @Kharchi No need to be responsive
comment on: http://stackoverflow.com/q/28209044
score: 0
type: Comment

http://stackoverflow.com/a/31725418
score: 8
has body: just press ctrl + F5 on browser page. Some local caching might be an issue. once you clear it, it should work.
downvote count: 1
upvote count: 9
answers question: http://stackoverflow.com/q/28195610
type: Answer
has comment: http://stackoverflow.com/comment/66016269

graph
tags question: http://stackoverflow.com/q/28184263
tags question: http://stackoverflow.com/q/28151991
tags question: http://stackoverflow.com/q/28195774
tags question: http://stackoverflow.com/q/28180068
tags question: http://stackoverflow.com/q/28156884
tag name: graph
type: Tag
tags question: http://stackoverflow.com/q/28242133

http://stackoverflow.com/comment/44692958
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28160866
has text: "var x should be hoisted to the top" --- and then it's initialized with `5`

http://stackoverflow.com/comment/44732601
score: 0
type: Comment
has text: Thank you! That will work nicely. I was also going to ask that if a suggestion was from a library please make it underscore so I could easily get it out of the code!
comment on: http://stackoverflow.com/a/28181456
type: AnswerComment

http://stackoverflow.com/comment/44844406
type: Comment
has text: @imacange i have edited my answer this might help you
type: AnswerComment
comment on: http://stackoverflow.com/a/28220079
score: 0

http://stackoverflow.com/q/28242510
has comment: http://stackoverflow.com/comment/44851803
has body: Here is server.js var express = require("express"), http = require("http"), mongoose = require( "mongoose" ), app = express(); app.use(express.static(__dirname + "/client")); app.use(express.urlencoded()); mongoose.connect('mongodb://localhost/PvdEnroll', function(err) { if (err) { console.log(err); } else { console.log('Connected to mongodb!'); } }); var CheckBoxSchema = mongoose.Schema({ npi: String, boxes:[ String] }); var CheckBox = mongoose.model("CheckBox", CheckBoxSchema); http.createServer(app).listen(3000); // here's where we get something from the client. app.get("/checkbox.json", function (req, res) { CheckBox.find( {}, function(err, CheckBox) { console.log("STUBB2", checkbox); res.json(checkbox); }); }); app.post("/checkbox", function (req, res) console.log("POSTING TO DB: ",req.body); var newCkBoxData = new npiChecks({"npi": req.body.npi, "boxes":req.boxes}); newCkBOxData.save(function(err, results) { if (err !== null) { console.log(err); res.send("ERROR"); } else { CheckBox.find({}, function(err, result) { if (err !== null) { // the element dir not get saved res.send("ERROR"); } res.json(result); }); } }); }); The client, secA.js, pertains to a single HTML page. var main = function (checkBoxObjects) { "use strict"; $.getJSON("../data/checkBoxesA.json", function(checkBoxTxt) { checkBoxTxt.forEach(function (data) { $(".checkbox-input").append("&lt;input type='checkbox' unchecked/&gt;"); $(".checkbox-input").append(' ' + data.label + "&lt;br/&gt;"); $(".checkbox-input").append(' ' + data.note + "&lt;br/&gt;"); $(".checkbox-input").append(' '+ "&lt;br/&gt;"); }); }); }; $(document).ready(main); providerNPI_ckBs = []; NPI_number = []; var loopForm = function(form) { for ( var i = 0; i &lt; form.elements.length; i++) { if (form.elements[i].type == 'checkbox') if (form.elements[i].checked == true) { providerNPI_ckBs += 1 + ' '; } else { providerNPI_ckBs += 0 + ' '; } } if (providerNPI_ckBs.length &gt; 0) if (NPI_number.length &gt; 0) createJSONobj(); } var ge…
downvote count: 0
tagged with: javascript
score: 1
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/44852924
type: Question
tagged with: node.js
has title: How to send JSON data from client to node.js server.
has comment: http://stackoverflow.com/comment/44845827
has comment: http://stackoverflow.com/comment/44852250
has comment: http://stackoverflow.com/comment/44853555
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28918889
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
tagged with: mongodb

http://stackoverflow.com/a/28259721
type: Answer
answers question: http://stackoverflow.com/q/28258989
has body: Your code is mess, I have rewrite your code for more clean, maybe. Since you there is no php code inside your javascript, don't try to use echo it will make your code even mess and as @Arian mentioned, $active and $next will be work as php variable. foreach($images as $image): $subimg = substr($image, 0, -5); if ($subimg == $poname): if ($x == 1): ?&gt; &lt;script type='text/javascript'&gt; function cycleImages(container) { var $active = container.find('.active'); var $next = ($active.next().length &gt; 0) ? $active.next() : container.find('img:first'); $next.css('z-index',2); $active.fadeOut(1500,function() { $active.css('z-index',1).show().removeClass('active'); $next.css('z-index',3).addClass('active'); }); $(document).ready(function() { setInterval(function(){cycleImages($('#page-cycler'))}, 2000); }) } &lt;/script&gt; &lt;div class="cycler" id="page-cycler"&gt; &lt;?php $actstat = 'class="active"'; $x++; else: $actstat = ''; endif; ?&gt; &lt;img &lt;?= $actstat; ?&gt; src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/&lt;?= $image; ?&gt;"&gt; &lt;?php endif; ?&gt; &lt;?php endforeach; ?&gt; &lt;/div&gt;&lt;!-- #page-cycler --&gt;
score: 0

http://stackoverflow.com/a/28157029
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28156794
type: Answer
accepted answer of: http://stackoverflow.com/q/28156794
has comment: http://stackoverflow.com/comment/44837831
has comment: http://stackoverflow.com/comment/44717608
has body: What you are doing has the right concept. If I understand correctly, you are trying to do some "true asynchronous" ajax, unlike your last post. The one thing you are doing incorrectly is resolving your deferred jQuery variable. The correct code should look like this: var html_response = $.Deferred(); // no need for new function get_html(url){ $.ajax({ type:"POST", url: "Ajax/getHtml", data: { u : url}, dataType: 'html', success:function(data) { html_response.resolve(data); //resolve is a fn }, error: function(x, status, err) { html_response.reject(err); //reject is a fn } }); }; } get_html(inserturlhere); html_response.done(function(html){ // handle success console.log('html: ' + html); }) .fail(function(error) { // handle failure console.log(error); }); However, ajax comes explicitly with a defer already, so be sure to check that out first. http://api.jquery.com/jquery.ajax/
downvote count: 0

http://stackoverflow.com/comment/44755377
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28194242
has text: errors in the console? is the slug/permalink settings the same?

synchronous
tags question: http://stackoverflow.com/q/28126759
tag name: synchronous
type: Tag

http://stackoverflow.com/comment/44703750
type: QuestionComment
has text: You could add a `visible` property to your model (`items`) , have your `markAsRead(item.id)` change that as well, then bind `ng-show` to the visible property
comment on: http://stackoverflow.com/q/28166652
score: 0
type: Comment

http://stackoverflow.com/a/28221995
type: Answer
accepted answer of: http://stackoverflow.com/q/28220721
score: 2
downvote count: 0
upvote count: 2
has body: The answer is in this JSFiddle: http://jsfiddle.net/jarrodek/sdr57h3g/ Now you can be sure that all dependencies has been loaded before your code run.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28220721

http://stackoverflow.com/q/28206929
tagged with: settimeout
has comment: http://stackoverflow.com/comment/44779382
downvote count: 3
has body: I want to send the value of a JavaScript variable (variableToSend) to a PHP variable ($latLong) which then gets posted to MySQL. The JavaScript variable is capturing the value of an HTML textbox outside of a form listed below: &lt;input type="text" id="latLng" value="Working"/&gt; The textbox value passes to the Javascript variable just fine (I've tested via an alert with the variable's value): &lt;script language="JavaScript"&gt; setTimeout(function(){ var variableToSend = document.getElementById("latLng").value; $.post('html/index.php', {$latLong: "variableToSend"}); }, 10000); &lt;/script&gt; However, the $.post method is not firing. I'm thinking one of a couple of things were happening. One, the text field was not in a form which is why it didn't pass to the PHP variable. I tested this by throwing the text field back in a form tag, but that didn't work. Second, the $.post method is written incorrectly. Third, the $.post method is not firing at all after the 10 second interval. I'm thinking it's the third case but would like some direction if at all possible. Any help is greatly appreciated.
type: Question
has comment: http://stackoverflow.com/comment/44779233
upvote count: 0
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/44779089
has comment: http://stackoverflow.com/comment/44779112
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28207180
score: -3
has title: Javascript - Send Javascript Variable to PHP
tagged with: php
has comment: http://stackoverflow.com/comment/44779480

http://stackoverflow.com/q/28250348
score: 2
has title: html2canvas is not capturing true google map on chrome
linked to: http://stackoverflow.com/q/24046778
type: Question
tagged with: google-maps
duplicate of: http://stackoverflow.com/q/24046778
downvote count: 0
tagged with: javascript
tagged with: html2canvas
has body: I have created a google map application to capture view of map. The working code is here. I am using html2canvas tool for capturing. var captureMap = function(){ html2canvas(document.getElementById("map-canvas"),{ "useCORS": true, "allowTaint": true, "logging": true, "onrendered": function (canvas) { document.getElementById('canvas').innerHTML=""; document.getElementById('canvas').appendChild(canvas); } }); } I can capture map image success with Mozilla Firefox and IE. But Chrome not working fine. Tiles are hidden when map move. What is the problem of chrome?
has comment: http://stackoverflow.com/comment/44860566
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/44869315
upvote count: 2
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/comment/44702339
comment on: http://stackoverflow.com/a/28134230
score: 0
type: AnswerComment
has text: I am trying to include my table in the same way as suggested in the link (that you mentioned above). But I am not been able to achieve this : http://jsfiddle.net/arsalanjawed619/6g8euczd/
type: Comment

http://stackoverflow.com/q/28169438
type: Question
has answer: http://stackoverflow.com/a/28169509
answer count: 1
tagged with: javascript
has title: how to add some code to javascript while it is runnig on another window
tagged with: playlist
score: 0
type: UnansweredQuestion
has body: How to add some code to javascript while it is running in another window, for example if some songs are playing using javascript in another window then how to add another song to the playlist i.e to javascript var myPlaylist=[{mp3:'path of the song',title:'title of the song'},{mp3:'path of the song',title:'title of the song'},{mp3:'path of the song',title:'title of the song'}]; $(document).ready(function(){ $(body).ttwmusicplayer(myPlayList,) }); by using this script some songs are playing in the pop-up window..... and my problem is how to add a another song to the playlist i.e in pop-up window when some button is clicked on the parent window.
has comment: http://stackoverflow.com/comment/44750982
has comment: http://stackoverflow.com/comment/44708519

http://stackoverflow.com/comment/44879418
comment on: http://stackoverflow.com/a/28261130
has text: That's what I'm confused about. Instead of using `innerObjects` at all, why can't I just say `objects = data`? Because then I would think that I'm replacing the `objects` variable with the stuff from `data`. Why does that not work?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28242829
has comment: http://stackoverflow.com/comment/44854645
answers question: http://stackoverflow.com/q/28227925
type: Answer
accepted answer of: http://stackoverflow.com/q/28227925
downvote count: 0
has body: Also, you are much better off if you write the regex like this: if userAgent.match /iPad|iPhone|iPod|Android|IEMobile|BlackBerry/i
score: 2
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44678425
type: Comment
comment on: http://stackoverflow.com/a/28153491
has text: Glad to help U understand mate @APAD1
type: AnswerComment
score: 0

http://stackoverflow.com/q/28270302
score: 1
accepted answer: http://stackoverflow.com/a/28270359
upvote count: 1
has title: Jquery: How to focus on last character of DIV
type: Question
tagged with: javascript
has body: I have a contenteditable DIV. I want to focus on last character when a text is added. HTML: I tried but this code does not right: JsFiddle How to create a new line and the cursor focus there?
downvote count: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28270359
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/44764049
comment on: http://stackoverflow.com/a/28198640
type: Comment
score: 1
has text: What you're trying to achieve is easy, you need to take a look at the documentation http://api.jquery.com/jquery.post/
type: AnswerComment

http://stackoverflow.com/comment/44796008
score: 1
comment on: http://stackoverflow.com/q/28215380
type: QuestionComment
type: Comment
has text: when you open a new tab, `window.f` is a reference to the form element wrapping the google search input...

http://stackoverflow.com/q/28146868
has title: programmatically selected option is not highlighted in ui-select
has comment: http://stackoverflow.com/comment/44719180
tagged with: angularjs
has body: angular version: AngularJS v1.3.6 http://github.com/angular-ui/ui-select : Version: 0.8.3 var p1 = { name: 'Ramesh', email: 'Ramesh@email.com', age: 99 }; $scope.people = [ { name: 'Amalie', email: 'amalie@email.com', age: 12 }, { name: 'Wladimir', email: 'wladimir@email.com', age: 30 }, { name: 'Samantha', email: 'samantha@email.com', age: 31 }, { name: 'Estefanía', email: 'estefanía@email.com', age: 16 }, { name: 'Natasha', email: 'natasha@email.com', age: 54 }, { name: 'Adrian', email: 'adrian@email.com', age: 21 }, p1 ]; $scope.people.selected = p1 ; html: {{$select.selected.name}} Issue is When p1 is selected programatically the p1 object is not highlighted in the ui-select drop down. Output is: http://plnkr.co/edit/3mrECwGJbz2UYcrDiCha?p=preview
has answer: http://stackoverflow.com/a/28155697
has comment: http://stackoverflow.com/comment/44665761
has comment: http://stackoverflow.com/comment/44669787
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/53499021
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28155697
score: 3
tagged with: javascript
tagged with: ui-select
has comment: http://stackoverflow.com/comment/44719372
has comment: http://stackoverflow.com/comment/44670797
answer count: 1
downvote count: 0
tagged with: ui-select2
favorite count: 0

http://stackoverflow.com/comment/44697313
comment on: http://stackoverflow.com/a/28163170
type: AnswerComment
score: 0
type: Comment
has text: Arun is absolutely correct. if Jason will do the same thing inside div means each replace by then Jason will got correct structure as @Jason want

http://stackoverflow.com/comment/44820788
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28228725
has text: Thanks to all.... I replaced .val() with .text() now i am getting an error value "NaN" on lblBalance.
score: 0

http://stackoverflow.com/a/28133200
answers question: http://stackoverflow.com/q/28133187
upvote count: 4
downvote count: 0
has body: That is because your ng-model and select options @ opt as opt.label for opt in categoryoptions are pointing to the same property. So as you select a value from select it sets the ngmodel categoryoptions with the selected value(object) and the list of options categoryoptions are also the same, So you see that it gets cleared because categoryoptions is no longer the select options list. use a different property name for ng-model or vice versa. Example:- &lt;select data-ng-model="selectedCategory" data-ng-options="opt as opt.label for opt in categoryoptions"&gt; &lt;/select&gt; Or set the value as a property on the array itself, categoryoptions.selected or to enforce dot rule (if you may need) define an object in your controller $scope.category = {}; and set ng-model as $scope.category.selected
score: 4
accepted answer of: http://stackoverflow.com/q/28133187
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44734579
type: QuestionComment
has text: Just added the example.
score: 0
comment on: http://stackoverflow.com/q/28182649
type: Comment

http://stackoverflow.com/q/28260726
answer count: 1
has comment: http://stackoverflow.com/comment/44878681
type: UnansweredQuestion
has title: Create variable to JavaScript array from another function?
type: Question
tagged with: arrays
has answer: http://stackoverflow.com/a/28260774
tagged with: javascript
tagged with: jquery
has body: I have a function that create and store an array for all the p elements: function dummyArray(){ var $dummy= $('p'); var dummy= []; i = 0; $dummy.each(function() { dummy[i++] =$(this).html(); }); return dummy; } Now, in order to reuse the array in another function, I can use dummyArray() and dummyArray()[0] to access the individual data. function initAll(){ //dummyArray(); //dummyArray()[0]; } However I want to store it inside a variable like below but it gives me error. function initAll(){ var allArray = dummyArray();//error } Is there a way to store it inside a variable or is there a better way of doing this?
score: 0

http://stackoverflow.com/a/28269289
accepted answer of: http://stackoverflow.com/q/28269179
answers question: http://stackoverflow.com/q/28269179
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You use this code: var comment = { /* ... */ }; if (checkCookie() == false) { setCookie("myComments", JSON.stringify(comment), 1); } else { comments = JSON.parse(getCookie("myComments")); comments.push(comment); setCookie("myComments", JSON.stringify(comments), 1); } The problem is that initially you store the object comment instead of an array containing it. Therefore, the next time, when you attempt to push another comment, you can't. Try the following instead: var comment = { /* ... */ }; if (checkCookie() == false) { setCookie("myComments", JSON.stringify([comment]), 1); // &lt;-- array } else { comments = JSON.parse(getCookie("myComments")); comments.push(comment); setCookie("myComments", JSON.stringify(comments), 1); }

http://stackoverflow.com/a/28206988
has body: You can't create an associative array like that because JavaScript doesn't have associative arrays. But you can create an object, which is really what you want here. Here's one way to do it: var data = [ 'quality', 'print-quality: 4', 'x-dimension', 'Value: 21590', 'Value: y-dimension', 'Value: 27940', 'Value: ', 'Value: media-bottom-margin', 'Value: 0', 'Value: media-left-margin', 'Value: 0', 'Value: media-right-margin', 'Value: 0', 'Value: media-top-margin', 'Value: 0', 'Value: ' ], cleanData, newData = {}; // initialize the new object cleanData = data .map( function(x) { return x.replace(/^Value: /, ''); }) // remove leading "Value: " .filter( function (x) { return !x.match(/^$/); } ); // strip empty values for (i = 0; i &lt; cleanData.length; i += 2) { // loop over the cleaned-up array newData[cleanData[i]] = cleanData[i + 1]; } The result is that newData (in JSON form for readability) is: { "quality":"print-quality: 4", "x-dimension":"21590", "y-dimension":"27940", "media-bottom-margin":"0", "media-left-margin":"0", "media-right-margin":"0", "media-top-margin":"0" }
accepted answer of: http://stackoverflow.com/q/28206856
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/44780540
has comment: http://stackoverflow.com/comment/44780214
has comment: http://stackoverflow.com/comment/44779396
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/44779328
answers question: http://stackoverflow.com/q/28206856
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44779202

http://stackoverflow.com/q/28195057
accepted answer: http://stackoverflow.com/a/28195493
score: 0
has body: I am trying to make an opaque box with three.js, but the light is still going thought the box: I have one "THREE.SpotLight" and 2 objects in my scene: the sphere is projecting the shadow onto the box. There are 2 shadows (I think there should be only one): the first, at the top of the box seems correct, the second is weird (as if the box where transparent). Illustration here: https://i.sstatic.net/ZNmI3.png var scene, camera, renderer; var material; init(); function init() { //Renderer renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.shadowMapEnabled = true; renderer.setSize(window.innerWidth, window.innerHeight); scene = new THREE.Scene(); //Camera camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 10000); camera.position.set(0, 20, 20); camera.lookAt(new THREE.Vector3(0, 15, 0)); //Material material = new THREE.MeshLambertMaterial({ color: 0xffffff }); //Box var box = new THREE.Mesh(new THREE.BoxGeometry(7, 16, 7), material); box.position.y = 8; box.castShadow = true; box.receiveShadow = true; scene.add(box); //Sphere geometry = new THREE.SphereGeometry(.8, 48, 48); var sphere = new THREE.Mesh(geometry, material); sphere.position.set(-5, 17, -3); sphere.castShadow = true; sphere.receiveShadow = true; scene.add(sphere); // Lights var spotLight = new THREE.SpotLight(0xffffff); spotLight.position.set(-50, 40, -50); spotLight.target.position.set(-5, 17, -3); spotLight.castShadow = true; spotLight.shadowMapWidth = 2048; spotLight.shadowMapHeight = 2048; spotLight.shadowCameraVisible = true; scene.add(spotLight); var ambientLight = new THREE.AmbientLight(0x444444); scene.add(ambientLight); document.body.appendChild(renderer.domElement); } renderer.render(scene, camera); My question is: How can i make the box opaque? Jsfiddle here: http://jsfiddle.net/v81gs6u1/4/
tagged with: three.js
has title: Issue with three.js and shadows
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28195493
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28263709
has body: How is regex stored in javascript. Is not stored like the usual way other var types like string is stored. var regexOne = /^(regex).*$/gm; var regexTwo = /^(regex).*$/gm; var regexThree = /^(regex).*$/gm; var regexFour = /^(regex).*$/gm; var searchQuery = [regexOne, regexTwo, regexThree, regexFour]; for(query in searchQuery){ console.dir(query.toString()); } The above code prints: '0' '1' '2' '3' How can i get this working.
has comment: http://stackoverflow.com/comment/44884273
type: Question
linked to: http://stackoverflow.com/q/9329446
answer count: 2
has comment: http://stackoverflow.com/comment/44884559
tagged with: arrays
has answer: http://stackoverflow.com/a/28263732
tagged with: javascript
tagged with: variables
accepted answer: http://stackoverflow.com/a/28263731
possible better answer: http://stackoverflow.com/a/28263732
has title: Storing regex in an array is not working in Javascript
tagged with: regex
has comment: http://stackoverflow.com/comment/44884243
favorite count: 0
upvote count: 2
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28263731
type: AnsweredQuestion

http://stackoverflow.com/a/28203674
has comment: http://stackoverflow.com/comment/44773897
has body: You need to be careful with your return statement when used in conjunction with newlines, in these lines: return $http.get('/lyricsRequester.php', If you don't, JS will automatically add a semicolon after your return, and the function will return undefined. Move the $http.get statement to the same line as your return statement. return $http.get('/lyricsRequester.php', ... Refer to the following docs: MDN return statement Automatic Semicolon Insertion As for your second issue, you $scope is not really something you inject into your services (like $http). Scopes are available for use in controllers. You need to refactor your code a bit to make things work. eg. Your getLyrics function can take a song as a parameter. Then in your controller, you call lyricsService.getLyrics(someSong). Scope access and manipulation are only done in your controller. app.factory('lyricService', function($http) { return { getLyrics: function(song) { var songArr = song.split('-'); var artist = songArr[0]; var songTitle = songArr[1]; return $http.get('/lyricsRequester.php', { params: { song_author: artist, song_name: songTitle } }).then(function(result) { return result.data; }); } } }); app.controller('lyricsController', function($scope, lyricService) { $scope.currentSong = 'Judas Priest - A Touch of Evil'; $interval(function(){ lyricService.getLyrics($scope.currentSong).then(function(lyrics) { $scope.lyrics = lyrics; console.log($scope.lyrics); }); }, 10000); }); You also have some other issues, like using ng-model on your span. ng-model is an angular directive that is used in conjunction with form elements (input, select etc.), not a span as you have. So you might want to change that into an input field.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44773565
accepted answer of: http://stackoverflow.com/q/28203210
answers question: http://stackoverflow.com/q/28203210
type: Answer
has comment: http://stackoverflow.com/comment/44775143
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44773494

http://stackoverflow.com/a/28127921
type: Answer
has body: Not tried but if you can inject anything into the DOM (DHTML style) you can inject a link tag with the style url of your liking. Not tested but theoretically it should work. Have a look at: Add a link stylesheet dynamically in the &lt;head&gt; Hope this answers your question
score: 0
answers question: http://stackoverflow.com/q/28127873

http://stackoverflow.com/a/28233257
has comment: http://stackoverflow.com/comment/44830317
has comment: http://stackoverflow.com/comment/44837452
has comment: http://stackoverflow.com/comment/44830553
has comment: http://stackoverflow.com/comment/44829542
has comment: http://stackoverflow.com/comment/44831785
has comment: http://stackoverflow.com/comment/44829995
downvote count: 0
has comment: http://stackoverflow.com/comment/44832004
type: Answer
answers question: http://stackoverflow.com/q/28219711
has comment: http://stackoverflow.com/comment/44830058
has comment: http://stackoverflow.com/comment/44830208
score: 1
has comment: http://stackoverflow.com/comment/44834028
upvote count: 1
has comment: http://stackoverflow.com/comment/44829915
has comment: http://stackoverflow.com/comment/44829330
has comment: http://stackoverflow.com/comment/44829775
has body: I think you should use Session variable or cookies to pass that variable from one jsp page to another. you could also use Local Storage.
has comment: http://stackoverflow.com/comment/44828942
has comment: http://stackoverflow.com/comment/44830429

http://stackoverflow.com/comment/44840114
score: 0
type: Comment
has text: well that's pretty smart, also thank you for the fiddle! Going to have a look at this solution, seems like the easiest way - thank you very much!
type: AnswerComment
comment on: http://stackoverflow.com/a/28239509

http://stackoverflow.com/comment/44688236
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28157735
has text: I had to wait like 10 min in order to do that. Then I went to lunch. Sorry!

http://stackoverflow.com/comment/44725800
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28173982
has text: try to create a reduced testcase that runs on jsfiddle?
score: 0

http://stackoverflow.com/comment/44777093
comment on: http://stackoverflow.com/q/28205688
type: Comment
type: QuestionComment
score: 1
has text: works for me: http://jsfiddle.net/t80wt6y1/

http://stackoverflow.com/q/28265412
tagged with: facebook
favorite count: 0
has comment: http://stackoverflow.com/comment/44887596
type: UnansweredQuestion
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/44887579
score: -1
has body: I'm using fb share code for my product but unfortunately the image is taking from somewhere else in my website and the product heading is not fetching. I have used meta tags with data still issue remains same. the code Im using is like this am behind this for last 5-6 hrs am stuck on this.
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/44887615
has title: FB share not fetching proper image and data
has answer: http://stackoverflow.com/a/28265653
answer count: 1
tagged with: javascript
tagged with: share

http://stackoverflow.com/comment/44773323
has text: @diplosaurus Yes, you must return an object from a factory. I've made the edit to add back in expose the `update` method.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28200331
score: 0

http://stackoverflow.com/a/28274410
has body: You can do that but you need to be using API v1.1. Here is a tutorial: http://www.oodlestechnologies.com/blogs/Twitter-integration-on-PhoneGap-using-ChildBrowser-and-OAuth-for-iOS-and-Android-Platforms Moreover, you may also use Auth0's platform to achieve this: https://auth0.com/authenticate/phonegap/twitter
answers question: http://stackoverflow.com/q/28274310
score: 0
type: Answer

http://stackoverflow.com/comment/44880855
comment on: http://stackoverflow.com/a/28261781
type: AnswerComment
has text: Hi, can you please explain the 'old version of jQuery' comment - I'm using 1.11.2 straight from the jquery site?
score: 0
type: Comment

http://stackoverflow.com/q/28158982
has comment: http://stackoverflow.com/comment/44689609
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44689454
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28159164
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44689732
has comment: http://stackoverflow.com/comment/44689439
answer count: 1
has answer: http://stackoverflow.com/a/28159164
has comment: http://stackoverflow.com/comment/44689469
tagged with: angularjs
has title: Class isn't added in angular
has comment: http://stackoverflow.com/comment/44689371
has body: I have an angular function $scope.show = function(el){ if($scope.steps[el] == true){ $scope.steps[el] = false; } else{ $scope.steps = []; $scope.steps[el] = true; } } When I call It by click this text Then a class 'shown' adds in this div but I don't get the class when call the fanction in this cod $(document).on('click', "li", function() { $scope.show('getDate'); console.log($scope.steps); }); but in console i get this log [getDate: true] LI tag generated with JS by jquery.formstyler http://dimox.name/jquery-form-styler/ from SELECT tag
has comment: http://stackoverflow.com/comment/44689405

http://stackoverflow.com/comment/44828728
has text: You might want to have a look at https://en.wikipedia.org/wiki/Aspect-oriented_programming
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28233107
type: Comment

http://stackoverflow.com/comment/44825064
type: AnswerComment
score: 0
type: Comment
has text: Thanks for confirming my doubts. But, well, as the author and I both mentioned, the point of this code is encapsulation. Now I'm not a big fan of the getter/setter pattern either. I prefer "tell don't ask" and immutability but the getter/setter pattern is often used to demonstrate encapsulation, as is done here. Your proposed alternative offers no encapsulation, thus no way to enforce validation or enforce immutability. Are you sure you can't find something better? Nice poem by the way.
comment on: http://stackoverflow.com/a/28230158

http://stackoverflow.com/comment/44665699
type: QuestionComment
score: 0
has text: @hindmost Does the same thing as my previous comment.
comment on: http://stackoverflow.com/q/28146604
type: Comment

http://stackoverflow.com/comment/44752138
type: Comment
score: 1
has text: Please correct your code in your question. You are missing stuff.
comment on: http://stackoverflow.com/q/28190536
type: QuestionComment

http://stackoverflow.com/q/28235770
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28236061
accepted answer: http://stackoverflow.com/a/28236061
has comment: http://stackoverflow.com/comment/44833065
upvote count: 4
tagged with: php
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28235797
has answer: http://stackoverflow.com/a/28235825
has title: Javascript var to php var
type: Question
has body: I want to convert a javascript variable to a php variable. This is the jQuery code I use: $('#add').click(function(){ $.post( 'user.php', {saveidnumber: idnumber}, function(){ console.log('done') } ); }); php: if(isset($_POST['saveidnumber'])){ $saveid = $_POST['saveidnumber']; echo $saveid; } It look likes the jQuery work because there are no errors in the console but the php never echo's the $saveid variable. What am I doing wrong?
tagged with: javascript
has comment: http://stackoverflow.com/comment/44832952
tagged with: jquery
has answer: http://stackoverflow.com/a/28235797
answer count: 3

http://stackoverflow.com/comment/44764115
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28198391
score: 0
has text: I call you @AlexeiLevenkov

http://stackoverflow.com/comment/44620570
has text: Your split is probably not right. Nothing will match your split
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28123438
score: 0

http://stackoverflow.com/a/28257417
has comment: http://stackoverflow.com/comment/44873648
accepted answer of: http://stackoverflow.com/q/28257109
has comment: http://stackoverflow.com/comment/44873995
score: 1
has comment: http://stackoverflow.com/comment/44873697
upvote count: 1
answers question: http://stackoverflow.com/q/28257109
has body: A &lt;form&gt;element doesn't have a naturally occurring 'load' event, therefore getglobal() is not called in your version of the code. Try reinstating &lt;body onload="getglobal();"&gt; Alternatively, find some other way to cause getglobal() to be called - eg in response to some user event. How does the code work? First, the HTML causes the DOM to be populated with : a &lt;form&gt; element containing two buttons an &lt;img&gt; element an &lt;map&gt; element containing a number of areas The document's &lt;body&gt; element has getglobal() attached to it as its onload handler, which causes several global variables to be set : GLOBAL_WIDTH: the &lt;img&gt; element's initial width. GLOBAL_AREAS: an array of the image map's initial area coords, "-264,320,442" etc. GLOBAL_COUNT: which is set but not used. By setting these global vars once, there's a lot less to do every time the image and its map are rescaled. The two form buttons are each given a 'click' action by attaching onclick handlers : "scaled smaller" - onclick="scaleImageDown()" "scaled bigger" - onclick="scaleImageUp()" The two functions scaleImageDown() and scaleImageUp() : rescale the image by a factor of 0.5 or 2. loop through the GLOBAL_AREAS array and manipulate the area nodes' coords attribute such that each of the coordinates is either divided or multiplied by 2. This has the desired effect of rescaling the entire map. The utility function scaleArea() exists to avoid repetition of code in scaleImageDown() and scaleImageUp().
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44873227

function
tags question: http://stackoverflow.com/q/28229914
tags question: http://stackoverflow.com/q/28223008
tags question: http://stackoverflow.com/q/28270710
tag name: function
tags question: http://stackoverflow.com/q/28191999
tags question: http://stackoverflow.com/q/28222228
tags question: http://stackoverflow.com/q/28195055
tags question: http://stackoverflow.com/q/28278032
tags question: http://stackoverflow.com/q/28209243
tags question: http://stackoverflow.com/q/28125202
tags question: http://stackoverflow.com/q/28225138
tags question: http://stackoverflow.com/q/28140638
tags question: http://stackoverflow.com/q/28242324
tags question: http://stackoverflow.com/q/28140806
tags question: http://stackoverflow.com/q/28238013
tags question: http://stackoverflow.com/q/28131767
tags question: http://stackoverflow.com/q/28218425
tags question: http://stackoverflow.com/q/28233532
tags question: http://stackoverflow.com/q/28271739
tags question: http://stackoverflow.com/q/28221390
tags question: http://stackoverflow.com/q/28208031
tags question: http://stackoverflow.com/q/28238582
tags question: http://stackoverflow.com/q/28186880
type: Tag
tags question: http://stackoverflow.com/q/28166824
tags question: http://stackoverflow.com/q/28267254
tags question: http://stackoverflow.com/q/28202278
tags question: http://stackoverflow.com/q/28139690
tags question: http://stackoverflow.com/q/28149644
tags question: http://stackoverflow.com/q/28277839
tags question: http://stackoverflow.com/q/28219786
tags question: http://stackoverflow.com/q/28245541
tags question: http://stackoverflow.com/q/28133404
tags question: http://stackoverflow.com/q/28258800
tags question: http://stackoverflow.com/q/28249698
tags question: http://stackoverflow.com/q/28203132
tags question: http://stackoverflow.com/q/28266081
tags question: http://stackoverflow.com/q/28203904
tags question: http://stackoverflow.com/q/28137668
tags question: http://stackoverflow.com/q/28209326
tags question: http://stackoverflow.com/q/28149818
tags question: http://stackoverflow.com/q/28131481
tags question: http://stackoverflow.com/q/28179440
tags question: http://stackoverflow.com/q/28185860
tags question: http://stackoverflow.com/q/28150760
tags question: http://stackoverflow.com/q/28138487
tags question: http://stackoverflow.com/q/28126585

http://stackoverflow.com/q/28249460
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I'm using midi.js for a small Chrome app that I'm making, and while I'm able to export note events, I cannot figure how to change the MIDI tempo using the setTempo method. I'm able to run the method using: var tempo = {type:META_TEMPO,data:[0x0F,0x42,0x40]}; events.push(new MetaEvent(tempo)); I'm pushing this event to the beginning of the events array, before any note event. I later checked the values of that events array before exporting to MIDI and the setTempo meta event's values are 255,81 following by the data property's values. I've tried using 0x0F,0x42,0x40 which should produce a bpm of 60 but it doesn't work. Had anyone figured how to work with that method? Thanks for reading!
downvote count: 0
tagged with: midi
favorite count: 0
type: UnansweredQuestion
has title: How to properly use the setTempo method in midi.js

http://stackoverflow.com/comment/44731773
comment on: http://stackoverflow.com/a/28161073
type: AnswerComment
score: 0
type: Comment
has text: @amit - gave it my best shot.

http://stackoverflow.com/comment/44651758
type: AnswerComment
type: Comment
has text: number % limit || number; will return "Number" in case of number is a multiple of limit.
score: 0
comment on: http://stackoverflow.com/a/28140043

http://stackoverflow.com/q/28132308
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/28132414
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28132391
has title: How to get an image to slide from one side of page to the other with jquery or javascript? Just like on thepiratebay.se
has body: This is something i've been seeing alot in slides or on page when scrolling. Moving images. How can I do this with jquery or some simple javascript just like on thepiratebay.se? My idea was a car sliding from one side of the page to the other. I know jquery can do this with animate() but I dont see any examples of something sliding across the page like on thepiratebay.se Can anyone pintoint where they use this technique. I'm not sure what js they are using for this cant find it. Src: http://thepiratebay.se

pidcrypt
type: Tag
tag name: pidcrypt
tags question: http://stackoverflow.com/q/28276433

http://stackoverflow.com/q/28181156
answer count: 0
has comment: http://stackoverflow.com/comment/44732039
has body: I am trying to grab an xml tag with a prefix that is undefined in the xml sample &lt;feedburner:origLink&gt;&lt;/feedburner:origLink&gt; not sure how to grab the xml with prefix. var items = xml.find("item"); $.each(items, function (i, v) { entry = { mp3: $(v).find("feedburner:origLink").text()}
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/853740
has comment: http://stackoverflow.com/comment/44731625
score: 0
has title: javascript format for grabbing xml
has comment: http://stackoverflow.com/comment/44731650
type: UnansweredQuestion

http://stackoverflow.com/comment/44743327
score: 0
comment on: http://stackoverflow.com/a/28187335
type: Comment
type: AnswerComment
has text: About your edit - this is because `return` statement ends up the function. Always. No matter where you place it or what value you return. That is why I used `break` not `return` - this breaks the loop, and continues with the rest.

http://stackoverflow.com/comment/44825150
has text: I thought it would have to be doing something like that. Thanks so much for clearing it up!
comment on: http://stackoverflow.com/a/28223349
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44660448
score: 0
type: Comment
has text: This doesn't work for virtual keys. You can test by copying your code into the console of this page and seeing the output.
type: AnswerComment
comment on: http://stackoverflow.com/a/28141672

http://stackoverflow.com/comment/44688204
score: 0
type: QuestionComment
type: Comment
has text: I assume this is running locally? IE won't run this due to cross site domain restrictions. It needs to run on a proper webserver over http(s)
comment on: http://stackoverflow.com/q/28158346

http://stackoverflow.com/comment/44787752
comment on: http://stackoverflow.com/a/28211742
type: AnswerComment
score: 0
type: Comment
has text: looks like it's useless here... maybe just do that when your user is not allowed to edit the selection...

http://stackoverflow.com/a/50633477
downvote count: 0
has comment: http://stackoverflow.com/comment/88317917
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/88282126
score: 3
answers question: http://stackoverflow.com/q/28229337
has body: I have a similar problem. This decision helped me in part. $('#open_button').magnificPopup({ type: 'inline', // Custom settings, never mind closeBtnInside: false, // Custom settings, never mind fixedContentPos: false, // Custom settings, never mind fixedBgPos: true, // Custom settings, never mind callbacks: { open: function() { // When you open the $('body').css('overflow', 'hidden'); // window, the element }, // "body" is used "overflow: hidden". close: function() { // When the window $('body').css('overflow', ''); // is closed, the }, // "overflow" gets the initial value. } });

http://stackoverflow.com/comment/44771042
has text: Nope, you can stringify and parse over and over and over and you'll always get the value back exactly as it was before.
comment on: http://stackoverflow.com/a/28202378
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/a/28206388
has body: You need to serialize the list of selected radio buttons before you send via Ajax. var radioChecked = $(":radio").serialize(); $.ajax( { url: _action_url, data: radioChecked, success: function(result){ // What do we do when success } } );
score: -1
answers question: http://stackoverflow.com/q/28206264
downvote count: 1
type: Answer
upvote count: 0

http://stackoverflow.com/q/28175759
accepted answer: http://stackoverflow.com/a/28176257
answer count: 3
has body: I am trying to get an image from html tag in my JavaScript file and then use AJAX to call a PHP script that uploads it to the database. My issue is getting the file data and then passing it to the PHP properly using AJAX. What are my options for this?
has answer: http://stackoverflow.com/a/28175848
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/28175848
tagged with: input
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28176003
has answer: http://stackoverflow.com/a/28176257
downvote count: 2
has title: Use JavaScript and AJAX to retrieve an image from HTML input tag and pass it to a PHP script for Upload to database
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/166221
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44720633
tagged with: image

http://stackoverflow.com/comment/44794321
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28212061
type: AnswerComment
has text: Refresh in the sense..url hash change or else?

http://stackoverflow.com/q/28165789
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/44704606
has comment: http://stackoverflow.com/comment/44702125
has body: In the below code, unable to render 'TodoList'. Seems like fetching taking time and so displaying '0' and ​ ​ before only. and Iam not sure why '3' and 'Descriptions' got displayed later. All I need is to display 'Descriptions List' in the page. Iam able to get data from server but somehow not able to display as soon as the data arrived. Please tell me what changes need to do in the below code? Here is the CONSOLE output Iam getting: 0 ​ ​ 3 pick up cookies Milk Cookies
score: 2
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28167511
linked to: http://stackoverflow.com/q/28168845
has answer: http://stackoverflow.com/a/28166028
has comment: http://stackoverflow.com/comment/44704340
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44702368
answer count: 2
duplicate of: http://stackoverflow.com/q/28168845
downvote count: 0
has title: Backbone JS view render not displaying
tagged with: jquery

http://stackoverflow.com/a/28152186
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28150469
has body: try this: new Date(1422360000).toString() That will make your date look like the string you want.
score: 1

http://stackoverflow.com/comment/44832211
score: 0
type: Comment
type: QuestionComment
has text: yep, because by default angular will match urls with `#` as prefix. i.e `#home/other/`
comment on: http://stackoverflow.com/q/28234337

http://stackoverflow.com/q/28189519
has title: Angular directive change ngmodel value to undefined
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28190160
has comment: http://stackoverflow.com/comment/44747434
tagged with: angularjs
has body: I'm using this form &lt;div ng-controller="TestController"&gt; &lt;form ng-submit="saveForm()"&gt; &lt;input type="text" name="test" ng-model="testData" test="{{testValue}}"/&gt; &lt;input type="submit" value="Save"/&gt; &lt;/form&gt; &lt;/div&gt; and this angular code: app.controller('TestController', [ '$scope', function($scope) { $scope.testData="testValue"; $scope.saveForm = function(){ console.log($scope.testData); } }]); app.directive('test', function($parse) { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { ctrl.$validators.validators = function(modelValue, viewValue) { }; } }; }); And after changing value in input and clicking save I'm getting undefined value in $scope.testData. Why and how to avoid that? I was trying to add: scope.testData = viewValue; inside function: ctrl.$validators.validators But it doesn't work - only by turns.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28190160
type: Question
tagged with: javascript

http://stackoverflow.com/q/28183444
has comment: http://stackoverflow.com/comment/45799526
has comment: http://stackoverflow.com/comment/45797989
has comment: http://stackoverflow.com/comment/45834665
has comment: http://stackoverflow.com/comment/45834881
tagged with: node.js
has comment: http://stackoverflow.com/comment/45800775
has comment: http://stackoverflow.com/comment/46293807
has comment: http://stackoverflow.com/comment/45833634
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28183454
has comment: http://stackoverflow.com/comment/45921864
has comment: http://stackoverflow.com/comment/45799291
tagged with: express-ntlm
has comment: http://stackoverflow.com/comment/45797979
has comment: http://stackoverflow.com/comment/45833576
has comment: http://stackoverflow.com/comment/45714719
has comment: http://stackoverflow.com/comment/45714829
has comment: http://stackoverflow.com/comment/45798827
has comment: http://stackoverflow.com/comment/45799054
has comment: http://stackoverflow.com/comment/45799451
linked to: http://stackoverflow.com/q/28825549
type: Question
has comment: http://stackoverflow.com/comment/45805001
has comment: http://stackoverflow.com/comment/45834911
answer count: 1
tagged with: javascript
has body: I am trying to use express-ntlm to get windows user name without authentication. in my app.js, i put the following: var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(favicon()); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded()); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); var ntlm = require('express-ntlm'); app.use(ntlm()); app.use('/search', search); This gives me a 401 error in node.js when loading http://localhost:3000/search In chrome console: Failed to load resource: Failed to load resource: net::ERR_UNEXPECTED what is the correct sequence of routing here? thanks. ========= modified to ============== var express = require('express'); var path = require('path'); var favicon = require('static-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var routes = require('./routes/index'); var TT = require('./routes/TT'); var KYEC_stat = require('./routes/KYEC_stat'); var ftc = require('./routes/ftc'); var volPerDevice = require('./routes/topVolPerDevice'); var search = require('./routes/search'); var ntlm = require('express-ntlm'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(favicon()); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded()); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use(ntlm()); app.use('/search', search); app.use('/tt', TT); app.use('/kyec', KYEC_stat); app.use('/ftc', ftc); app.use('/vol', volPerDevice); app.use('/', routes); /// catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); ======= topVolPerDevice.js ================ var config = require('../config.j…
has title: how to use express-ntlm to get windows user name without authentication using NODE.js?
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/45713807

http://stackoverflow.com/comment/44628786
type: Comment
comment on: http://stackoverflow.com/a/28127815
type: AnswerComment
has text: @Justme [accept an answer which helps you the most..](http://stackoverflow.com/help/accepted-answer)
score: 0

http://stackoverflow.com/a/28226133
has body: Here's a simple example you could go off from http://jsfiddle.net/zy65agrt/2/ Html 1 show Id 2 show Id Jquery $(document).ready(function(){ $("#tableId button").click(function(){ var trElem = $(this).closest("tr");// grabs the button's parent tr element var firstTd = $(trElem).children("td")[0]; //takes the first td which would have your Id alert($(firstTd).text()) }) }) When a row is clicked it will find the parent tr and then you can grab the td in that row that has your Id.
downvote count: 0
has comment: http://stackoverflow.com/comment/69085077
type: Answer
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/28225900

http://stackoverflow.com/a/36558620
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/60717860
score: -1
has body: "If for example, you wanted all charts created to be responsive, and resize when the browser window does, the following setting can be changed:" Chart.defaults.global.responsive = true; "Now, every time we create a chart, options.responsive will be true." Source: http://www.chartjs.org/docs/
type: Answer
answers question: http://stackoverflow.com/q/28162810
has comment: http://stackoverflow.com/comment/73239308

http://stackoverflow.com/comment/59836211
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/30929064
has text: @QuentinVaucelle-Auzel you just installed the package and then used the default indentation? I'm having the same problem but this doesn't solve it for me.

http://stackoverflow.com/q/28125120
has body: I am learning ajax and I need some help. I have two input buttons inserted one is for Upload and second is for submit form. When I remove form tab upload button works but submit button does not work. following is the HTML form &lt;form id="register" name="register" method="post" action="" &gt; &lt;table border="0" width="50%" cellpadding="2"&gt; &lt;tr&gt; &lt;td&gt;Product Name &lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="pname" name="pname" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Category&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt; &lt;select name="cateid" id="cateid"&gt;&lt;?php $sel="select * from mstcategory"; $swl=mysql_query($sel); while($data=mysql_fetch_array($swl)) { ?&gt; &lt;option value="&lt;?php echo $data['category'] ?&gt;"&gt;&lt;?php echo $data['category'] ?&gt;&lt;/option&gt;&lt;?php } ?&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Detail&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;textarea name="detail" id="detail" cols="45" rows="5"&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Image Location&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt; &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt; &lt;input name="uploadfile" type="submit" id="uploadfile" value="Upload" onclick="javascript:ajax_upload();" /&gt; &lt;?php $imgloc = '&lt;div id="status"&gt;&lt;/div&gt;' ?&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" name="submit" id="submit" value="Submit"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; Following is the javascript in head section &lt;script language="JavaScript" type="text/javascript"&gt; function ajax_upload(){ var img = document.getElementById("fileToUpload").files[0]; var hr = new XMLHttpRequest(); var url = "fileupload.php"; var formdata = new FormData(); { formdata.append("fileToUpload", img); } hr.onreadystatechange=function() { if(hr.readyState==4 &amp;&amp; hr.status==20…
tagged with: ajax
tagged with: php
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/44623554
type: Question
has answer: http://stackoverflow.com/a/28125182
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28125182
has title: Ajax not working with form tag
answer count: 1

http://stackoverflow.com/comment/44893876
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28247779
has text: Yes i know, just wanted to make sure whole code wont break!
type: AnswerComment

http://stackoverflow.com/a/28229908
downvote count: 0
has comment: http://stackoverflow.com/comment/44823155
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44822620
has body: &lt;script language="javascript" type="text/javascript"&gt; function open() { var start = '&lt;?php echo $start_time; ?&gt;'; var end = '&lt;?php echo $end = microtime(true); ?&gt;'; var uid = '&lt;?php echo $_SESSION['uid']; ?&gt;'; var corso = '&lt;?php echo $_SESSION['cod']; ?&gt;'; $.ajax({ url: "http://www.mysite.it/template/pages/save.php", type: "POST", data: "startt="+start+"&amp;endt="+end+"&amp;uid="+uid+"&amp;corso="+corso, success: function(){ // trigger when request was successfull alert("Recorded!"); }, }) } &lt;/script&gt;
answers question: http://stackoverflow.com/q/28229832

http://stackoverflow.com/q/28261953
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28262238
answer count: 1
tagged with: github
tagged with: ajax
has body: The request to GitHub Api is as simple as https://api.github.com/search/users?q=+location:Hong%20Kong&amp;page=1&amp;per_page=100 By this request, I would like to find out the current GitHub user who is in "Hong Kong". But the result return is not as expected,it doesn't return my colleagues GitHub results. If I change "Hong Kong" to "HK", the result is fine. Are there are any space character is not represent as %20 in their web request?
type: AnsweredQuestion
has title: How to search GitHub user with location has space
score: 0
has answer: http://stackoverflow.com/a/28262238

http://stackoverflow.com/q/28225649
has comment: http://stackoverflow.com/comment/44815992
type: Question
downvote count: 8
accepted answer: http://stackoverflow.com/a/28225716
has body: The red things are buttons. White boxes are some inputs that I would like to process. The first button "add": if a user presses it, the user will be able to select pictures. From PC. If the user selected, for example, 5 pictues. The first picture must be shown. Then the user inputs stuff in the fields and when the user presses done the user is then given the next image and again fields. On each "done" i would like to do something with those fields and image. I'm new to JavaScript.
answer count: 1
has title: How could I make something like this in javascript?
score: -8
has answer: http://stackoverflow.com/a/28225716
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44814570

xml-namespaces
tags question: http://stackoverflow.com/q/28189869
tag name: xml-namespaces
type: Tag

http://stackoverflow.com/a/28240802
has comment: http://stackoverflow.com/comment/44842713
has comment: http://stackoverflow.com/comment/64509378
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/72207851
upvote count: 85
has comment: http://stackoverflow.com/comment/72151897
has comment: http://stackoverflow.com/comment/72175777
type: Answer
accepted answer of: http://stackoverflow.com/q/28238628
has comment: http://stackoverflow.com/comment/44843111
answers question: http://stackoverflow.com/q/28238628
score: 84
downvote count: 1
has comment: http://stackoverflow.com/comment/72186456
has body: There are two types of "upgrades" happening with socket.io. First (in socket.io 1.0+), socket.io starts all connections with an http polling request and it may actually exchange some initial data with just an http request. Then, at some point after that, it will try to actually initiate a webSocket connection. the webSocket connection is done by sending a particular type of http request that specifies an upgrade: websocket header and the server can then respond appropriately whether it supports websocket or not. If the server agrees to the upgrade, then that particular http connection is "upgraded" to the webSocket protocol. At that point, the client then knows that webSocket is supported and it stops using the polling http requests, thus completing its upgrade to webSocket. You can prevent the initial http polling entirely by doing this on the client: var socket = io({transports: ['websocket'], upgrade: false}); This will prevent polling connections from your own cooperating clients. If you want to prevent any clients from ever using polling, then you can add this to the server: io.set('transports', ['websocket']); But, if you set this on the server, socket.io clients that are initially connecting with http polling will not work at all. So, this should only be matched with the right settings in the client such that the client never starts with polling. This will tell both ends that you only want to use webSockets and socket.io will skip the extra http polling at the beginning. Fair warning, doing this requires webSocket support so this rules out compatible with older versions of IE that didn't yet support webSocket. If you want to retain compatibility, then just let socket.io do it's thing with a couple http requests initially. Here's more info on the protocol upgrade from http to webSocket. The webSockets protocol initiates EVERY webSocket with an HTTP connection. That's the way all webSockets work. That HTTP connection contains some headers on it that indicate th…
has comment: http://stackoverflow.com/comment/65526992
has comment: http://stackoverflow.com/comment/44842939
has comment: http://stackoverflow.com/comment/44842880

http://stackoverflow.com/comment/44904281
type: Comment
has text: I gave that a shot, but it did not work. I know that the button is hearing the click because I tested it out with an alert which did display when I clicked.
score: 0
comment on: http://stackoverflow.com/a/28270945
type: AnswerComment

http://stackoverflow.com/a/28268360
answers question: http://stackoverflow.com/q/28268338
has body: You don't need to use the function return value (which you get by calling the function), but the function body: $('h1').slideUp('slow', last); What you did is the same as this: var returned = last(); // call to last returns undefined // so returned has the value undefined $('h1').slideUp('slow', returned); // simply sending undefined as a callback So you were just executing the last function inline, and then passing the return value (which is undefined since it returns nothing) as a parameter to the slideUp's callback function. Hope this example will help you understand: function outer() { function inner() {}; return inner; } alert(outer); // returns the outer function body alert(outer()); // returns the outer function's return value, which is the inner function
type: Answer
has comment: http://stackoverflow.com/comment/44893015
has comment: http://stackoverflow.com/comment/44892871
has comment: http://stackoverflow.com/comment/44893183
upvote count: 2
has comment: http://stackoverflow.com/comment/44892851
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28268338

http://stackoverflow.com/q/28132452
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16063394
tagged with: node.js
has body: I'm trying to create an Object constructor that receives an arbitrary number of arguments. It would be convenient to apply the values in an array to the constructor, just as convenient as the 'apply()' method is for functions, but if I try this: var arr = [1,2,3]; var a = new Obj.apply(null, arr); It throws:TypeError: function apply() { [native code] } is not a constructor It would also be convenient so I could make use of the 'new' keyword optional, like: function Obj() { if (!(this instanceof)) { return new Obj.apply(arguments); } this.a = arguments[0]; this.b = arguments[1]; this.allArr = Array.prototype.slice.call(arguments); } Is there any way around it?
answer count: 0
has title: Constructor equivalent of Function.prototype.apply()
score: 1
has comment: http://stackoverflow.com/comment/44644570
type: Question
upvote count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44637398
duplicate of: http://stackoverflow.com/q/28132226
downvote count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/28132226

http://stackoverflow.com/comment/44791343
score: 0
has text: @Spokey Thanks a lot, problem solved. I needed to play with on() and off() :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28212834

http://stackoverflow.com/q/28266507
has comment: http://stackoverflow.com/comment/44889983
has title: Use off() directly in on() callback Firebase?
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44890742
tagged with: javascript
score: 6
favorite count: 0
upvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44891627
has answer: http://stackoverflow.com/a/28266537
accepted answer: http://stackoverflow.com/a/28266537
type: Question
tagged with: firebase
has body: Let's say I have a one and done operation. Like deletes. var q = ref.child('users').child(targetUserId).child('chat'); q.on('child_added', function(obj) { obj.ref().remove(); //This works right? q.off(); }); Can I execute off() directly in the on() callback? I don't need to specify eventType correct? Nothing else to clean up right? From the docs: Similarly, if no eventType or callback is specified, all callbacks for the reference will be removed.

http://stackoverflow.com/a/30447750
has body: I executed the same tests from JSPerf in Chrome canary 45 and Firefox 37, sadly the results are opposite: function myfunc() { alert("yo"); } myfunc(); Chrome: fastest, FF: much slower var myfunc = function() { alert("yo"); } myfunc(); FF: fastest, Crome: much slower So, the answer is: it depends from the browser/JS engine.
score: 0
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28185860

http://stackoverflow.com/a/28231620
score: 0
has body: Just make use of anchors and alternation operator | function clickHandler(e){ var evt = e || window.event, target = evt.target || evt.srcElement, cls = target.className,id = target.id; if(/\bcell(\s|$)/i.test(cls)){ //perform some action is node having classname cell is clicked } } But it would be better if you did something like if(cls.split(" ").indexOf("cell") &gt; -1){ }
type: Answer
answers question: http://stackoverflow.com/q/28231558

http://stackoverflow.com/a/36450764
answers question: http://stackoverflow.com/q/28262012
score: 0
has body: I've just had a similar problem, and i don't know if this applies to you, but in my case it was the fact that i had two templates (two HTML files) with the same template name. Once i removed one of them, all came back to normal. I.e., i had this line in both file1.html and file2.html : &lt;template name="sampleList"&gt; Nothing really indicated where the problem lied.
type: Answer

http://stackoverflow.com/q/28262971
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44883066
score: 0
has answer: http://stackoverflow.com/a/28263127
has body: Using functional inheritance we can extend objects by passing them as the context of a function call assigning to this. This doesn't seem to work as I'd expect for the Array constructor. var ctx = { foo: "foo" }; Array.call(ctx); ctx -> Object(foo: "foo") Conversely this does work with other constructor looking functions. var fakeArrayConstructor = function () { this.length = 5; } fakeArrayConstructor.call(ctx); ctx -> Object {foo: "foo", length: 5} Does the Array constructor not assign some of its properties using this or is there something else going on? I know that a lot of the functionality associated with arrays is stored on Array.prototype however that's not my focus for this exercise.
has answer: http://stackoverflow.com/a/28263088
has comment: http://stackoverflow.com/comment/44883901
has comment: http://stackoverflow.com/comment/44883043
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44883000
has title: Object extending Array with Functional Inheritance
has comment: http://stackoverflow.com/comment/44883191
tagged with: prototypal-inheritance
has comment: http://stackoverflow.com/comment/44883352
has comment: http://stackoverflow.com/comment/44884321
has comment: http://stackoverflow.com/comment/44883514

http://stackoverflow.com/q/28216483
has body: I am using fast click and I am applying it to the body by: FastClick.attach(document.body); How do I not apply it to an element like: My El -- Do not apply fastclick to this element UPDATE Missed the doc which tells how to
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44796340
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28216521
accepted answer: http://stackoverflow.com/a/28216521
type: Question
tagged with: fastclick.js
tagged with: javascript
upvote count: 2
has title: How to remove fastclick from a specific element?

http://stackoverflow.com/comment/44624045
score: 1
type: QuestionComment
type: Comment
has text: `websocket` is ur best bet for many reasons ,and yes its a daunting process but u can use something call pusher https://www.pusher.com/ which basically is a service that do all the crazy work for u and u just add some code in `js & php` to bind the data to the channel/pipe u will stream updates through.
comment on: http://stackoverflow.com/q/28125226

http://stackoverflow.com/comment/44854958
score: 0
comment on: http://stackoverflow.com/q/28245441
type: Comment
type: QuestionComment
has text: kind of. A graphical console.dir() maybe.

http://stackoverflow.com/comment/44894633
comment on: http://stackoverflow.com/a/28268523
has text: @Esailija: Argh, I had `typeof xx != "function"` at first but then figured that non-function values would already trigger the other warning(s) in `Promise.method`. Thanks for the quick heads-up, fixed it already :-)
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28230704
answers question: http://stackoverflow.com/q/28227497
type: Answer
score: 1
upvote count: 1
has body: Angular can $anchorScroll to an element: angular.module('anchorScrollExample', []) .controller('ScrollController', ['$scope', '$location', '$anchorScroll', function ($scope, $location, $anchorScroll) { $scope.gotoBottom = function() { // set the location.hash to the id of // the element you wish to scroll to. $location.hash('bottom'); // call $anchorScroll() $anchorScroll(); }; }]);
downvote count: 0

http://stackoverflow.com/q/28218188
tagged with: javascript
has answer: http://stackoverflow.com/a/28218537
score: -1
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44799878
favorite count: 0
type: UnansweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/44800098
has title: JS - number circular reference
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44800537
has comment: http://stackoverflow.com/comment/44800033
has body: I have a variable (number) that can span from -180 to 180. Is there a way I can create a circular reference so that when the variable is 180 || -180 it will be equidistant from 90 and -90? My code is quite complicated now, and I haven't set a pen yet; but basically I'm rotating a cube on Y axis and if back of the cube is set to rotateY(180deg) for it to reach the left-side (that's set on rotateY(-90deg)) it will pass through right-side (that's set on rotateY(90deg)) , front-side (that's set on rotateY(0deg)).... And since it needs to work both ways around I can't set it neither to -180; EDIT 1 I posted a pen; hopefully looking at the example you can understand what I mean;
has comment: http://stackoverflow.com/comment/44800027
tagged with: math

http://stackoverflow.com/comment/44710596
score: 0
comment on: http://stackoverflow.com/a/28170291
type: AnswerComment
type: Comment
has text: I have updated my answer to satisfy that requirement.

http://stackoverflow.com/comment/44649311
has text: @EasyBB: I just corrected his code with minimal changes (thats what he actually asked in the question). Your inputs are helpful for performance optimization and better understanding. Thanks :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28138279
type: Comment

http://stackoverflow.com/a/28229759
score: 0
has body: in short is as follows: //!length = if(x.length); var a; //undefined == if(!a) == !length var b = ""; //void == if(!b) var c = " "; //blank == if(c) == length var d = "text"; //there == if(d) == length var e = true; //true == true == if(e) var f = false; //false == false == if(!f) var g = null; //false == if(!g) == !length var h = 0; //0 == if(!h) var i = 1; //true == if(i) var j = 0/0; //NaN == if(!j) var k = document.body; // == if(k) var l = document.getElementById("nothing"); // if(!l) == !length Javascript is very flexible with regards to checking for "null" values. I'm guessing you're actually looking for empty strings, in which case this simpler code will work: if(!blah){ Which will check for empty strings (""), null, undefined, false and the numbers 0 and NaN var a; //undefined == if(!a) == !length var b = ""; //void == if(!b) var c = " "; //blank == if(c) == length var d = "text"; //there == if(d) == length var e = true; //true == true == if(e) var f = false; //false == false == if(!f) var g = null; //false == if(!g) == !length var h = 0; //0 == if(!h) var i = 1; //true == if(i) var j = 0/0; //NaN == if(!j) var k = document.body; // == if(k) var l = document.getElementById("nothing"); // if(!l) == !length consoletotal(l); function consoletotal(bb){ consolea(bb); consoleb(bb); consolec(bb); consoled(bb); consolee(bb); } function consolea(bb){ if(bb){ console.log("yes" + bb); } } function consoleb(bb){ if(bb===true){ console.log("true" + bb); } } function consolec(bb){ if(bb===false){ console.log("false" + bb); } } function consoled(bb){ if(!bb){ console.log("no" + bb); } } function consolee(bb){ if(bb.length){ console.log("length" + bb); } }
answers question: http://stackoverflow.com/q/28229343
type: Answer

http://stackoverflow.com/comment/44806448
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28210858
has text: I have edited my code as per my understanding. Can you please guide me further. this thing is really imp for me. :(

http://stackoverflow.com/comment/44916771
comment on: http://stackoverflow.com/q/28243306
has text: Shouldn't your helper be called rather `ifAll` not `ifAny` since you wan't it to show the contents if all arguments exist?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28135499
answer count: 3
has answer: http://stackoverflow.com/a/28170013
has answer: http://stackoverflow.com/a/28169584
favorite count: 0
accepted answer: http://stackoverflow.com/a/28169584
has body: I have problem with unknown javascript script which scrolldown when enter page (I think it's javascript). I trying to find over firebug, code, delete scripts, I even deleted all styles,scripts, and had a clean code. When enter this page only in chrome browser its scroll down to comments div, I have no idea why only chrome, firefox it's not do this, I have tested 2 computers them both the same on chrome. This is the link of the page: http://test.ibids.co.il/add/120 Which script do it or what cause to do this? EDIT 1 (27/01) : I don't think it's js as I have removed all JS from code. EDIT 1 (27/01) : It wad addthis script problem.
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/23571844
has comment: http://stackoverflow.com/comment/44645462
possible better answer: http://stackoverflow.com/a/28170684
type: AnsweredQuestion
upvote count: 2
downvote count: 2
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/44646814
tagged with: javascript
has title: Unknown javascript script scrolldown when enter page
has answer: http://stackoverflow.com/a/28170684
score: 0

http://stackoverflow.com/a/28253843
has comment: http://stackoverflow.com/comment/44869295
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44869067
type: Answer
answers question: http://stackoverflow.com/q/28252933
downvote count: 0
score: 1
has body: http://plnkr.co/edit/mv4BGznmjhCb1faeWeZl?p=preview I added a init sort sortInfo: {fields:['name'], directions:['desc']}, and you used in the goPrevious $scope.gridOptions.selectItem(selectedRowIdx - 1, true); instead of $scope.gridOptions.selectRow(selectedRowIdx - 1, true); Edit: If you need the index in your data from an index after sort you can use this $scope.gridOptions.ngGrid.rowMap.indexOf(selectedRowIdx);
accepted answer of: http://stackoverflow.com/q/28252933

http://stackoverflow.com/comment/44866830
type: AnswerComment
comment on: http://stackoverflow.com/a/28253790
type: Comment
has text: I've pasted the code you wrote in my file, adding controllaAmicizie_fake, doPost and "document.getElementById("friend_request").className = "hide" in reimpi_friend_request. Then i've added the .hide class and the "serverPoll" div after the "friend_request" one! But the result is always the same... Where i'm wrong?
score: 0

http://stackoverflow.com/comment/44804746
score: 0
type: AnswerComment
has text: @StudentRik Values of what? The dropdown? Or of localStorage?
type: Comment
comment on: http://stackoverflow.com/a/28220216

http://stackoverflow.com/a/28228164
score: 1
upvote count: 1
has body: Well, you should first beautify the code. It really is hard to see where to go if the code is a mess. The first step is to make it prettier (I use jsbeautifier). From there you'll see code similar to this: eval(function(d, e, a, c, b, f) { ... }(...)) Because there is no complex obfuscation involved, we can simply replace eval with a variable statement. var x = (function(d, e, a, c, b, f) { ... }(...)) Here we are basically telling the variable "x" to equal the returned code from the function. Next, console.log() the value of x like so. console.log(x); You'll notice that the code is a bit more readable now, progress! If you look through the output code, you'll notice that it follows a similar pattern of encoded characters. We can deobfuscate this code by entering it into jsbeautifier's simple textarea with "Unescape Printable Chars" checked. From here, you'll notice yet another eval statement at the bottom of the rendered code. I won't go down another level, but hopefully this post gives you the basics of deobfuscation. To continue deobfuscation, you'd simply remove the if statement and change eval to another variable declaration and console.log() that return. As you go further into deobfuscation, you will be able to understand the source more. The JavaScript obfuscator CryptoJS is open-source if you want to check out its source code. Good luck!
type: Answer
answers question: http://stackoverflow.com/q/28227621
downvote count: 0

http://stackoverflow.com/a/28253404
has comment: http://stackoverflow.com/comment/44866490
score: 1
has body: If you dont want setting to be an Array you can keep settings as Object and refer it to the Settings model. while fetching you can populate the settings. Changes: var mongoose = require('mongoose'); var Schema = mongoose.Schema; /*Model for user settings */ var SettingsSchema = new Schema({ shoppingDay: {type: String, default : "Friday"}, shoppingFrequency : {type: String, default : "weekly"}, reminderEmails : {type: Boolean, default : true} }); module.exports = mongoose.model('Settings', SettingsSchema); var mongoose = require('mongoose'); var Schema = mongoose.Schema; /*Model for user settings */ var UserTrendSchema = new Schema({ email : String, settings : {type: Schema.Types.ObjectId, ref: 'Settings'} // refers to Settings Model. }, {collection : 'UserTrends'}); module.exports = mongoose.model('UserTrend', UserTrendSchema); Where settings will be objectId and can be populated. Hope this helps.
has comment: http://stackoverflow.com/comment/44867851
has comment: http://stackoverflow.com/comment/44898188
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28248628
has comment: http://stackoverflow.com/comment/44865916
type: Answer

http://stackoverflow.com/a/28169165
has comment: http://stackoverflow.com/comment/44708349
type: Answer
downvote count: 0
score: 1
has body: You don't need to specify ecmascript or javascript at all. If you leave out the type attribute altogether it defaults to javascript. ecmascript is just a synonym for javascript. Additionally you cannot create SVG elements using createElement. You must use createElementNS instead var newrect=document.createElementNS("http://www.w3.org/2000/svg", "rect");
answers question: http://stackoverflow.com/q/28169026
upvote count: 1
has comment: http://stackoverflow.com/comment/44708462

http://stackoverflow.com/comment/44740235
comment on: http://stackoverflow.com/q/28185680
score: 0
type: Comment
type: QuestionComment
has text: If you put `console.log(email)` just before the `var eln..` line, does it work? Can you show us what the actual output of `console.log(email)` is?

http://stackoverflow.com/comment/44779680
score: 1
has text: Where do you call `session_start()`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28207303

yii
tags question: http://stackoverflow.com/q/28273952
tag name: yii
type: Tag
tags question: http://stackoverflow.com/q/28275478
tags question: http://stackoverflow.com/q/28141864

http://stackoverflow.com/comment/44852628
score: 1
has text: The key to fast performance is memory management and making sure the end result is not over utilizing the fragile DOM. Another big factor for speed is how the library treats the visualization of the data provided. Again, I will be focusing on google charts. http://plnkr.co/edit/50kKUUg8xtl9m4PcX6BW?p=preview
type: AnswerComment
comment on: http://stackoverflow.com/a/28222933
type: Comment

http://stackoverflow.com/comment/44733624
score: 0
type: QuestionComment
type: Comment
has text: please can you put it in my code cos i'm new to javascript
comment on: http://stackoverflow.com/q/28182126

http://stackoverflow.com/q/28235888
downvote count: 2
type: AnsweredQuestion
tagged with: algorithm
has comment: http://stackoverflow.com/comment/44833277
has comment: http://stackoverflow.com/comment/44833612
has comment: http://stackoverflow.com/comment/44833464
has comment: http://stackoverflow.com/comment/44833154
has body: I don't know whether this is the appropriate place (in negative case, please redirect the question, I suppose in Mathematics). Basicly I have a rectangle and I have to place n ports (on the left side, equidistantly from the center and from the nearest "last point" of the side) and m ports (on the right side, equidistantly from the center and from the nearest "last point" of the side). The ports are also small rectangles, but is not important. For example, let's suppose that my rectangle is 50px X 50px and I have 1 input port and 2 output ports. In this case I have to place the input port in (x:0,y: 25) and the output ports in positions (x:50, y:10) and (x:50, y:40). Of course the problem is about y-coordinate. I don't know the number of input and output ports a priori, so I have to write a method to calculate y-coordinates automatically. Is there any built in algorithm for this?
type: Question
has comment: http://stackoverflow.com/comment/44833297
upvote count: 0
score: -2
has title: Algorithm for placing n points equidistantly
tagged with: javascript
has comment: http://stackoverflow.com/comment/44833319
has comment: http://stackoverflow.com/comment/44833517
has comment: http://stackoverflow.com/comment/44833279
answer count: 1
has answer: http://stackoverflow.com/a/28236257
accepted answer: http://stackoverflow.com/a/28236257
favorite count: 0
has comment: http://stackoverflow.com/comment/44833248
has comment: http://stackoverflow.com/comment/44833738
has comment: http://stackoverflow.com/comment/44833219

http://stackoverflow.com/comment/44684730
type: Comment
has text: I swear, some days I just shouldn't even touch the keyboard. Thanks for catching that.
comment on: http://stackoverflow.com/a/28156662
score: 0
type: AnswerComment

http://stackoverflow.com/q/28244932
upvote count: 8
type: Question
accepted answer: http://stackoverflow.com/a/28353443
has comment: http://stackoverflow.com/comment/44871632
has title: Socket.io No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access
has comment: http://stackoverflow.com/comment/44850838
tagged with: javascript
has answer: http://stackoverflow.com/a/28353443
answer count: 3
has answer: http://stackoverflow.com/a/28245148
has comment: http://stackoverflow.com/comment/45051559
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/28418736
possible better answer: http://stackoverflow.com/a/28245148
has comment: http://stackoverflow.com/comment/45170336
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has body: I'm trying to learn nodejs with socket.io and at the moment I'm using this tutorial by GianlucaGuarini. When entering my client.html file I get the following error. I know what it means and that it´s there for preventing Cross browser scripts but I don´t know how to allow my nodejs script to access the client.html file. XMLHttpRequest cannot load http://localhost:8000/socket.io/?EIO=3&amp;transport=polling&amp;t=1422653081432-10. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. Here is a part of my code with socket. var app = require('http').createServer(handler), io = require('socket.io').listen(app), fs = require('fs'), mysql = require('mysql'), connectionsArray = [], connection = mysql.createConnection({ host: 'localhost', user: 'root', password: '', database: 'database', port: 3306 }), POLLING_INTERVAL = 3000, pollingTimer; // If there is an error connecting to the database connection.connect(function(err) { // connected! (unless `err` is set) console.log(err); }); // creating the server ( localhost:8000 ) app.listen(8000); // on server started we can load our client.html page function handler(req, res) { res.writeHead(200, { /// ... 'Access-Control-Allow-Origin' : '*' }); fs.readFile(__dirname + '/client.html', function(err, data) { if (err) { console.log(err); res.writeHead(500); return res.end('Error loading client.html'); } res.writeHead(200); res.end(data); }); } Does anyone know how I can solve my problem? Kind regard / H
tagged with: socket.io

http://stackoverflow.com/q/28176766
answer count: 1
has title: Add active HTTP login to browser
type: AnsweredQuestion
has body: Is it possible to add an "active login" (Firefox terminology for HTTP credentials) to a browser by using JavaScript? The JavaScript would simply give username and password to the browser. If it is possible: How? The goal is to get rid of the popup a browser shows when it asks for HTTP credentials. It only shows the popup if it does not already know the credentials. To do this, I'd like to show a HTML login form, let the user enter the credentials in it, and on submit pass them to the browser by executing some JS and then redirecting to the protected content.
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/28176914
accepted answer: http://stackoverflow.com/a/28176914
tagged with: http-authentication
tagged with: javascript
score: 0

http://stackoverflow.com/comment/44775933
has text: You can't expect anyone to magically know where you put something in your code if you don't show it. The same goes for resolving errors.
comment on: http://stackoverflow.com/a/28204372
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44713286
has text: You want the point truly from query or without query? Its a custom class in code but you name it a query.
comment on: http://stackoverflow.com/q/28171971
score: 0
type: Comment
type: QuestionComment

rsvp.js
type: Tag
tag name: rsvp.js
tags question: http://stackoverflow.com/q/28218364

http://stackoverflow.com/a/55013028
has body: Here's a solution that works in IE11 as well. I just did a bunch of testing of various methods of this and while the above answer by Ciro Costa is fantastic in that it works in Firefox and Chrome it does not work in IE11. IE11 fails due to a security issue with rendering an svg to the canvas which requires a canvas implementation, canvg. Here's a solution using canvg that's pretty terse and works in the latest versions of Chrome, Firefox, Edge, and IE11. Fiddle: https://jsfiddle.net/StefanValentin/9mudw0ts/ DOM <rect x="10" y="10" width="50" height="50" /> Look, i'm cool JavaScript var svg = document.querySelector('#my-svg'); var data = (new XMLSerializer()).serializeToString(svg); // We can just create a canvas element inline so you don't even need one on the DOM. Cool! var canvas = document.createElement('canvas'); canvg(canvas, data, { renderCallback: function() { canvas.toBlob(function(blob) { download('MyImageName.png', blob); }); } }); The download function above could be whatever you want to do, as there are many ways to trigger a download via JavaScript. Here's the one we use that works in all the browsers I've tested. // Initiate download of blob function download( filename, // string blob // Blob ) { if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else { const elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } }
type: Answer
answers question: http://stackoverflow.com/q/28226677
score: 5
downvote count: 2
upvote count: 7
has comment: http://stackoverflow.com/comment/103059310
has comment: http://stackoverflow.com/comment/105968948

http://stackoverflow.com/comment/44818740
has text: what if tab is in the middle of a line?
comment on: http://stackoverflow.com/a/28227816
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/28154318
has body: You'd need to capture the original alert() function so you can call it if need be: var origalert = window.alert; window.alert = function(msg) { if (msg.IndexOf('whatever') &gt;= 0) { origalert(msg); } else { ... whatever ... } }
score: 1
answers question: http://stackoverflow.com/q/28154180
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44680088
has comment: http://stackoverflow.com/comment/44680221
has comment: http://stackoverflow.com/comment/44680256
upvote count: 1

http://stackoverflow.com/q/28273588
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28278798
score: 1
has body: I googled some examples and tutorials but couldn't find any clear example for my case. I get a JSON response from my server like this: var heroes = [ { id: 5, name: 'Batman', realName: 'Bruce Wayne', equipments: [ { type: 'boomarang', name: 'Batarang', }, { type: 'cloak', name: 'Bat Cloak', }, { type: 'bolas', name: 'Bat-Bolas', } ] }, { id: 6, name: 'Cat Woman', realName: 'Selina Kyle', equipments: [ { type: 'car', name: 'Cat-illac', }, { type: 'bolas', name: 'Cat-Bolas', } ] } ]; I would like to query for example: "get heroes with equipment type of bolas" and It should return both hero objects in an array. I know it is not right but what I am trying to do is to form a map function like this: function myMapFunction(doc) { if(doc.equipments.length &gt; 0) { emit(doc.equipment.type); } } db.query(myMapFunction, { key: 'bolas', include_docs: true }).then(function(result) { console.log(result); }).catch(function(err) { // handle errors }); Is it possible? If not what alternatives do I have? P.S: I also checked LokiJS and underscoreDB. However PouchDB looks more sophisticated and capable of such query. Thank you guys in advance
favorite count: 0
type: Question
answer count: 1
tagged with: nosql
accepted answer: http://stackoverflow.com/a/28278798
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: pouchdb
has title: Querying nested objects in PouchDB

http://stackoverflow.com/comment/44652503
has text: It is - `ASYNCHRONOUS`
comment on: http://stackoverflow.com/q/28140459
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28210432
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28209558
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28209558
has body: The concept is as follows : create a function to handle the behavior you want; set the function from the first article as a handler to the HTML element. HTML : &lt;select id="selectCategory" onchange="getClass(this)"&gt; &lt;...&gt; &lt;/select&gt; JavaScript : function getClass(sel){ console.log(sel.options[sel.selectedIndex].className) } JSFiddle You can also set handler via js methods, without interacting with html : document.querySelector('#selectCategory').onchange = function (){ console.log(document.querySelector('#selectCategory option:checked').className) } JSFiddle There is also an option with using setAttribute() method, the only flaw is a hard-coded part 'getClass(this)'. function getClass(sel){ console.log(sel.options[sel.selectedIndex].className) } document.querySelector('#selectCategory').setAttribute('onchange', 'getClass(this)') JSFiddle
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44684993
has text: I guess I didn't think of the fact that not passing arguments is also a valid case.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28156662
type: AnswerComment

http://stackoverflow.com/comment/44861817
type: QuestionComment
score: 1
has text: Where's your code hiding? Without the code it's hard to say anything.
comment on: http://stackoverflow.com/q/28251206
type: Comment

http://stackoverflow.com/comment/44897364
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28270797
has text: @PSL I have tried attaching function with scope var, but it is not still working

http://stackoverflow.com/a/28217708
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28216761
has comment: http://stackoverflow.com/comment/44838218
answers question: http://stackoverflow.com/q/28216761
upvote count: 2
type: AcceptedAnswer
has body: As written in the docs, orderBy only works with arrays. Therefore, it might be suitable for you to convert your object into an array and simply call sort(). Fiddle
type: Answer
score: 2

http://stackoverflow.com/comment/44878898
type: AnswerComment
type: Comment
has text: First of all I want to say thank you so much, whatever I was doing earlier when attempting this just wasn't working, so this is greatly appreciated! It seems like it's going to work but i keep getting an error on this line Parse error: syntax error, unexpected '[', expecting ')'
comment on: http://stackoverflow.com/a/28260724
score: 0

http://stackoverflow.com/comment/44717118
comment on: http://stackoverflow.com/q/28167925
score: 0
has text: Could you keep a sorted list of the rectangle start indeces and sizes in memory and figure it out that way? Sorry if you've considered this already, but it's not clear to me from your post.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28241399
downvote count: 0
has body: Use the hasOwnProperty method. Example: var arr = ["test"]; for (var e in arr) { if (arr.hasOwnProperty(e)) { console.log(e); } } Good explanation on why this is necessary: https://stackoverflow.com/a/12017703/1387396 Details on the hasOwnProperty method and its use in for .. in loops: Object.prototype.hasOwnProperty() - JavaScript | MDN
type: Answer
answers question: http://stackoverflow.com/q/28241338
upvote count: 1
score: 1

http://stackoverflow.com/comment/44648353
score: 1
has text: This question is a complete X-Y problem. You made `change color` so vague and now what seems like best approach isn't. Where do the color values come from and why aren't you focusing on them? This is a classic case of an `X-Y problem`
type: Comment
comment on: http://stackoverflow.com/q/28138008
type: QuestionComment

http://stackoverflow.com/comment/44793571
type: Comment
has text: @MadBrozzeR: Re simplicity: Exactly. :-) Much better off just using an array.
comment on: http://stackoverflow.com/a/28210893
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44931905
type: Comment
comment on: http://stackoverflow.com/a/28270975
type: AnswerComment
has text: As it seems chrome uses another technique to draw the panorama. At least for me in Firefox the panorama will be drawn via ` `-elements, chrome uses ` `
score: 0

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/28181554
tags question: http://stackoverflow.com/q/28142880
tags question: http://stackoverflow.com/q/28156683

http://stackoverflow.com/q/28272659
tagged with: web
has body: I am developing a web application in which, once the user has successfully logged in the browser type should be detected. If the page was opened on an Android phone the user should be able to download an APK file. On iOS however a link to the app in the AppStore should be presented.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44904872
duplicate of: http://stackoverflow.com/q/11219582
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/44910040
linked to: http://stackoverflow.com/q/11219582
has answer: http://stackoverflow.com/a/28359832
has title: Web application to download apk file
tagged with: javascript
has comment: http://stackoverflow.com/comment/44904359
score: 0
answer count: 1

toggle
tags question: http://stackoverflow.com/q/28210320
tags question: http://stackoverflow.com/q/28213044
type: Tag
tags question: http://stackoverflow.com/q/28172250
tags question: http://stackoverflow.com/q/28122603
tag name: toggle
tags question: http://stackoverflow.com/q/28275737
tags question: http://stackoverflow.com/q/28243786

http://stackoverflow.com/comment/44651743
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28140084
has text: Use jQuery to request it from YQL, and your future imployer will be thoroughly impressed
type: QuestionComment

http://stackoverflow.com/a/28227619
downvote count: 0
has comment: http://stackoverflow.com/comment/44950475
type: Answer
upvote count: 1
has body: @thalesmello The code now function worldGen(){ var lvl = 100; for (x=0; x&lt;=50; x++){ imageObj.src = "grass.png"; square.n.push(imageObj); } for(x=0; x&lt;=6; x++){ for(y=0; y&lt;=x; y++){ for(n=1; n&lt;=25; n++){ i= Math.floor(Math.random()) square.x[n] = (x*64-(40*x)+158 - (48)); square.y[n] = (y*64-(32*x)+250); drawDiamonds(n) } } } for(x=6; x&gt;=0; x--){ for(y=0; y&lt;=x; y++){ for(n=26; n&lt;=50; n++){ square.x[n] = (x*64-(40*(x+x+x/5)-400)); square.y[n] = (y*64-(32*x)+250); drawDiamonds(n) } } } } } function drawDiamonds(n){ context.drawImage(square.n[n], square.y[n], square.x[n], 64, 64); cLogDiamonds() } function cLogDiamonds(){ console.log("Tile X: "+x+" | Tile Y: "+y+" - X Pos: "+square.x[x]+" | Y Pos: "+square.y[y]); } So a big thanks to you, seriously thank you. it generates awesomely now
score: 1
answers question: http://stackoverflow.com/q/28218377

http://stackoverflow.com/comment/44761256
has text: I'm looking at it, but I can't find your ` `. But what I was saying is like. Where you are doing `$songs.tracks = jsonObject.played_tracks;`, I was suggesting that you could add to the `$songs.tracks` the attribute `fullUrl`, like: `var tracks = jsonObject.played_tracks; for(var i in tracks){ tracks[i].fullUrl = "http://www.youtube.com/embed/+tracks[i].youtube_ids.default+?rel=0?rel=0&amp;hd=1" } $songs.tracks = tracks`
type: AnswerComment
comment on: http://stackoverflow.com/a/28194208
score: 0
type: Comment

http://stackoverflow.com/a/58849566
has comment: http://stackoverflow.com/comment/112980105
has body: If you're using jQuery, the below code will disable the context menu (aka 'right click'). $(document).on("contextmenu",function(){ return false; }); });
type: Answer
answers question: http://stackoverflow.com/q/28222548
downvote count: 1
score: 3
upvote count: 4

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/28199016
tags question: http://stackoverflow.com/q/28167867
type: Tag

http://stackoverflow.com/q/28138200
type: Question
has comment: http://stackoverflow.com/comment/44647965
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28138279
has comment: http://stackoverflow.com/comment/44648097
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28138279
has comment: http://stackoverflow.com/comment/44647947
has title: Javascript + DOM - links within same page
type: AnsweredQuestion
has body: I have a existing page with several entries(divs), and I loop trough all of them to fetch the wanted content(headers) to create a list of links. In the process I assign each header a unique ID, but I can't seem to get my list of links to "connect" to the specific entries. Javascript: var entries = document.getElementsByClassName('entry'); var ul = document.createElement('ul'); for (var i = 0; i &lt; entries.length; i++) { var li = document.createElement('li'); var heading = entries[i].getElementsByTagName('h2')[0]; var addId = heading.setAttribute("id", "#entry" + i); var x = heading.getAttribute("id"); var headingText = document.createTextNode(heading.firstChild.nodeValue); var link = document.createElement('a'); link.setAttribute("href", x); link.appendChild(headingText); li.appendChild(link); ul.appendChild(li); } var target = document.getElementById('newdiv'); target.appendChild(ul); What am I missing, or doing wrong? When I hover over my list with links, they show the link as supposed - but nothing happens when I click it. If I inspect the DOM I can also see that all of the headers got assigned a unique ID.
tagged with: dom

http://stackoverflow.com/comment/44861683
comment on: http://stackoverflow.com/q/28250996
has text: I'm not sure, but you could pass a reference `run: functionRun1`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44673287
score: 0
type: Comment
type: QuestionComment
has text: To those voting to reopen, can I ask *why you're voting to reopen?* What saves this question that I, and others, have yet to see?
comment on: http://stackoverflow.com/q/28150792

http://stackoverflow.com/q/28174210
has comment: http://stackoverflow.com/comment/44744090
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28176250
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44719364
tagged with: javascript
score: 0
has body: I have the following structure: { game_number: 101, type: 1, players: ["x1","x2","x3"], scores: [ { "x1" : 0 }, { "x2" : 1 } ] } There is a game in which 3 players are playing. Players x1 and x2 have already finished and have their final scores. Player x3 has not finished yet. My idea was to check the scores in this structure and see who has already finished or not so I can have in Meteor something like: {{#if playerHasFinished player}} &lt;div class="result"&gt; ... &lt;/div&gt; {{else}} &lt;div class="waiting"&gt; ... &lt;/div&gt; {{/if}} I am not sure if I am structuring my data correctly, so maybe there is my "functional" mistake, but it should be possible to do it anyway, right? How would I access that data?
answer count: 1
tagged with: meteor
has answer: http://stackoverflow.com/a/28176250
has title: Handling nested dictionaries in Meteor and mongodb
has comment: http://stackoverflow.com/comment/44721374
tagged with: handlebars.js
tagged with: dictionary

http://stackoverflow.com/a/28196742
has comment: http://stackoverflow.com/comment/44770596
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44769525
has comment: http://stackoverflow.com/comment/44769377
has comment: http://stackoverflow.com/comment/44771238
has comment: http://stackoverflow.com/comment/44769975
has comment: http://stackoverflow.com/comment/44769484
has comment: http://stackoverflow.com/comment/44769556
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/44769714
has comment: http://stackoverflow.com/comment/44770511
accepted answer of: http://stackoverflow.com/q/28195474
has body: I see you generate a filename based on input values. That means that the ajax call will be made upon that filename, which is odd, becouse you have to create a file with that name. Anyway, i don't see nowhere in your code that by clicking table rows you make an ajax call, you only save the innerHTML text to a variable data = [] and then alert it. But the problem is not here (if you don't expect to make ajax call when clicking table-rows), but it is inside the ajax call you are making when clicking the button. first url:filename var filename= "Data_"+ID+"_"+Value+".txt"; I strongly suggest you don't do that. It will work if you make an ajax call to a php script which creates that txt file with filename name, and then make another ajax call to that file and fetch it. second data: { ID: $("input#id").val(), Value: $("input#value").val() } look here at data, the doc explains it. the code above means that to filename it will pass parameters (GET parameters, i.e. x?=...), but becouse your file is .txt, this doesn't make sense. third $("#tabs").load("demo_test.txt"); This will add the text inside demo_test.txt to $("#tabs") , like innerHTML does or .html() does. Do you have demo_test.txt on your host? i suppose this should work. just change you ajax call and load call with this. this should work : $("button").click(function() { $.ajax({ url : "demo_test.txt", dataType: "text", success : function (data) { $("#tabs").html(data); } }); }); For clicking the table-rows, just add an event listener to table-rows, and make an ajax call. read the link i send you, as they are important to understand better what is ajax. You can see no unnecessary data parameter is thrown to ajax call, and i put there an dataType, meaning that we expect text data to be recieved. If this doesn't work, you have to be sure that you are working on localhost server(for ajax to work...) and you have demo_test.txt , and the url is passed correctly example using input values to fetch from ajax: $("button").cl…
score: 4
answers question: http://stackoverflow.com/q/28195474

http://stackoverflow.com/comment/44790417
has text: Hello, I am using Java.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28213308
score: 0

http://stackoverflow.com/comment/44855673
has text: @brabertaser1992 I have updated my answer. The workflow is likely to be : choose local image/show it on view/crop the image/get the image binary data from base64/send the image binary to server.
type: AnswerComment
comment on: http://stackoverflow.com/a/28247431
score: 0
type: Comment

http://stackoverflow.com/q/28250957
accepted answer: http://stackoverflow.com/a/28251169
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28251169
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28251199
type: Question
answer count: 2
tagged with: javascript
has title: Interactive menu in Angular.js with Twitter Bootstrap
score: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28251199
has body: I just wonder if I can create the interactive menu in Angular.js with Twitter Bootstrap. I just want to express each component as an element of array in app's controller, but not working with repeating code. {{ menu }} Blog Info Contacts Check out JSFiddle.

http://stackoverflow.com/comment/44663259
comment on: http://stackoverflow.com/a/28145705
score: 0
type: AnswerComment
type: Comment
has text: That's great in that now the text is being transferred, but now the form won't submit lol.

http://stackoverflow.com/a/28268326
has comment: http://stackoverflow.com/comment/44893047
has body: var j = document.getElementById("Gridview1"); j.DataSource = obj; It seems that you are trying to use method and attribute that does not exist. There is bind() in javascript but written "bind" and it is used for functions. If it's not previously definded there is no DataSource. Btw why do you use two semicolons? Maybe for sake of debugging split your code into:
score: 0
answers question: http://stackoverflow.com/q/28268155
type: Answer

http://stackoverflow.com/q/28139290
has comment: http://stackoverflow.com/comment/44650286
type: Question
tagged with: javascript
tagged with: jquery
has body: i want create generate web to pdf. In My Website, this script is work, but not generate images in my website. you can download my script in this link > http://tinyurl.com/jspdftesting you can test in file "test.html" Before ask i already try search in google, but not found about this case. Please help me. This is my script Testing Feedback form with screenshot This script allows you to create feedback forms which include a screenshot, created on the clients browser, along with the form. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page. How does it work? The script is based on the html2canvas library, which renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements. This script adds the options for the user to draw elements on top of that image, such as mark points of interest on the image along with the feedback they send. It does not require any rendering from the server, as the whole image is created on the clients browser. No plugins, no flash, no interaction needed from the server, just pure JavaScript! Browser compatibility Firefox 3.5+ Newer versions of Google Chrome, Safari & Opera IE9 generate PDF HTML/WEBPAGE VIEW PDF VIEW
has answer: http://stackoverflow.com/a/44648370
score: 0
tagged with: jspdf
has comment: http://stackoverflow.com/comment/44650156
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: JSPDF Not Generate Image in webpage
type: UnansweredQuestion

http://stackoverflow.com/comment/44668713
score: 1
has text: You could probably use JavaScript's `.replace()` function: `yourText.replace('2003', '2003');`
type: AnswerComment
comment on: http://stackoverflow.com/a/28148475
type: Comment

http://stackoverflow.com/comment/44814772
type: Comment
has text: @T.J.Crowder Interesting that they would allow it as a HTML attribute to be invalid as a selector. Can you please link to relevant spec? I always like learning something new. :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28225700

http://stackoverflow.com/comment/44646868
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28137483
has text: Hi Tamil Selvan , thanks for your answer . I had tried setTimeout() but not work ,is my css to block the function ? here my site cloudsblack.com/modalwindow.html , can you help me to look over ? thanks
score: 0

http://stackoverflow.com/comment/44805961
comment on: http://stackoverflow.com/a/28221273
has text: @TravisJ sorry I don't understand your response.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/44759536
score: 0
type: Comment
has text: BTW there are lot's of different ways to use the value later ie `myResult.start`. I always use dot notation myself.
type: AnswerComment
comment on: http://stackoverflow.com/a/28195238

http://stackoverflow.com/a/28136164
has body: Final solve: &lt;script type="text/javascript"&gt; $(document).ready(function() { $( ".editField #add").click(function() { var clickedValue = $(this).parents('.editField'); clickedValue = $('td:first', clickedValue).text(); window.open('/somePage' + clickedValue, 'New window'); return false; }); }); &lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/28135498
score: 0

http://stackoverflow.com/q/28123968
tagged with: cross-browser
answer count: 0
type: UnansweredQuestion
has title: How to make an HEAD Http request in Crossrider extension?
tagged with: crossrider
has comment: http://stackoverflow.com/comment/44635902
type: Question
has comment: http://stackoverflow.com/comment/44638443
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44641842
has body: I would like to make a HEAD HTTP request to get filesize of the requested url, we can make HTTP GET requests using the below example code from Crossride Docs, my question is how to make a pure HEAD (with no data downloaded) request in croorider: appAPI.ready(function($) { appAPI.request.get({ url: 'http://example.com/api/get_something.json', onSuccess: function(response, additionalInfo) { // Display the response if (appAPI.utils.isObject(response)) { console.log('Response properties:'); for (p in response) { console.log(response[p] + ': ' + p); } } else console.log('Response: ' + response); // Stringify and display the response headers var headersAsString = ''; for (var x in additionalInfo.headers) { headersAsString += '\n' + x + ': ' + additionalInfo.headers[x]; } console.log('Response Headers:' + headersAsString); }, onFailure: function(httpCode) { console.log('Failed to retrieve content. (HTTP Code:' + httpCode + ')'); }, additionalRequestHeaders: { myHeader: 'value' }, responseDataType: 'application/json' }); });
tagged with: browser-extension

http://stackoverflow.com/a/28205683
has comment: http://stackoverflow.com/comment/44777073
upvote count: 1
has comment: http://stackoverflow.com/comment/44777130
type: Answer
has comment: http://stackoverflow.com/comment/44777515
downvote count: 0
has comment: http://stackoverflow.com/comment/44777042
has comment: http://stackoverflow.com/comment/44777086
has comment: http://stackoverflow.com/comment/44777150
has comment: http://stackoverflow.com/comment/44777573
score: 1
has comment: http://stackoverflow.com/comment/44777366
has comment: http://stackoverflow.com/comment/44778283
has body: Remove the trailing comma just before you start the where clause: deptid='".$_POST['deptid']."',where ^ right there Having used mysql_query($myquery) or die(mysql_error()); would have signaled the error. I would like to note that your present code is open to SQL injection. Use mysqli with prepared statements, or PDO with prepared statements, they're much safer. You can also use mysql_real_escape_string() till you do switch over. http://php.net/manual/en/function.mysql-real-escape-string.php Add error reporting to the top of your file(s) which will help find errors. &lt;?php error_reporting(E_ALL); ini_set('display_errors', 1); // rest of your code Sidenote: Error reporting should only be done in staging, and never production. Edit: (conversion from mysql_ to mysqli_, a basic method. Change your present DB connection to the following. This is an example taken from http://php.net/manual/en/function.mysqli-connect.php &lt;?php $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link)); // rest of your code Then change mysql_query($myquery); to mysqli_query($link, $myquery); $results=mysql_query($myquery); to $results=mysqli_query($link, $myquery); $rs=mysql_fetch_array($results); to $rs=mysqli_fetch_array($results); If you have any other functions that start with mysql_, they must be changed to mysqli_. All mysqli_ functions require DB connection be passed as the first parameter. This I did to help you out. If this still doesn't work, then I will simply delete this answer.
answers question: http://stackoverflow.com/q/28205573

http://stackoverflow.com/comment/44893786
has text: @Sumeet Still doesn't work, still the three dots
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28268803
score: 0

tcp
type: Tag
tag name: tcp
tags question: http://stackoverflow.com/q/28248650

http://stackoverflow.com/comment/44665778
score: 0
has text: added jquery twice by a mistake, sorry. Updated question now
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28147010

flickr
tags question: http://stackoverflow.com/q/28242100
tag name: flickr
tags question: http://stackoverflow.com/q/28221484
type: Tag

http://stackoverflow.com/comment/59465638
type: Comment
score: 1
has text: Why not go mad and use `const` everywhere? I've found that I very seldom actually need a `let` (mostly when I determine a value in an `if` or `switch` clause) . There is no downside to use `const` wherever it is possible and the upside of more information about the variable for the reader.
type: AnswerComment
comment on: http://stackoverflow.com/a/28392605

http://stackoverflow.com/a/28259777
answers question: http://stackoverflow.com/q/28247260
has comment: http://stackoverflow.com/comment/44898842
has body: As Sal Niro point out in another answer - one option to get around the constant calling of tilesloaded or idle is to define a variable and then mark it as true the first time the events functions run. It's a bit hackish and surprising that the API has no method to access the maps object after initial map load from within the controller ...but it works. However - adding this answer since it's not practical to put your entire controller within a function (or condition) - and there are some functions you may want to be called continuously. So simply define the 'run once' variable within your controller prior to your map being called. Solution: Define a variable (here arbitrarily called "initialMapLoad") set to false or 0 : var initialMapLoad = 0 Then, within your google maps events definition (such as tilesloaded, dragend or idle) you can put the functions you only want to run once, within a conditional : if(initialMapLoad === 0) { my_single_run_function(); var initialMapLoad = 1 } Don't forget to redefine the initialMapLoad variable to 1 or true once your function runs. Example: myApp.controller('MainCtrl', function($scope, uiGmapGoogleMapApi) { var initialMapLoad = 0; uiGmapGoogleMapApi .then(function(maps){ $scope.map = { center: { latitude: 37.7749295, longitude: -122.4194155 }, zoom: 13, events: { tilesloaded: function (maps, eventName, args) { // functions that run every time alert('I say this after every tile load'); if(initialMapLoad === 0){ // functions that run only once alert('I only say this once' + maps.getBounds()); initialMapLoad = 1; } }, } }; }) }); See a working example in this jsfiddle
has comment: http://stackoverflow.com/comment/44910558
downvote count: 0
has comment: http://stackoverflow.com/comment/44887285
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44721845
has text: [How do I display Day of Weed and vary responses by days?] Day of Weed?
score: 3
comment on: http://stackoverflow.com/q/28176313
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28166186
type: AcceptedAnswer
downvote count: 0
score: 1
has body: It requires that the match not be followed by a second :. Without it, the match could be followed by a second :. So with that negative lookahead, given the input foo::, only foo matches; without it there, given the input foo::, foo: (with the colon) matches. You can play with it over on regex101.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28166121
answers question: http://stackoverflow.com/q/28166121

http://stackoverflow.com/comment/44919021
has text: Files can be whatever you want it to be... Just change it as you require!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28259955

http://stackoverflow.com/a/28148145
has body: The order of execution is guaranteed because the HTML parser blocks whilst parsing and executing JavaScript. If a script has a src URL that hasn't already been downloaded (see below), that has to happen before the script can be parsed. That's bad news - it means that the HTML parser can't carry on reading the document because it is waiting for a potentially slow HTTP response. In your example the HTML parser has to wait until the first inline However, the browser is free to decide when and how to download assets. This can be independent of the order of script execution. It's common for modern browsers to pre-fetch assets to reduce the amount of time the HTML parser is blocked whilst scripts download. You're seeing 3.js downloaded first because the browser scanned the browser for assets and started downloading scripts immediately. It could only start downloading 1.js and 2.js once the HTML parser had parsed and executed their corresponding inline script tags. This means that the HTML parser was blocked whilst downloading 1.js and 2.js. If all of your scripts were included directly like 3.js it is likely that the browser would pre-fetch the three scripts in parallel, making the page load slightly more efficient. Pre-fetch implementations are browser-specific, so you may see different results in other browsers.
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28147702
downvote count: 0

http://stackoverflow.com/q/28206376
downvote count: 0
answer count: 1
has title: Customize chart tooltip as label with line pointing to pie segment
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/31481540
tagged with: angularjs
tagged with: google-pie-chart
upvote count: 1
accepted answer: http://stackoverflow.com/a/31481540
tagged with: charts
type: AnsweredQuestion
score: 1
has body: I am trying to get a chart that looks like this, but with value instead of percentage: Google Pie Chart Google Charts would work well, but as far as I can tell the closest you can get is the above with: legend.position = "labeled" But you cannot change percent to value. A straight line would be better also, but not essential. I am currently using charts.js and have tried Google charts. There is tooltip customization for charts.js, but I am not even sure how to do something quite like my example. Does anyone have any information on how I could customize such a tooltip with charts.js or know of a good JS chart library that's easy to use and has an Angular wrapper? Both Google Charts and Charts.js are compatible with Angular, which is my preference -- though it's not 100% necessary.
type: Question

http://stackoverflow.com/a/28161827
has body: This simplifies things. Since this is the select no need to traverse up 2 levels and back down to get back to where you started again $('.selectDropdown').on('change', function(e) { $(this).children(':not(:selected)').prop('disabled', true); }); if remove is preferred swap out prop() for remove() $('.selectDropdown').on('change', function(e) { $(this).children(':not(:selected)').prop('disabled', true); }); 1 2 3 4
upvote count: 1
answers question: http://stackoverflow.com/q/28161765
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/44788560
has text: They both allow you to persist data on the client (browser) and retrieve it at a later point (even after browser has been closed). What you do with the data, like put it inside some html or use it for calculation in the background or even send it to a remote server via sockets, is up to you. You should be able to find endless information and code samples on this subject
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28211974
score: 0

http://stackoverflow.com/q/28239416
has comment: http://stackoverflow.com/comment/44840511
score: 0
answer count: 1
favorite count: 0
has title: How to disable triangle on Google map?
has body: After request of types from google server appear on map some white triangle. How to remove this triangle? Here is my code: function organizeRequest(category, radius) { var request = { location: LatLng, radius: radius, types: [category] }; service = new google.maps.places.PlacesService(map); service.nearbySearch(request, callback); } function callback(results, status) { debugger; clearMarkers(); if (status == google.maps.places.PlacesServiceStatus.OK) { for (var i = 0; i &lt; results.length; i++) { createMarker(results[i]); } } else if (status == google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT) { setTimeout(function () { callback(results, status); },200); } } function createMarker(place) { debugger; var icon = { url: place.icon, //url scaledSize: new google.maps.Size(30, 30), //scaled size origin: new google.maps.Point(0, 0), //origin anchor: new google.maps.Point(0, 0) //anchor } searchMarker = new google.maps.Marker({ map: map, position: place.geometry.location, animation: google.maps.Animation.DROP, icon: icon }); locationMarkers.push(searchMarker); searchMarker.placeResult = place; locationInfoWindow = new google.maps.InfoWindow({ map: map, }); google.maps.event.addListener(searchMarker, 'click', showLocationInfoWindow); }
type: UnansweredQuestion
tagged with: model-view-controller
has answer: http://stackoverflow.com/a/28244752
upvote count: 1
downvote count: 1
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28286226
score: 0
has comment: http://stackoverflow.com/comment/44935542
answers question: http://stackoverflow.com/q/28245079
has body: Not an exact answer, but check ticket 11437 targeted into upcoming 4.5 release. In short, d&amp;d is a complex topic and we're working on it right now.
type: Answer

http://stackoverflow.com/comment/44727339
comment on: http://stackoverflow.com/q/28123163
type: Comment
type: QuestionComment
has text: The fiddle you've provided looks like an entire app, not an [mcve](http://stackoverflow.com/help/mcve) that will help us to isolate and understand the problem. Also, this code is running before the DOM is fully loaded and ready, which could cause innumerably problems. There are too many moving parts here for us to be of help.
score: 0

ember.js
tags question: http://stackoverflow.com/q/28201238
tags question: http://stackoverflow.com/q/28191776
tags question: http://stackoverflow.com/q/28151121
tags question: http://stackoverflow.com/q/28261785
tags question: http://stackoverflow.com/q/28147145
tags question: http://stackoverflow.com/q/28160801
tags question: http://stackoverflow.com/q/28236366
tags question: http://stackoverflow.com/q/28179679
tags question: http://stackoverflow.com/q/28181957
tags question: http://stackoverflow.com/q/28153216
type: Tag
tags question: http://stackoverflow.com/q/28179545
tags question: http://stackoverflow.com/q/28242894
tag name: ember.js
tags question: http://stackoverflow.com/q/28211814
tags question: http://stackoverflow.com/q/28152811
tags question: http://stackoverflow.com/q/28160805
tags question: http://stackoverflow.com/q/28270937
tags question: http://stackoverflow.com/q/28161746
tags question: http://stackoverflow.com/q/28219688
tags question: http://stackoverflow.com/q/28151333
tags question: http://stackoverflow.com/q/28251331
tags question: http://stackoverflow.com/q/28230046
tags question: http://stackoverflow.com/q/28201036
tags question: http://stackoverflow.com/q/28152967
tags question: http://stackoverflow.com/q/28233462
tags question: http://stackoverflow.com/q/28154299
tags question: http://stackoverflow.com/q/28147641
tags question: http://stackoverflow.com/q/28200110
tags question: http://stackoverflow.com/q/28274005
tags question: http://stackoverflow.com/q/28206977
tags question: http://stackoverflow.com/q/28180255
tags question: http://stackoverflow.com/q/28260642

http://stackoverflow.com/comment/44770958
comment on: http://stackoverflow.com/a/28202146
score: 0
type: AnswerComment
type: Comment
has text: ok so use window.onload to put these values into that area of the form and submit because that happens after link is rendered right?

http://stackoverflow.com/q/28160302
has comment: http://stackoverflow.com/comment/44691967
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/44692351
has comment: http://stackoverflow.com/comment/44692190
tagged with: javascript
linked to: http://stackoverflow.com/q/29547918
has comment: http://stackoverflow.com/comment/44691985
score: 0
has title: How do I reference a different this in a javascript object literal?
has comment: http://stackoverflow.com/comment/44692472
has comment: http://stackoverflow.com/comment/44691990
has comment: http://stackoverflow.com/comment/44692513
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/75055597
has body: How do I reference a different this in a javascript object literal ? For example: var Dispatcher = require('../dispatchers/dispatcher.js'); var App = React.createClass({ handleEvent : function(item){ //... }, events : { dispatcherIndex: Dispatcher.register(function(payload) { //register a callback and set the result this.handleEvent(payload); //this 'this' is the wrong one since this is being called as a callback //how do i reference the right one (the one that has the handleEvent function)? }) } }); As you can see, we register a callback. Therefore, the 'this' reference in that callback isnt going to reference the object we want. How do we do this when we cant create a closure for 'this'?

http://stackoverflow.com/q/28231957
tagged with: javascript
has body: I have a sql statement var sql = "SELECT lastName FROM Class"; How can I store the results in array in Microsoft Azure scripts?
has answer: http://stackoverflow.com/a/28242918
type: UnansweredQuestion
tagged with: azure-mobile-services
has title: Store returned objects into array javascript Microsoft Azure
type: Question
score: 0
answer count: 1

http://stackoverflow.com/a/28186614
has body: Use this: return text.replace("y", "")
answers question: http://stackoverflow.com/q/28186557
score: 0
type: Answer

http://stackoverflow.com/q/28182367
type: UnansweredQuestion
has body: I have an array like this: var records = [{ "field1": "dogs", "field2": "poodle" }, { "field1": "dogs", "field2": "alsatian" }, { "field1": "dogs", "field2": "chowchow" }, { "field1": "dogs", "field2": "schnauzer" }, { "field1": "cats", "field2": "siamese" }, { "field1": "cats", "field2": "persian" }, { "field1": "fish", "field2": "guppy" }, { "field1": "fish", "field2": "tiger barb" }] I want to iterate over the array and create a new array Pets, so that I can access it like var Pets = [{ "type": "dogs", "breeds": ["poodle", "alsatian", "chowchow", "schnauzer"] }, { "type": "cats", "breeds": ["siamese", "persian"] }, { "type": "fish", "breeds": ["guppy", "tiger barb"] }] I tried to do a for loop but it doesn't work as I use i+1 in an array like so var thispet = {}; var Pets = []; thispet.type = records[0].field1; Pets.push(thispet); for (i = 1; i &lt; records.length; i++) { if (Pets[i - 1].type != records[i].field1) { thispet.type = records[i] field1; Pets.push(thispet); } } But somehow the Pets[i-1].type is not recognised as object. I wanted to first create 3 objects in array Pets based on the 3 types of pets in the records, then sort out the second order of breeds(should be easier with push into array. I have a large record, so a loop will help greatly.
tagged with: dictionary
score: 1
upvote count: 1
has title: Remap array to object
type: Question
tagged with: object
tagged with: arrays
has answer: http://stackoverflow.com/a/28182578
tagged with: javascript
answer count: 2
linked to: http://stackoverflow.com/q/135448
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28182476

http://stackoverflow.com/comment/44650423
type: QuestionComment
has text: I have significantly re-worded this question so it should be answerable now.
comment on: http://stackoverflow.com/q/28138950
score: 0
type: Comment

http://stackoverflow.com/a/28255203
score: 0
has body: Thanks guys, I was able to do grab some ideas from all your posts and came up with this code which seems to working fine in my case if((typeof inStr == 'undefined') || (inStr == null) || (inStr.length &lt;= 0)) { return ''; } var year = inStr.substring(0, 4); var month = inStr.substring(5, 7); var day = inStr.substring(8, 10); return month + '/' + day + '/' + year;
type: Answer
answers question: http://stackoverflow.com/q/28246788

http://stackoverflow.com/q/28204583
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44783016
has comment: http://stackoverflow.com/comment/44775560
has comment: http://stackoverflow.com/comment/44775279
has comment: http://stackoverflow.com/comment/44775318
has title: Uncaught TypeError: undefined is not a function - Javascript issue
type: Question
has comment: http://stackoverflow.com/comment/44775109
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44775093
score: 0
has body: Why is this code giving me an Uncaught TypeError: undefined is not a function error? It happens on line 4. $featuredslider = $(".featured-slider") if ($featuredslider.length &gt; 0) { $featuredslider.royalSlider({ ********* error occurs here ******** // options go here // as an example, enable keyboard arrows nav keyboardNavEnabled: true, tabs: { // thumbnails options go gere spacing: 0, arrowsAutoHide: true, fitInViewport: false, orientation: "vertical" } }); slider = $featuredslider.data('royalSlider'); slider.ev.on('rsAfterSlideChange', function(event) { if( $(window).width() &lt; 481 ){ //console.log($(slider.currSlide.content).data("slide")) $('.slide-overlay').removeClass("active"); $('.slide-overlay[data-slide="'+ $(this).data("slide") +'"]').addClass("active") } }); }
has comment: http://stackoverflow.com/comment/44775060
has comment: http://stackoverflow.com/comment/44775012
has comment: http://stackoverflow.com/comment/44775251
has comment: http://stackoverflow.com/comment/44775269

http://stackoverflow.com/a/28156887
score: 2
has body: angular.module('applicationName', ['controller1', 'controller2', 'controller3']) .constant('APPLICATION_ID', '12345abcde'); And then in your controller application.controller('myController', ['$scope','APPLICATION_ID',function($scope,applicationId) { console.log("app id="+applicationId); }]);
accepted answer of: http://stackoverflow.com/q/28156718
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28156718
type: Answer
has comment: http://stackoverflow.com/comment/44685549
upvote count: 2
has comment: http://stackoverflow.com/comment/44685251

http://stackoverflow.com/comment/44669195
type: AnswerComment
has text: How careless! If I had met you earlier, hours of debugging would have been saved. :P
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28148868

http://stackoverflow.com/comment/44897591
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28270797
has text: here is js fiddle link that shows that ur ng-click is working. http://jsfiddle.net/s1covosh/
score: 0

http://stackoverflow.com/a/28226688
downvote count: 0
has body: You need to be using ng-model, also you cant bind to primitives like that. controller: this.HelperObj = {"ArrofHelperObjs":[/*YOUR OBJECTS HERE*/]}; this.ToggleHelpButton = function(obj){ var package = this.HelperObj.ArrofHelperObjs.length; var handl = this.HelperObj.ArrofHelperObjs; if(package == 0){ handl.push(obj); return 200; } for(var x=0;x&lt;package;x++){ if(handl[x] == obj){ handl.splice(x, 1); return 200; } if(x == package-1){ handl.push(obj); return 200; } } console.log("Error: handl= "+handl); console.log("Error: obj= "+obj); return "Error: Conditions were supposed to have been met"; }; then html &lt;div ng-repeat="x in myctrl.HelperObj.ArrofHelperObjs" &gt; &lt;button ng-model="x.selected" ng-click="myctrl.ToggleHelpButton(x.html); x.selected = !x.selected" ng-show="x.selected"&gt; {{x.html}} &lt;/label&gt; &lt;/div&gt; Two thing to point out. ng-model is how you bind to your data. When using ng-model, DONT BIND TO PRIMITIVES. It took me a while to get that in my head. In the example shared, my objects have the properties selected and html. ie. this. package = {"selected":"false","html":"tagone"}; This would work in some cases, but most of the time you are going to have more than one object. Looks like this. this. package = {"ArrayofObjects":[]}; inside those brackets[] goes all your objects. Like this this. package = {"ArrayofObjects":[{"selected":"false","html":"tagone"},{"selected":"false","html":"tagtwo"}, {"selected":"false","html":"thirdtag"} ]}; Once you are set up like this, make a function that alters any of those values. That is what my ToggleHelpButton method is doing. I am changing the value of the selected property, of that element. Then in your html, use &lt;toggledelement ng-model="ctrl.package.ArrayofObjects[x].someproperty"&gt; x is the index of the array of objects. someproperty is literal selected. you now have an element that is bound to a truthy or falsy value. Have Fun!
type: Answer
answers question: http://stackoverflow.com/q/28226180
upvote count: 1
score: 1

http://stackoverflow.com/a/28248427
type: Answer
answers question: http://stackoverflow.com/q/28248263
upvote count: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28248263
has body: yes. as javascript is open on the website, everyone can hack it. you will need to write some code on you backend to validade it. always think that you user/costumer will try to hack you sytem. so take precautions like, check if user is the user of the session, if he is logged, if he can do what he is trying to do. check if the record that he is trying get exists. if u are using a stand alone site, that u made the entire code from the ashes, you will need to implement this things by yourself. like using the standard php session, making the data validation etc. or you can find some classes that other people have made, you can find a lot o this on google. as it is a common problem of web programing. if u are using a backed framework that isnt from another world, probably already has one. sp, go check its documentation.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/44915303
comment on: http://stackoverflow.com/a/28279922
has text: "EDIT: There is no css change event so you'll have to approach the problem in 1 of 2 ways." "trigger an event when the css of the dom element is changed by user interaction/your code." doesn't make sense. You contradict yourself within those 2 sentences.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28202756
answers question: http://stackoverflow.com/q/28202480
has comment: http://stackoverflow.com/comment/44778924
type: AcceptedAnswer
downvote count: 0
has body: You need to change up the structure a bit. First, /5 signifies an ID of 5, which doesn't make sense with the compound object your method is expecting. Second, you don't need to manually specify any URL parameterization with "=". Both jQuery and WebAPI will handle those pieces for you if you structure your object correctly. WebAPI 2 is significantly more powerful when it comes to deserializing complex objects than it's predecessor. Simply post the object. $.post("http://localhost:2239/api/UrlVisits", {id:1, name:"test name"}); Finally, you can use the [FromBody] attribute to specify that your object will be posted on the form body. [ResponseType(typeof(MyObject))] public async Task&lt;IHttpActionResult&gt; PostMyObject([FromBody]MyObject myObject)
type: Answer
has comment: http://stackoverflow.com/comment/44775488
accepted answer of: http://stackoverflow.com/q/28202480
score: 2
upvote count: 2

http://stackoverflow.com/comment/44910100
comment on: http://stackoverflow.com/a/28276757
score: 0
type: AnswerComment
has text: Code can be php? and this goes in ? :)
type: Comment

http://stackoverflow.com/comment/44618437
score: 0
comment on: http://stackoverflow.com/q/28122068
has text: I don't have a shadow enabled for it. I'm trying to make the sticky header appear as soon as I start scrolling down, instead of after 300px or so.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44673065
comment on: http://stackoverflow.com/a/28150482
type: AnswerComment
has text: Ok, I've never used ajax so if you have some example it will be perfect :)
score: 0
type: Comment

http://stackoverflow.com/q/28268123
has body: i'm developing an Application which offers some features around real time statistics from Google Analytics. Therefore, the user has to choose, from which Website (ID) he wants to get these stats. What i get back if i log in is: { "kind": "analytics#accounts", "username": "************@gmail.com", "totalResults": 2, "startIndex": 1, "itemsPerPage": 1000, "items": [{ "id": "504*******", "kind": "analytics#account", "selfLink": "https://www.googleapis.com/analytics/v3/management/accounts/504********", "name": "He*****************", "permissions": { "effective": ["COLLABORATE", "EDIT", "MANAGE_USERS", "READ_AND_ANALYZE"] }, "created": "2014-04-29T11:02:30.458Z", "updated": "2014-10-09T17:51:00.985Z", "childLink": { "type": "analytics#webproperties", "href": "https://www.googleapis.com/analytics/v3/management/accounts/50********/webproperties" } }, { "id": "556******", "kind": "analytics#account", "selfLink": "https://www.googleapis.com/analytics/v3/management/accounts/556*******", "name": "Cor**********", "permissions": { "effective": ["COLLABORATE", "EDIT", "MANAGE_USERS", "READ_AND_ANALYZE"] }, "created": "2014-10-13T13:22:02.787Z", "updated": "2014-10-13T13:22:02.787Z", "childLink": { "type": "analytics#webproperties", "href": "https://www.googleapis.com/analytics/v3/management/accounts/556******/webproperties" } } ] } So now i want to create a console.log with just the names from the found IDs. Therefore i tried it with javascript: for (var i = 0; i &lt; data.items[0].name.length; i++) { ; console.log(data.items[0].name.length); But every time i call my function i get back: 18 So i just have 2 propertys in my google analytics account - why do i get back 18 and how can i only get back the names from the 2 propertys? Thanks in Advance!
tagged with: google-api
type: Question
tagged with: google-analytics
type: AnsweredQuestion
has title: Google Api - Seperate Object - JavaScript
tagged with: api
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28269710
accepted answer: http://stackoverflow.com/a/28269710
tagged with: cordova

http://stackoverflow.com/comment/44773602
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28201857
type: Comment
has text: I just tried it with 19 countries and it appears to work.

http://stackoverflow.com/q/28155346
tagged with: http://stackoverflow.com/tag/html
has title: Get window top from tag
answer count: 0
has comment: http://stackoverflow.com/comment/44685574
type: UnansweredQuestion
has body: Is it possible to fetch the window data of the "parent" window, from within a page loaded in a tag ? I'm embedding a remote html file from https://test-static-app.herokuapp.com/ which simply outputs window.top and window.parent.top in the console. Test The result is for both values: {} Is it possible to get this data? How ?
has comment: http://stackoverflow.com/comment/44683975
type: Question
tagged with: browser
tagged with: window
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44683092

http://stackoverflow.com/comment/44808759
type: Comment
has text: @Evan Yes, yes it will.
comment on: http://stackoverflow.com/a/28222858
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44833364
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28235957
score: 0
has text: Tried it, "Error: error:unpr Unknown Provider" Like the last time i tried. Unknown provider: idProvider <- id

http://stackoverflow.com/q/28123431
has comment: http://stackoverflow.com/comment/44659846
has title: Check objects inside an array to see if any contain a substring? - JavaScript
tagged with: javascript
score: 0
has body: I'm using the Express framework in Node.js. The user fills out a form and submits it where the form data is stored as an object with a property for each field into an array. The user can then go to a query page that has a single text field to search all form entries by entering a substring and all form entries that contain that substring in any of their fields will be listed. Here is a snippet from my index.js: router.post('/doquery', function(req, res) { var inp = { input: req.body.input }; var tempState = []; for (var obj in state) { for (var prop in obj) { for (var input in inp) { if (prop.indexOf(input) !== -1) { tempState.push(obj); } } } } res.render('list', { title: 'People Listing', items: tempState}); }); inp is the object holding the substring. What I want to do is search through the array of form entry objects and if an object contains the "inp" substring in any of it's properties then add it to tempState and display all objects in tempState on the list page. state is a global array which its elements are objects holding each separate form entry.
has comment: http://stackoverflow.com/comment/44660110
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44660100

http://stackoverflow.com/comment/44870450
has text: I tested it using very smooth data points, and the graph looks just fine. My data points are just really different between time periods - ranging from as high as 1000 to as low as 0. I just want a way for it to transition smoothly, instead of looking so "spikey".
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28256004

http://stackoverflow.com/comment/44632964
comment on: http://stackoverflow.com/q/28130058
score: 1
type: Comment
type: QuestionComment
has text: It is a scope issue.

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/28204727

http://stackoverflow.com/a/28153438
score: 2
answers question: http://stackoverflow.com/q/28153266
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28153266
has comment: http://stackoverflow.com/comment/44682001
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: It's because you've used a category axis on x which lays each point out at regular intervals. Your chart would be better suited to a time axis: var svg = dimple.newSvg("#chartContainer", 600, 400), data = [ { "year": "1998", "val": 123456789 }, { "year": "1999", "val": 234567890 }, { "year": "2000", "val": 234567890 }, { "year": "2001", "val": 123456789 }, { "year": "2002", "val": 134567890 }, { "year": "2003", "val": 123456789 }, { "year": "2004", "val": 234567890 } ], c = new dimple.chart(svg, data), x = c.addTimeAxis("x", "year", "%Y", "%Y"), y = c.addMeasureAxis("y", "val"), s = c.addSeries(null, dimple.plot.area); c.draw();

http://stackoverflow.com/comment/44914279
type: Comment
comment on: http://stackoverflow.com/a/28248903
score: 0
type: AnswerComment
has text: Well for instance in your jsfiddle if you give the first button an id of button1 and then in your on() you replace document.body by dom.byId('button1'), it won't click even though the div doesn't have the .disabled class.

http://stackoverflow.com/q/28244734
has comment: http://stackoverflow.com/comment/44850264
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28245094
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44850462
has comment: http://stackoverflow.com/comment/44850136
has comment: http://stackoverflow.com/comment/44850377
has title: Passing variable to child function javascript
has comment: http://stackoverflow.com/comment/44850495
type: AnsweredQuestion
has body: I've looked at multiple questions in search for an answer however to no avail, I'm trying to obtain the variable from a parent function and passing it like "a(b)" doesn't seem to work I cannot for the life of me obtain 'item_classes', is there another way in which I can write my code in order for it to be operable $(document).ready(function () { $('.nm-more').hover(function () { var item_num = $(this).data('stg-id'); var item_names = $(this).data('stg-items'); var item_classes = $(this).data('stg-class'); item_names.forEach(function (entry) { var item_index = item_classes[entry]; alert(entry + ' ' + item_index); });}); }); }); Here is a jsfiddle http://jsfiddle.net/bgzkge65/25/
has answer: http://stackoverflow.com/a/28245094

http://stackoverflow.com/q/28187483
has comment: http://stackoverflow.com/comment/44745101
type: Question
has comment: http://stackoverflow.com/comment/44745199
has comment: http://stackoverflow.com/comment/44746058
has answer: http://stackoverflow.com/a/28187620
has comment: http://stackoverflow.com/comment/44745912
has answer: http://stackoverflow.com/a/28187877
has comment: http://stackoverflow.com/comment/44744816
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44744915
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/5182016
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have a website with a background and a main container. I wanted to hide the container until the whole page has been loaded. so i added #cover{opacity:0} at the start of the page and $(window).load(function() { $('#cover').css('opacity','1'); }); at the end, just before &lt;/body&gt; tag. It works perfectly when page is loaded for the first time. PROBLEM : If I load the same page once more, it shows all the images and text scattered throughout the page. It works fine once completely loaded. certainly this type of behavior is caused by cached images. but all the images are inside the main container which has opacity:0, This has completely confused me. UPDATE 1: I am using turn.js to convert the whole container into a book, i want the book become visible when the book is ready i.e. both loading of images and javascript initialization has completed. UPDATE 2: This is how i am checking for "images loaded" and "javascript initialized". it worked as i wanted it to. is this a good way to handle the situation? $(window).load(function(){ $(window).ready(function() { $('#cover').css('opacity','1'); }); }); $(window).ready(function(){ $(window).load(function() { $('#cover').css('opacity','1'); }); });
has title: hiding container until fully loaded not working with cached images
tagged with: css
has comment: http://stackoverflow.com/comment/44744991

http://stackoverflow.com/a/31730467
has body: What I do is create a test/test_helper.js file, which exports all the helpers I create: // test/test_helper.js module.exports = { MyHelper: require('./helpers/MyHelper') } Then I require the helper on any test I need to use it: // test/spec/MySpec.js var helper = require('../test_helper'); // Or if you need just "MyHelper" var myHelper = require('../test_helper').MyHelper; describe('MySpec', function () { // Tests here... }); I prefer the above approach because its easy to understand and flexible. You can see it in action here in my demo: https://github.com/paulredmond/karma-browserify-demo/tree/master/test
type: Answer
downvote count: 2
upvote count: 21
score: 19
answers question: http://stackoverflow.com/q/28191243

http://stackoverflow.com/a/28268523
has comment: http://stackoverflow.com/comment/44893951
has comment: http://stackoverflow.com/comment/44893953
answers question: http://stackoverflow.com/q/28267376
has comment: http://stackoverflow.com/comment/44893932
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44894633
has body: Like the comment said, this is similar to: Promise.resolve().then(undefined); // undefined is ignored here It is specified in the Promises/A+ spec and it works this way in every promise implementation. The rationale was that Promises/A+ don't have to support a .catch method and you could do: Promise.reject().then(null, function(err){ /* handle */ }); As well as interoperability with existing libraries.
has comment: http://stackoverflow.com/comment/44895728
type: Answer
has comment: http://stackoverflow.com/comment/44894313
accepted answer of: http://stackoverflow.com/q/28267376
has comment: http://stackoverflow.com/comment/44894502

http://stackoverflow.com/comment/44678445
type: AnswerComment
comment on: http://stackoverflow.com/a/28127457
score: 0
has text: For fixing the render step issue just replace `prerender` with `postrender`
type: Comment

math
tags question: http://stackoverflow.com/q/28123124
tags question: http://stackoverflow.com/q/28126661
type: Tag
tags question: http://stackoverflow.com/q/28270564
tags question: http://stackoverflow.com/q/28248683
tags question: http://stackoverflow.com/q/28167925
tags question: http://stackoverflow.com/q/28218188
tags question: http://stackoverflow.com/q/28261210
tags question: http://stackoverflow.com/q/28147378
tags question: http://stackoverflow.com/q/28260548
tags question: http://stackoverflow.com/q/28270661
tags question: http://stackoverflow.com/q/28131992
tags question: http://stackoverflow.com/q/28136677
tag name: math
tags question: http://stackoverflow.com/q/28131557

http://stackoverflow.com/q/28275841
tagged with: webgl
type: Question
has answer: http://stackoverflow.com/a/76020177
answer count: 2
tagged with: javascript
score: 0
has body: I am currently working for this startup. They are using Webgl for 3D graphics in their product. When I run it in Chrome, it rarely gives the 3D effects. I have enabled webgl in Chrome (Version 40.0.2214.91 (64-bit) ) but still there is no luck. However when I run it in Mozilla Firefox,the 3D graphics runs perfectly. Here is the website - http://pro.4d-life.com/ . Username - example@4d-life.net Password - 12345678 What I need to know is why is this happening and/or how to fix this? Any help will be highly appreciated!
tagged with: http://stackoverflow.com/tag/html
has title: Why is Webgl 3D not working in chrome?
tagged with: css
favorite count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 2
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28276273

http://stackoverflow.com/comment/44907996
type: AnswerComment
has text: i have `if($this.is(':checked')){ oVars[this.id] = true }` It sets the properties of the obj. how would I change it to false when the box is unchecked and true when it is checked again.... oh wait I think this works `if(!$this.is(':checked')){ oVars[this.id] = false; }` cool.
type: Comment
comment on: http://stackoverflow.com/a/28276500
score: 1

http://stackoverflow.com/q/28244883
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44850465
score: 0
tagged with: lodash
has answer: http://stackoverflow.com/a/28246139
has answer: http://stackoverflow.com/a/28245009
type: UnansweredQuestion
has body: I have 2 arrays like below: a = [ {id:item, m:1, n:11, o:111}, {id:item, m:2, n:21, o:211}, {id:item, m:3, n:31, o:311}, {id:'group', items:[ {id:item, m:4, n:41, o:411}, {id:item, m:5, n:51, o:511}] } ]; b = [ {id:item, m:1, n:11, o:111, p:101}, {id:item, m:2, n:21, o:211, p:121}, {id:item, m:3, n:31, o:311, p:131}, {id:'group', items:[ {id:item, m:4, n:41, o:411, p:141}, {id:item, m:5, n:51, o:511, p:151}] } ]; I need to compare these arrays for equality with only m,n,o columns. How to do this in optimal way? The output expected here is true, because those fields have the same values. var a = [ {id:'item', m:1, n:11, o:111}, {id:'item', m:2, n:21, o:211}, {id:'item', m:3, n:31, o:311}, {id:'group', items:[{id:'item', m:4, n:41, o:411}, {id:'item', m:5, n:51, o:511}, ]} ]; var b = [ {id:'item', m:1, n:11, o:111, p:101}, {id:'item', m:2, n:21, o:211, p:121}, {id:'item', m:3, n:31, o:311, p:131}, {id:'group', items:[{id:'item', m:4, n:41, o:411, p:141}, {id:'item', m:5, n:51, o:511, p:151}, ]} ]; var output = _.isEqual(a,b); $('.res').text(output); Arrays Equal? Any help is greatly appreciated.
has title: How to compare objects in JavaScript only for certain properties
type: Question

htmlpurifier
tag name: htmlpurifier
tags question: http://stackoverflow.com/q/28262337
type: Tag

http://stackoverflow.com/comment/44651145
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28139388
has text: Phonegap version 3.1.0
type: Comment

http://stackoverflow.com/a/28187448
has body: Through the var declaration, the variable is "hoisted". Meaning, it exists in the scope as a name, even before anything has been assigned to it. Hence it can be "closed over". At the time the interval is executing, the value of someFunc is a function, hence it can be called. In the second case someFunc still contains the value undefined at the time you're passing it into setInterval. Since undefined is not a function, it cannot be used as a callback at the time you want to set the interval. "Hoisting" explained in a nutshell: var foo = 'bar'; function () { console.log(foo); // undefined var foo = 'baz'; } The inner var foo is shadowing the outer var foo, even before anything has been assigned to it. It already exists in the scope, to the extent that it shadows other variables of the same name.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44747476
has comment: http://stackoverflow.com/comment/44747161
upvote count: 1
has comment: http://stackoverflow.com/comment/44747279
has comment: http://stackoverflow.com/comment/44743357
has comment: http://stackoverflow.com/comment/44743397
type: Answer
has comment: http://stackoverflow.com/comment/44747206
answers question: http://stackoverflow.com/q/28187393

http://stackoverflow.com/comment/44689597
has text: Thanks for the explanation, there is other form to send an invisible variable? Thanks
comment on: http://stackoverflow.com/a/28140237
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28255078
score: 0
answers question: http://stackoverflow.com/q/28255017
type: Answer
has body: in your data array when specifying each pie, use the color parameter: { name: 'Green', y: 12.8, sliced: true, selected: true, color: '#00ff00' }

http://stackoverflow.com/comment/44678150
has text: Try to explain better
score: 0
comment on: http://stackoverflow.com/q/28153400
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44654831
score: 0
type: Comment
type: QuestionComment
has text: @rjdown The content never reaches the .txt for some reason.
comment on: http://stackoverflow.com/q/28141311

http://stackoverflow.com/q/28136748
score: 6
type: AnsweredQuestion
has title: Strange javascript code
has body: I have found this code snippet: ; 100% function($) { // WTF? var _true_ = true; // WTF? var _false_ = false; // WTF? var go = function(location, date) { location || (location = {}); var result = _false_; if (date &amp;&amp; date.day) { result = geoService.go(location, date); } return !!result; } var process = function(func) { var args = [].prototype.slice.call(arguments, 1); return function() { return func.apply(this, args); } } // ... }(jQuery, undefined); In here: http://www.dofactory.com/products/javascript-jquery-design-pattern-framework (sorry, no id-s have been found on the page) I don't understand what these parts are doing: the "100%" in the second line the var _true_ = true; and var _false_ = false; assignments in the 3-4 lines I'm curious, what is the purpose of these.
accepted answer: http://stackoverflow.com/a/28136793
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: idioms
upvote count: 6
possible better answer: http://stackoverflow.com/a/28137012
has answer: http://stackoverflow.com/a/28136793
has answer: http://stackoverflow.com/a/28137012

http://stackoverflow.com/comment/44846274
has text: Thanks!.. short and sweet. :)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28242556

http://stackoverflow.com/comment/44722773
score: 0
type: Comment
has text: But the image not get into the effect and just move the photo position and remove it from page. Here's a link to the website.[Site][1] [1]: http://sistemas.vilavelha.com.br/newsletter/ricardo/festa_ano_novo_2014/index.asp
type: AnswerComment
comment on: http://stackoverflow.com/a/28176432

http://stackoverflow.com/comment/44951123
comment on: http://stackoverflow.com/a/28266110
score: 0
type: AnswerComment
type: Comment
has text: if the user needs to send a JWT to the server (to login) and the info is send to the server by $.AJAX (from JavaScript section in HTML page) than I need to create the JWT in javascript. please let me know if I am missing something .. thanks

http://stackoverflow.com/a/28138226
has comment: http://stackoverflow.com/comment/44648221
has comment: http://stackoverflow.com/comment/44648337
has comment: http://stackoverflow.com/comment/44651577
type: Answer
has comment: http://stackoverflow.com/comment/44651892
answers question: http://stackoverflow.com/q/28137714
score: 0
has body: I would suggest using navigator.geolocation.watchPosition rather than navigator.geolocation.getCurrentPosition, that way the position will update itself and will be potentially more accurate. As for the rest of the question, what does your interface look like? Why and when are you submitting a form? Perhaps you could use AJAX to fetch the data?

spring
tags question: http://stackoverflow.com/q/28223699
tags question: http://stackoverflow.com/q/28205925
type: Tag
tags question: http://stackoverflow.com/q/28185781
tags question: http://stackoverflow.com/q/28246172
tag name: spring
tags question: http://stackoverflow.com/q/28199272

http://stackoverflow.com/a/28155411
accepted answer of: http://stackoverflow.com/q/28155388
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28155388
has body: Because you're passing B as true. The following should work fine: if(A &amp;&amp; (B === false &amp;&amp; C === false)){ console.log('success'); } However, you can use shorthand like this: if(A &amp;&amp; !B &amp;&amp; !C){ console.log('success'); }
has comment: http://stackoverflow.com/comment/44684215

http://stackoverflow.com/comment/44815336
comment on: http://stackoverflow.com/q/28225900
score: 0
type: Comment
type: QuestionComment
has text: Add an "onclick=myFunction(event)" to the table an then in the function "myFunction(event)" the "event.target" you should have the needed information of the clicked row, the ID in your case.

http://stackoverflow.com/q/28184789
score: -2
has body: Hi i am doing some animation effect using css3.It works fine in the browser.when i click button it runs only once in the webpage and i click again that button it remains same.if i want to play again,i need to refresh the page.i got some codes in the but its working.i dont know where i did mistake. this is my code kindly give some suggestions. play
tagged with: javascript
tagged with: jquery
has title: how to play animation again and again without refreshing the page using css3
answer count: 2
has answer: http://stackoverflow.com/a/28185304
accepted answer: http://stackoverflow.com/a/28185076
upvote count: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/28185304
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28185076
downvote count: 2
type: Question

http://stackoverflow.com/q/28157377
answer count: 4
possible better answer: http://stackoverflow.com/a/28285078
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28404873
has answer: http://stackoverflow.com/a/28285078
has answer: http://stackoverflow.com/a/28285164
score: 24
accepted answer: http://stackoverflow.com/a/28404873
upvote count: 24
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0
has title: How to display server errors in Angularjs with ng-messages
has body: I have have my angular app validating a sign-up form. On submit, the server also validates the data. I'm outputting error messages in angular using ng-messages. Here is a shortened version of my form, which works perfectly so far. First name Please provide your email The server verifies the email address is unique, and if not, returns a 422 error (from Laravel 5), with an array of errors. [ 'email' => 'This email is already in use' ] I'd like to merge in this, and any other messages sent back from the server into their relevant ng-messages block. Any idea how I could accomplish it?
has answer: http://stackoverflow.com/a/28281484
tagged with: angularjs

datetime
tags question: http://stackoverflow.com/q/28147838
tags question: http://stackoverflow.com/q/28206382
tags question: http://stackoverflow.com/q/28218999
tags question: http://stackoverflow.com/q/28176290
tags question: http://stackoverflow.com/q/28261991
tag name: datetime
type: Tag
tags question: http://stackoverflow.com/q/28211406
tags question: http://stackoverflow.com/q/28207114
tags question: http://stackoverflow.com/q/28189370

http://stackoverflow.com/comment/44620034
comment on: http://stackoverflow.com/q/28122920
score: 0
type: QuestionComment
has text: 1. Check the path and file name. 2. The app.js i.e) the file that contains the response and the public directory should be in the same directory.
type: Comment

http://stackoverflow.com/q/28158936
has title: Three.js scene not displaying after replacing renderer
answer count: 1
tagged with: three.js
score: 0
has answer: http://stackoverflow.com/a/28239114
type: Question
type: AnsweredQuestion
has body: Update: re-wrote the question to make it more general. (Original here for reference) I am rendering a scene in a Three.js WebGLRenderer. Then I need to replace the renderer with a new WebGLRenderer (replacing the canvas with a new canvas) and render the same scene again in the new renderer. The setup looks roughly like this: cancelAnimationFrame(this.requestID_); // all other Three.js objects stay same (and I let Three.js create a new canvas) this.createNewRenderer(); this.animate(); However, the new renderer will just render an empty background, and not the scenes meshes. If I replace the scene meshes with newly calculated meshes, rendering is fine again. Therefore I assume it has something to do with the meshes. So, to avoid recalculating the mesh, I've tried setting all geometry.xxxNeedUpdate and material.needUpdate flags as per this three.js doc before (and after) creating the new renderer, but this hasn't worked either. What can I do to "force refresh" the meshes to display again in a new WebGLRenderer?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28239114

http://stackoverflow.com/a/28270630
upvote count: 2
has comment: http://stackoverflow.com/comment/44897498
has comment: http://stackoverflow.com/comment/44935434
has comment: http://stackoverflow.com/comment/44911610
has comment: http://stackoverflow.com/comment/44897743
type: Answer
has comment: http://stackoverflow.com/comment/44897669
downvote count: 0
has body: Try: $(document).ready(function() { $('#ingredients .sugar').html("5"); }); Notice the space between; this says look for a .sugar child from the #ingredients parent. You should also be able to do: var val = $('#ingredients .sugar').html();
answers question: http://stackoverflow.com/q/28270593
has comment: http://stackoverflow.com/comment/44896864
score: 2

http://stackoverflow.com/q/28155766
has comment: http://stackoverflow.com/comment/44683506
has comment: http://stackoverflow.com/comment/44703771
score: 0
has comment: http://stackoverflow.com/comment/44682806
has comment: http://stackoverflow.com/comment/44682772
type: Question
has body: I would like use the following syntax where the parameter is an ID of HTML element, very similar as to how you setup JWPlayer but I can't figure out how they did it. This is so I can make it as simple as possible for someone else to use. myWidget("htmlTargetId"); I'm trying to avoid having to do: myWidget = new MyWidget("htmlTargetId"); I know that I can create the first by doing: var myWidget = function(target) { // Do something here } myWidget("htmlTargetId"); I need to add methods and properties etc but I would like a "constructor" that will create elements in the "htmlTargetId". What would be the best way to do this? I tried a few variations, this is the latest attempt: var myWidget = (function () { var _target = undefined; // constructor var widget = function (target) { _target = target; version = 12; }; widget.prototype = { constructor: widget, doSomething: function () { console.log("I will so something to", target); } }; return widget; })(); // Try out the new code myWidget("htmlTargetId"); console.log(myWidget.version); myWidget.doSomething(); But this gives me "undefined" and "Uncaught TypeError: undefined is not a function" I assume this is because the return statement is returning a function rather than an object because I'm not using "new"? // Trying to avoid having to do this superWidget = new myWidget("htmlTargetId"); Many thanks!
has comment: http://stackoverflow.com/comment/44682863
has title: JavaScript "Class" Structure to avoid using x = new widget();
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28156052
type: UnansweredQuestion

http://stackoverflow.com/a/28171287
score: 14
upvote count: 14
downvote count: 0
has body: Like the other answer says you cant call sendMail from the normal onEdit. To fix: rename onEdit to something else like "onEditTrigger" and manually install the trigger from the "Resources" menu. That link also explains the difference, including the restriction you just found out, between the different types of triggers. In this case, onEdit is a simple trigger while my onEditTrigger is an installable trigger
answers question: http://stackoverflow.com/q/28163274
has comment: http://stackoverflow.com/comment/67586780
type: Answer
has comment: http://stackoverflow.com/comment/67586261

http://stackoverflow.com/comment/44756223
score: 0
type: Comment
type: QuestionComment
has text: Isn't it exactly what you want to achieve? Single "Includes/Shop/js/bundles/abc" script which included code from all 4 javascripts added in "Include(..." section? Or am I missing something?
comment on: http://stackoverflow.com/q/28193991

http://stackoverflow.com/comment/44768573
type: Comment
has text: Thanks, it's working. But i have one more question, when i do this post request i have another type of answer from server, json looks like {expression:'5+7',token:'a123'}, now i need to get this token value and do get request if token exists. I tried several times but i can not access $scope.expression.token, how can i do this if you understand me. My logic is something like this: if ($scope.results.expressionId !== undefined) { $scope.getNewExpression = function () { $scope.results.push(getExpressionFactory.result($scope.results.expressionId));};}
score: 0
comment on: http://stackoverflow.com/a/28199872
type: AnswerComment

http://stackoverflow.com/comment/44865178
has text: Yes but promises also hold reference to their fulfillment values and error reasons... but nothing holds reference to the promise so it doesn't matter
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28250700

google-maps-api-3
tags question: http://stackoverflow.com/q/28129615
tags question: http://stackoverflow.com/q/28213216
tags question: http://stackoverflow.com/q/28233018
tags question: http://stackoverflow.com/q/28229673
tags question: http://stackoverflow.com/q/28154798
tags question: http://stackoverflow.com/q/28205823
tags question: http://stackoverflow.com/q/28232708
tags question: http://stackoverflow.com/q/28261525
tags question: http://stackoverflow.com/q/28240226
tags question: http://stackoverflow.com/q/28152941
tags question: http://stackoverflow.com/q/28134114
tags question: http://stackoverflow.com/q/28224307
tags question: http://stackoverflow.com/q/28126462
tags question: http://stackoverflow.com/q/28228005
tags question: http://stackoverflow.com/q/28190536
tags question: http://stackoverflow.com/q/28264516
tags question: http://stackoverflow.com/q/28126635
tags question: http://stackoverflow.com/q/28254090
tags question: http://stackoverflow.com/q/28141271
tags question: http://stackoverflow.com/q/28222963
tags question: http://stackoverflow.com/q/28127176
tags question: http://stackoverflow.com/q/28265890
tags question: http://stackoverflow.com/q/28261997
tags question: http://stackoverflow.com/q/28141372
tags question: http://stackoverflow.com/q/28219832
tags question: http://stackoverflow.com/q/28176507
tags question: http://stackoverflow.com/q/28245542
tags question: http://stackoverflow.com/q/28145291
tags question: http://stackoverflow.com/q/28145767
tags question: http://stackoverflow.com/q/28166924
tags question: http://stackoverflow.com/q/28138510
tags question: http://stackoverflow.com/q/28198415
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/28150715
type: Tag
tags question: http://stackoverflow.com/q/28265228
tags question: http://stackoverflow.com/q/28202562
tags question: http://stackoverflow.com/q/28192756
tags question: http://stackoverflow.com/q/28140181
tags question: http://stackoverflow.com/q/28186720
tags question: http://stackoverflow.com/q/28187390
tags question: http://stackoverflow.com/q/28259308
tags question: http://stackoverflow.com/q/28196886
tags question: http://stackoverflow.com/q/28275038
tags question: http://stackoverflow.com/q/28209326
tags question: http://stackoverflow.com/q/28196026
tags question: http://stackoverflow.com/q/28263022
tags question: http://stackoverflow.com/q/28212129
tags question: http://stackoverflow.com/q/28202866
tags question: http://stackoverflow.com/q/28130114
tags question: http://stackoverflow.com/q/28131661
tags question: http://stackoverflow.com/q/28135458

http://stackoverflow.com/q/28154180
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28154289
answer count: 3
has body: I have a webapp that makes calls to a database. Every once in a while, we get a javascript alert dialog that says that the transaction was deadlocked. Honestly, we don't care if that happens because it's not an interactive app...it just displays data based on a timer and if it misses it this time, it's okay to display it next time around. I know you can over write the alert method like so: window.alert = function alert(msg) { console.log('Hidden Alert ' + msg); }; (found at Can I prevent an alert() with a Google Chrome Extension) The question I have is: Is there a way to see if the message for the alert .containsa specific word or phrase, ignore the alert call if it does but display the alert otherwise? Installing an extension to deal with this really isn't an option. Clarification: I know how to catch it if it does or doesn't but what code would I write to go ahead and display the alert like normal if I'm over writing the alert code?
possible better answer: http://stackoverflow.com/a/28154278
favorite count: 0
has answer: http://stackoverflow.com/a/28154278
has comment: http://stackoverflow.com/comment/44679942
upvote count: 2
has comment: http://stackoverflow.com/comment/44679953
accepted answer: http://stackoverflow.com/a/28154289
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28154318
linked to: http://stackoverflow.com/q/2963677
tagged with: alert
has comment: http://stackoverflow.com/comment/44679892
type: Question
has title: Javascript alert: block if message contains certain word?

http://stackoverflow.com/a/28209939
score: 4
answers question: http://stackoverflow.com/q/28209744
upvote count: 4
downvote count: 0
has body: You should return the promise object outside the $http. You can also return the $http because is a promise, is not necessary to have another promise. angular.module('starter.services', ['ngResource']) .factory('GetMainMenu', ['$http', '$q', '$cacheFactory', function ($http, $q, $cacheFactory) { var methodStr = 'JSONP'; var urlStr = 'http://localhost/bd/wp-admin/admin-ajax.php'; var ptStr = {action: 'bd_get_main_menus', callback: 'JSON_CALLBACK'}; return { getMainMenuItems: function () { var deferred = $q.defer(); $http.jsonp(urlStr, {params: ptStr}) .success(function (data, status) { deferred.resolve(data); }) .error(function (data, status) { deferred.reject(data); }); return deferred.promise } } }]) angular.module('starter.controllers', []) .controller('AppCtrl', function ($scope, $ionicModal, $timeout, $http, GetMainMenu) { GetMainMenu.getMainMenuItems().then( function (data) { $scope.mainMenus = data; }); });
type: Answer
has comment: http://stackoverflow.com/comment/48130466

http://stackoverflow.com/a/28157642
type: Answer
has comment: http://stackoverflow.com/comment/44687173
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/44687148
has comment: http://stackoverflow.com/comment/44687782
has body: Use the recently added withLatestFrom instead of combineLatest. var price = totalValue.withLatestFrom(quantityValue, (x,y) =&gt; x/y); Compare their diagrams: http://rxmarbles.com/#combineLatest http://rxmarbles.com/#withLatestFrom http://rxmarbles.com/#zip
upvote count: 6
has comment: http://stackoverflow.com/comment/44686605
answers question: http://stackoverflow.com/q/28153548
has comment: http://stackoverflow.com/comment/44686746
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28153548

http://stackoverflow.com/q/28163866
score: 0
has title: Unable to display TodoList view in browser
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28164810
tagged with: javascript
tagged with: jquery
tagged with: backbone.js
type: Question
has body: Iam learning Backbone JS, Iam trying to display TodosList, but not rendering. However, iam able to get collection data from the server. Could you please tell me what went wrong in the below code. Here is the code: And also Iam not sure whether 'fetch' is pre-defined event or not? When to use 'reset' event , when to use 'fetch' event? They both look similar to me.

http://stackoverflow.com/a/28172067
answers question: http://stackoverflow.com/q/28172024
has body: Try adding the predicate to the ng-class condition: Name Having a default arrow showing when the table is not sorted by this column is as simple: Name
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44730137
upvote count: 2
has comment: http://stackoverflow.com/comment/44713978
has comment: http://stackoverflow.com/comment/44747335
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44730000
has comment: http://stackoverflow.com/comment/44713818
accepted answer of: http://stackoverflow.com/q/28172024

http://stackoverflow.com/comment/44903258
score: 0
has text: Can you show the example code where the "array" is null? Also which Browser are you testing with?
type: Comment
comment on: http://stackoverflow.com/a/28274098
type: AnswerComment

http://stackoverflow.com/a/41426987
has body: As of my knowledge for html2canvas border radius should be half of the width or height at max.In your case it should be max 75. .circular { background-size: cover; display: block; left: 0; top: 0; right: 0; bottom: 0; width: 150px; height: 150px; border-radius: 75px; margin: 70px auto; -webkit-border-radius: 150px; -moz-border-radius: 150px; }
downvote count: 0
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28276179
score: 4

http://stackoverflow.com/comment/44833083
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28234304
type: Comment
has text: You need update your html with the values from the dictionary. Something like this should do it. `document.getElementById(<theId>).innerHTML=frmtStr(<DictionaryStringForThatId>, <arguments ...>)`

http://stackoverflow.com/q/28161821
has title: Passing additional information per input box using HTML
type: Question
has comment: http://stackoverflow.com/comment/44714948
tagged with: javascript
tagged with: forms
score: 0
has comment: http://stackoverflow.com/comment/44696085
has body: I'm asking this question since I'm simply not clear on where to research further - I have experience primarily with Python, while my HTML and Javascript knowledge are on an as-needed basis. I simply haven't been able to figure out the most elegant and standard way to do this, and which component (the HTML itself, a Javascript component, Django) should be responsible for doing what I want. I am trying to create a form for input of linguistic data with a Django app. Important for what I'm doing here is that each datum has associated tags. Also, most linguistic data is paradigmatic, so I want to be able to have users input an entire paradigm at a time (rather than one single datum at a time, which can be done already using the Django admin interface). I also, ultimately, want to have the paradigmatic input be dynamic in the future, so that I do not have to hardcode things. For example, I would like have a form that looks like the following: On submit, I would like the page to send something like this to the server: 'I', tags:'singular, 1st' 'we', tags:'plural, 1st' ˈYou',tags:'singular, 2nd,masculine' ... I simply don't know what the best way is to embed this extra data into the website so that it gets submitted when the page gets submitted. Ideally, the input boxes could somehow 'inherit' the tags based on their position in the columns and rows rather than each input box needing to be have that information added individually. The only idea I've had so far is to embed the tag information into the names of the input boxes so that the string passed on a get command would be something like '?singular_1st=I&amp;plural_1st=we&amp;singular_2nd_masculine=You' and I would just have to process the strings on the Django backend. I could also use javascript to assign the names of each of the textboxes on pageload somehow, though I'm not sure how to figure out which textbox is located where relative to the headers of the table. What is the best way to do this? Can I somehow pass m…
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
tagged with: django

http://stackoverflow.com/a/28133420
score: 0
has comment: http://stackoverflow.com/comment/44640223
type: Answer
has body: Add a field with a name "returnhere" to the HTML page. &lt;input type="text" name="returnhere"&gt; If I'm reading your code right, the callback for the ajax function should fill in its value.
answers question: http://stackoverflow.com/q/28133369

http://stackoverflow.com/q/28226615
type: AnsweredQuestion
score: 0
has title: What's going on? OpenTextFile.WriteLine error:- Object doesn't support property or method 'WriteLine'
type: Question
tagged with: activexobject
answer count: 1
has comment: http://stackoverflow.com/comment/44816430
tagged with: javascript
has answer: http://stackoverflow.com/a/28226747
tagged with: filesystemobject
accepted answer: http://stackoverflow.com/a/28226747
has body: Need some advice please peep's... 11 &lt;script&gt; 12 fname='C:/Genesis 15/site/portal/proj/htm_app/pkmn/test_2.txt' 13 mode=8 // Open a file for reading 14 create=true // a new file will not be created 15 16 xfs=new ActiveXObject('Scripting.FileSystemObject') 17 xfs.OpenTextFile(fname,mode,create) 18 xfs.WriteLine('This text will be added to the end of file') 19 xfs.Close() 20 &lt;/script&gt; returns:- SCRIPT438: Object doesn't support property or method 'WriteLine' File: default.htm, Line: 18, Column: 3 I really don't get it! what am I missing? It's the same code I've used in IE since, well, forever... And now it's popping up with this, AARRGGHH?!
has comment: http://stackoverflow.com/comment/44816583
linked to: http://stackoverflow.com/q/13975922
has comment: http://stackoverflow.com/comment/44816479

http://stackoverflow.com/comment/44713675
has text: But you should think twice before using `async: false`. It is not a good practice.
type: Comment
comment on: http://stackoverflow.com/a/28172066
score: 0
type: AnswerComment

http://stackoverflow.com/q/28132068
score: 2
has body: I'm building an extension for Google Chrome. The extension is a New Tab Page. Well to get user_email, what I do is get a token in javascript with this code: chrome.identity.getAuthToken({"interactive":true},function(token){ console.log(token); }); And I do a request to have user email to this direction: https://www.googleapis.com/oauth2/v1/userinfo?alt=json&amp;access_token=(token) My problem today, was that, trying something I revoked that token, and now my JavaScript console returns me an error saying that the token is invalid and can't do the petition to the userinfo url. I thought that if I clean cache and refresh the extension, the first code will generate a new token, but it was not until five minutes later that the new token was generated. I want to know how to force to get a new token immediately if the last one now is invalid. (I apologize for my English :/ ) Thanks :)
answer count: 0
tagged with: google-chrome
has title: Get new token google api
type: Question
has comment: http://stackoverflow.com/comment/44772316
tagged with: javascript
has comment: http://stackoverflow.com/comment/44729515
tagged with: google-chrome-extension
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: google-api
type: UnansweredQuestion

http://stackoverflow.com/comment/44735203
type: Comment
has text: OK. I don't know how to do then if no script tags could be added. Sorry about that...
comment on: http://stackoverflow.com/a/28165888
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44839412
type: Comment
comment on: http://stackoverflow.com/a/28220615
type: AnswerComment
has text: @TomasMatejicek It's called [Separation of Concerns](https://en.wikipedia.org/wiki/Separation_of_concerns). In the same way that [presentation should be separated from content](https://en.wikipedia.org/wiki/Separation_of_presentation_and_content), behavior should too. Moreover, if you use event handler content attributes, the functions you want to call must be global. And the scope in those handlers behaves weird, so properties from `Element.prototype` can shadow the function you want to call (see [example](http://stackoverflow.com/a/28174022/1529630)).
score: 0

http://stackoverflow.com/comment/44627061
has text: Wow, that easy? But isn´t this a general statement for any circle? What if I want to have different functions depending on the name of the circle? Or is it just me and I don´t see where this is happening?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28126947
type: AnswerComment

http://stackoverflow.com/a/28139056
has comment: http://stackoverflow.com/comment/44651703
has body: It seems you are trying to use PHP to serve a static page with some random sentences, right? So why not use PHP to serve valid JSON, and handle to display logic on the client? Heres a quick implementation. // Get the data from the text file $source = file_get_contents('./quotes.txt', true); // Build an array (break on every line break) $sentences = explode("\n", $source); // Filter out empty values (if there is any) $filtered = array_filter($sentences, function($item) { return $item !== ""; }); // Build a hashmap of the array $pairs = array_map(function($item) { return ['sentence' => $item]; }, $filtered); // Encode the hashmap to JSON, and return this to the client. $json = json_encode($pairs); Now you can let the client handle the rest, with some basic JavaScript. // Return a random sentence from your list. var random = sentences[Math.floor(Math.random() * sentences.length)]; // Finally display it random.sentence [edit] You can get the JSON data to client in many ways, but if you don't want to use something like Ajax, you could simply just dump the contents on your webpage, then use JavaScript to update the random sentence, from the global window object. // Inside your php page English: Spanish:
has comment: http://stackoverflow.com/comment/44655534
has comment: http://stackoverflow.com/comment/44654939
has comment: http://stackoverflow.com/comment/44680383
has comment: http://stackoverflow.com/comment/44652525
has comment: http://stackoverflow.com/comment/44673482
has comment: http://stackoverflow.com/comment/44681548
answers question: http://stackoverflow.com/q/28138155
has comment: http://stackoverflow.com/comment/44685890
score: 0
has comment: http://stackoverflow.com/comment/44654811
has comment: http://stackoverflow.com/comment/44651307
has comment: http://stackoverflow.com/comment/44651055
has comment: http://stackoverflow.com/comment/44651824
type: Answer

http://stackoverflow.com/comment/44908801
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28276965
has text: It will bring out "TX" only, because is selecting only two characters. Is the state code of variable length?

http://stackoverflow.com/comment/44929304
score: 1
comment on: http://stackoverflow.com/a/28235139
has text: @Hans Could you show some sample code that illustrates your bug? When a page is correctly disposed, `window` will be `undefined`. E.g. try the following in the console: `w = window.open();` (switch to new tab) `function foo(){return window;}` (close tab and switch back to original tab) `w.foo() === undefined;` // true.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28147494
has body: What you can do is that: function person() { name = "David"; this.hello = function() { console.log("I'm in hello"); }; } var johnny = new person(); johnny.hello(); See this nice article: http://www.phpied.com/3-ways-to-define-a-javascript-class/
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28147426
score: 1
upvote count: 1

http://stackoverflow.com/a/28207869
answers question: http://stackoverflow.com/q/28207713
score: 0
has comment: http://stackoverflow.com/comment/44781079
type: Answer
has body: use onkeyup,.. attribute inside the element and call the function like this &lt;input type="text" name="deptname" placeholder="department name" id="detp_names09o" class="TEXTNAME_o909ioi" onkeyup="functionName()"/&gt; in javascript function functionName(){ //your code }
has comment: http://stackoverflow.com/comment/44781112
has comment: http://stackoverflow.com/comment/44781026

http://stackoverflow.com/comment/44829484
comment on: http://stackoverflow.com/q/28233715
type: Comment
type: QuestionComment
has text: why is the order in you backend necessary?
score: 0

http://stackoverflow.com/comment/44884282
score: 1
has text: @Malki Please re-read my first comment. There has to be a script creating the attributes. Many libraries creates polyfills for older IEs only, but there's no reason to polyfill something existing in other browsers, hence this happens in IE8 only. Just reduce libraries and scripts on the page until the extra attributes vanishes. If they won't, most likely it's the plug-in adding the attributes.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28263504

http://stackoverflow.com/q/28171743
favorite count: 0
possible better answer: http://stackoverflow.com/a/28171769
has comment: http://stackoverflow.com/comment/44712836
has answer: http://stackoverflow.com/a/28172053
type: Question
has answer: http://stackoverflow.com/a/28171769
answer count: 8
has answer: http://stackoverflow.com/a/28171897
has answer: http://stackoverflow.com/a/28171913
has answer: http://stackoverflow.com/a/28171976
has comment: http://stackoverflow.com/comment/44712820
has comment: http://stackoverflow.com/comment/44712654
accepted answer: http://stackoverflow.com/a/28171864
has body: I have a code as follows. I need to get the name of the user whos button has been clicked. This example has to be fixed because there are several "user_name" classes and I think jQuery doesn't know what value to grab with val(). How can I fix this? $(document).ready(function(){ $(document).on("click", ".btn" , function() { var myuser = $('user_name').val(); }); }); Click John : Hello! Click Jeff : Hi! Click Jane : Whats up?!
upvote count: 1
has answer: http://stackoverflow.com/a/28171975
has comment: http://stackoverflow.com/comment/44713289
has comment: http://stackoverflow.com/comment/44712706
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44712767
has title: Getting the right value with jQuery val() when there are multiple equal css classes
has answer: http://stackoverflow.com/a/28172060
has comment: http://stackoverflow.com/comment/44716885
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44712725
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28171864

http://stackoverflow.com/a/28133457
has comment: http://stackoverflow.com/comment/44639662
has comment: http://stackoverflow.com/comment/44639934
downvote count: 0
answers question: http://stackoverflow.com/q/28132966
has body: I managed to fix it by using width:10ch; explicitly. See Fiddle. The full CSS I came up with is: textarea{ width:auto; /* Default */ width:10ch; /* 10 characters for webkit */ width:auto\9; /* Fix for IE */ }
has comment: http://stackoverflow.com/comment/44639711
has comment: http://stackoverflow.com/comment/44639654
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28133677
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44639928
type: Question
has answer: http://stackoverflow.com/a/28503778
accepted answer: http://stackoverflow.com/a/28503778
has title: Javascript events and Velocity JS
score: 0
has body: I am currently learning how to use Velocity JS, but I really don't understand if I am "allowed" to use Javascript events to trigger velocity animations. I don't see any cases of this being done in the documentation.
answer count: 1
has comment: http://stackoverflow.com/comment/44639815
tagged with: javascript
tagged with: velocity
tagged with: animation

http://stackoverflow.com/a/28200591
has comment: http://stackoverflow.com/comment/44769241
score: 13
downvote count: 1
has comment: http://stackoverflow.com/comment/44767436
has body: Best practice is to keep any dynamic data out of your field names. The typical approach for a use case like this is to make groups an array and move the name of the group into a name field of the contained objects. Then you can use the Mixed type to contain the user-defined set of values: { "_id": ObjectId("..."), "groups": [ { name: "groupA", values: { "value1": "...", "value2": "..." } }, { name: "groupB", values: { "value3": "..." } }, { name: "groupC", values: { "value4": "...", "value5": "..." } }, ... ] } You'd define the schema as: var schema = new Schema({ groups: [{ name: String, values: Schema.Types.Mixed }] });
has comment: http://stackoverflow.com/comment/44769069
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44769419
has comment: http://stackoverflow.com/comment/44770466
accepted answer of: http://stackoverflow.com/q/28200502
has comment: http://stackoverflow.com/comment/108590155
answers question: http://stackoverflow.com/q/28200502
type: Answer
upvote count: 14

http://stackoverflow.com/comment/44737703
type: Comment
comment on: http://stackoverflow.com/q/28184346
type: QuestionComment
score: 1
has text: it should work... try to put an alert stmt in the click handler... only problem when submit button is inside a form is, the form will get submitted... so try to prevent it by returning `false` or by calling `event.preventDefault()`

http://stackoverflow.com/a/28158555
score: 2
answers question: http://stackoverflow.com/q/28158496
downvote count: 0
has body: A simple loop will do the trick: var highest = 0, term = ""; for (var i = 0; i &lt; barTextData.length; i++) { if (barTextData[i].conversion &gt; highest) { highest = barTextData[i].conversion; term = barTextData[i].term; } }
type: Answer
has comment: http://stackoverflow.com/comment/44688549
upvote count: 2

http://stackoverflow.com/q/28152731
has comment: http://stackoverflow.com/comment/44677005
has comment: http://stackoverflow.com/comment/44677334
favorite count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44676725
score: 1
tagged with: replace
tagged with: social-networking
type: Question
has answer: http://stackoverflow.com/a/28152825
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Custom sharing icons - get url, encode uri & replace
upvote count: 1
has body: I have 4 icons on each page of a site to share the page you're on. I want to grab the URL of the page you're on, encode it, and then plug it into the href attribute of each button. var url = window.location.href; var encodedUrl = encodeURIComponent(url); var urlRegEx = new RegExp(encodedUrl,'g'); $(".social").each(function () { $(this).html(this.html().replace('sharethisurl',urlRegEx)); });

http://stackoverflow.com/comment/44869862
comment on: http://stackoverflow.com/q/28255571
has text: this is a .js file, its taken from ajax chat
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28219010
has body: Looks like you aren't building your file from the multipart form. Before the code below I use node aws-sdk to build an s3Bucket that I can PUT to. req.busboy.on ( 'file', function ( fieldname, file, filename, encoding, mimetype ) { if ( !filename ) { // If filename is not truthy it means there's no file return res.status ( 400 ).send ( {error: 'no file'} ); } // Create the initial array containing the stream's chunks file.fileRead = []; file.on ( 'data', function ( chunk ) { // Push chunks into the fileRead array this.fileRead.push ( chunk ); //you can use this if you want to limit file size on ingest /*if(this.fileRead.length &gt; 5500000){ return res.status(500 ).send({error:"file too large - 5MB max"}) }*/ } ); file.on ( 'error', function ( err ) { console.log ( 'Error while buffering the stream: ', err ); } ); file.on ( 'end', function () { // Concat the chunks into a Buffer var finalBuffer = Buffer.concat ( this.fileRead ); req.files[fieldname] = { buffer : finalBuffer, size : finalBuffer.length, filename: filename, mimetype: mimetype } var data = {Key: "users/" + req.body.id + '/image/' + req.body.id, Body: req.files[fieldname].buffer, ACL: 'public-read'}; //im not sure how you're uploading to s3 but I use this s3Bucket.putObject ( data, function ( err, data ) { if ( err ) { console.log ( err ) return res.status ( 400 ).send ( 'error during upload' ) } else { //success } } ) } ); } );
has comment: http://stackoverflow.com/comment/44898715
answers question: http://stackoverflow.com/q/28217462
type: Answer
has comment: http://stackoverflow.com/comment/44821116
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44837171
downvote count: 0

ruby-on-rails
tags question: http://stackoverflow.com/q/28241849
tags question: http://stackoverflow.com/q/28230902
type: Tag
tags question: http://stackoverflow.com/q/28277607
tags question: http://stackoverflow.com/q/28170162
tags question: http://stackoverflow.com/q/28187198
tags question: http://stackoverflow.com/q/28199672
tags question: http://stackoverflow.com/q/28240103
tags question: http://stackoverflow.com/q/28252846
tags question: http://stackoverflow.com/q/28220448
tags question: http://stackoverflow.com/q/28159401
tags question: http://stackoverflow.com/q/28258346
tags question: http://stackoverflow.com/q/28177942
tags question: http://stackoverflow.com/q/28188539
tags question: http://stackoverflow.com/q/28265857
tags question: http://stackoverflow.com/q/28202271
tags question: http://stackoverflow.com/q/28234425
tags question: http://stackoverflow.com/q/28182135
tags question: http://stackoverflow.com/q/28135955
tags question: http://stackoverflow.com/q/28139230
tags question: http://stackoverflow.com/q/28268895
tags question: http://stackoverflow.com/q/28228477
tags question: http://stackoverflow.com/q/28152166
tags question: http://stackoverflow.com/q/28142699
tags question: http://stackoverflow.com/q/28257924
tags question: http://stackoverflow.com/q/28168051
tags question: http://stackoverflow.com/q/28177572
tags question: http://stackoverflow.com/q/28266405
tags question: http://stackoverflow.com/q/28144615
tags question: http://stackoverflow.com/q/28256004
tags question: http://stackoverflow.com/q/28255634
tags question: http://stackoverflow.com/q/28200690
tags question: http://stackoverflow.com/q/28254895
tags question: http://stackoverflow.com/q/28194604
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/28279162
tags question: http://stackoverflow.com/q/28198933
tags question: http://stackoverflow.com/q/28122408
tags question: http://stackoverflow.com/q/28249507
tags question: http://stackoverflow.com/q/28177197
tags question: http://stackoverflow.com/q/28147028
tags question: http://stackoverflow.com/q/28271551
tags question: http://stackoverflow.com/q/28261039
tags question: http://stackoverflow.com/q/28163048
tags question: http://stackoverflow.com/q/28197894
tags question: http://stackoverflow.com/q/28134186
tags question: http://stackoverflow.com/q/28135991
tags question: http://stackoverflow.com/q/28226360
tags question: http://stackoverflow.com/q/28225519
tags question: http://stackoverflow.com/q/28133850
tags question: http://stackoverflow.com/q/28197661
tags question: http://stackoverflow.com/q/28267052
tags question: http://stackoverflow.com/q/28232634
tags question: http://stackoverflow.com/q/28158828
tags question: http://stackoverflow.com/q/28268449
tags question: http://stackoverflow.com/q/28204401
tags question: http://stackoverflow.com/q/28261307
tags question: http://stackoverflow.com/q/28229691
tags question: http://stackoverflow.com/q/28218867
tags question: http://stackoverflow.com/q/28192755

http://stackoverflow.com/a/29519905
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/100162271
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28159392
answers question: http://stackoverflow.com/q/28159392
has comment: http://stackoverflow.com/comment/109469605
has body: Looks like it has been fixed by Google :)
type: AcceptedAnswer

http://stackoverflow.com/q/28187393
score: 1
type: Question
has answer: http://stackoverflow.com/a/28187474
tagged with: closures
tagged with: javascript
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28187448
favorite count: 0
has title: what does closure do in the code below?
type: UnansweredQuestion
has body: //case 1 setInterval(function(){someFunc()},5000); var someFunc=function (){ alert('in the someFunc'); } //case 2 setInterval(someFunc,5000); var someFunc=function (){ alert('in the someFunc'); } what is the difference between the two cases?In the compilation phase,both case 1 and case 2 the someFunc is undefined and in execution phase the someFunc is not changed where the setInterval function be called,why case 1 can success ?the only difference between case 1 and case 2 is the closure in case 1 .what does the closure do in case 1?
has answer: http://stackoverflow.com/a/28187501
downvote count: 0

http://stackoverflow.com/comment/44887251
comment on: http://stackoverflow.com/a/28264861
type: AnswerComment
has text: "I am using this code which works by clicking the Free shipping but the text should replace while the page loads not by clicking on it." How can it replace it while the page loads if it's not there when it loads. Could you edit the question to clarify.
score: 0
type: Comment

http://stackoverflow.com/comment/44716790
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28173566
has text: that can't be true otherwise when I'd paste the highlighted code I would paste the linenumbers too
type: AnswerComment

http://stackoverflow.com/q/28236366
tagged with: ember.js
answer count: 3
has body: I am trying to loop over some objects in Ember in a controller, and return an array of their name attributes. I am however confused with what Ember is returning from the findAll function. In a controller, I have the following function - possibleGenres: function() { var genres = this.store.findAll('genre'); var genreNames = genres.map(function(item, index, enumerable){ return item.get('name'); }); return genreNames; }.property(), Logging genres.get('length') gives me 0. I have proven that there are genres available in the findAll function, as when returning the returned genres from just the findAll function, they are displayed in the template. Am I misunderstanding something crucial about Ember controllers here? As ever, any help is much appreciated.
score: 2
has answer: http://stackoverflow.com/a/28241377
tagged with: ember-data
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has title: Ember - Get Value From Ember Data Array
has answer: http://stackoverflow.com/a/28236780
has answer: http://stackoverflow.com/a/32169242
favorite count: 0
type: Question
upvote count: 2

http://stackoverflow.com/q/28244776
type: Question
tagged with: google-analytics
tagged with: google-tag-manager
has body: Let me start off by saying that previously the GTM on the site worked well. One thing I am struggling with now is setting up checkout steps and having GTM still pick up all the transaction data. Previously I had GTM and the data layer like this at the bottom of the page: &lt;script&gt; dataLayer = [{ 'transactionId': id, 'transactionAffiliation': '', 'transactionTotal': totalAmount, 'transactionTax': totalTax, 'transactionShipping': '' }]; &lt;/script&gt; &lt;!-- #include virtual="/GoogleTagManager.html" --&gt; It picked up the transaction just fine. But i wanted to have checkout steps too. Now I have tried it like this: dataLayer.push({ 'event': 'checkout', 'ecommerce': { 'checkout': { 'actionField': {'step': 3}, 'products': [{ 'transactionId': id, 'transactionAffiliation': '', 'transactionTotal': totalAmount, 'transactionTax': totalTax, 'transactionShipping': '', 'quantity': 8, 'coupon': coupon, 'costShirt': +costShirt }] } } }); and also like this: &lt;script&gt; dataLayer = [{ 'transactionId': id, 'transactionAffiliation': '', 'transactionTotal': totalAmount, 'transactionTax': totalTax, 'transactionCoupon': 'coupon' 'transactionShipping': '', 'transactionProducts': [{ 'sku': id, 'name': 'sock', 'category': 'outer', 'price': costSock, 'quantity': 1 }, { 'sku': id, 'name': 'shirt', 'category': 'outer', 'price': costShirt, 'quantity': 2 }] }]; &lt;/script&gt; &lt;!-- #include virtual="/GoogleTagManager.html" --&gt; &lt;script&gt; dataLayer.push({ 'event': 'checkout', 'ecommerce': { 'checkout': { 'actionField': { 'step': 3 }, } } }); &lt;/script&gt; And its obviously not working well (the other 2 steps in the checkout are just steps, nothing else is being sent to data layer). The other 2 steps are like this: dataLayer.push({ 'event': 'checkout', 'ecommerce': { 'checkout': { 'actionField': { 'step': 2 }, } } }); Do you have any suggestions as to how I can get GTM to recognize the transaction again whilst also picking up the coupon and implementing the checkout steps?…
downvote count: 0
tagged with: javascript
favorite count: 0
score: 3
answer count: 0
upvote count: 3
tagged with: google-datalayer
type: UnansweredQuestion
has title: GTM - How to configure checkout steps and transaction

http://stackoverflow.com/comment/44865780
type: Comment
has text: The issue here, I think is a misunderstanding. There is no reason to have an li or button with Polymer. I only put the button in there for demonstration and is completely unnecessary for any of your function. Just a menuitem.... This changes the whole dynamic, hence my confusion at your root issue(s).
score: 1
comment on: http://stackoverflow.com/a/28250323
type: AnswerComment

http://stackoverflow.com/q/28263772
downvote count: 0
score: 1
type: Question
type: AnsweredQuestion
tagged with: responsive-design
tagged with: javascript
upvote count: 1
answer count: 1
has title: Remove class when responsive style no longer applies
tagged with: jquery
has body: so I've made a responsive menu that looks like the smartphone's menu (the one that slides from the side, Im not sure how it is called), and its toggler(which is an Anchor) is shown only when the screen is smaller than 960px using @media screen and (max-width: 960px). now to toggle the menu i use a JQ's .toggleClass to add a class to the body as shown here: $(document).ready(function(){ $('.btn-mobile-nav').click(function(e){ e.preventDefault(); $('body').toggleClass('mobile-slide-nav'); }); }); Now the problem is that when i stretch the window back to a bigger size than 960px after I open the menu the toggler disappears and the class that it added('.mobile-slide-nav') remains in the body element.... So... How do i fix it? any ideas? And sorry about the bad english :)
favorite count: 0
has answer: http://stackoverflow.com/a/28263839
accepted answer: http://stackoverflow.com/a/28263839
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/8943816

http://stackoverflow.com/a/28177513
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28177439
answers question: http://stackoverflow.com/q/28177439
downvote count: 0
type: AcceptedAnswer
has body: I think you should take a look at locks in javascript: https://github.com/Wizcorp/locks
has comment: http://stackoverflow.com/comment/44724631
upvote count: 2

http://stackoverflow.com/q/28163255
has comment: http://stackoverflow.com/comment/44697507
tagged with: css
has title: font,font size, and color change javascript
favorite count: 0
has body: I am trying to make this code change the pre-written text font, font size, and color with an onclick button but am unable to make it work this is what i have so far and im stuck. anyone have any ideas? Change Paragraph Text I am going to change this text, I hope. Style
tagged with: fonts
answer count: 5
downvote count: 1
has answer: http://stackoverflow.com/a/28163308
type: AnsweredQuestion
score: -1
has answer: http://stackoverflow.com/a/28163361
has answer: http://stackoverflow.com/a/28163680
type: Question
has answer: http://stackoverflow.com/a/28163317
upvote count: 0
has comment: http://stackoverflow.com/comment/44697481
accepted answer: http://stackoverflow.com/a/28163680
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28163440
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28163440

http://stackoverflow.com/q/28259292
type: AnsweredQuestion
has title: AngularJS select check data and insert
type: Question
accepted answer: http://stackoverflow.com/a/28259428
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28261542
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28261542
has body: I am angularjs newbie. I try to use ionic framework to do a practice, so that will use angularjs. And I got a little problem. I want to before insert data to check this data have exist, if not exist that will insert a new data. On this method getContent.then(function(res){}), I will check this return res.length, if equal 0 I want insert this data. When I run, that will execute this console, and obj is have data. But at finally, I want get all data, but the data is empty. But I found If I remove this insert method outside getContent.then(function(res){}), it's work. I have no idea how to fix this problem and cause this reason. Thanks your help. This is my Controller code angular.module('starter.controllers', ['sqlite.services']) .controller('TestCtrl', function($scope, $http, Tests, SQLService) { SQLService.setup(); var new_tests = new Array(); $http.get('https://XXXXX').then(function(response){ var datas = response.data; for (data_ in datas) { var obj = { id: datas[data_].content_id, title: datas[data_].title, url: datas[data_].url, content: datas[data_].content }; var getContent = SQLService.get_one(obj.id); getContent.then(function(res) { console.log('res ' , res); console.log('res ' , res.length); // length get 0 if(res.length == 0) { console.log('insert obj ' , obj); console.log('SQLService ' , SQLService); SQLService.insert(obj); } else if (res.length == 1) { console.log('edit obj ' , obj); } }); // SQLService.insert(obj); // If I write insert code here is work for me new_tests.push(obj); } }) .finally(function() { SQLService.all().then(function (results) { $scope.tests = results; console.log('results ' , results); }); }); This is my sql_service.js angular.module('sqlite.services', []) .factory('SQLService', function($q) { var db; function createDB() { try { if (window.cordova) { $cordovaSQLite.deleteDB("my.db"); db = $cordovaSQLite.openDB({name: 'my.db'}); // device } else{ db = window.openDatabase("my.db", '1', 'my', 1024 * 1024 * 100); // browser } db.transa…
tagged with: angularjs
has answer: http://stackoverflow.com/a/28259428

http://stackoverflow.com/q/28268778
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28269040
type: UnansweredQuestion
tagged with: razor
tagged with: css
tagged with: twitter-bootstrap
has body: I have the following Script and markup to render a partial view inside a modal popup:- $(function () { $.ajaxSetup({ cache: false }); $("a[data-modal]").on("click", function (e) { $('#myModalContent').load(this.href, function () { $('#myModal').modal({ keyboard: true }, 'show'); bindForm(this); }); return false; }); }); but can i force the modal window to show a vertical scroll bar , if the partial view content exceed certain height ?
type: Question
has title: how to add a Scroll bar for a partial view rendered inside a modal window

http://stackoverflow.com/comment/44743516
has text: More than likely yes, seems that JQuery can't find `#like-button` in the DOM.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28187114
score: 0

http://stackoverflow.com/comment/44880170
has text: Such a clean solution. I didn't thought I can avoid the if clause. Thank you!
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28253198
type: AnswerComment

http://stackoverflow.com/q/28123055
has title: angular creating too many scopes
tagged with: javascript
has body: My application consists of a table of results (in a ng-repeat) with a pager and pageSize options. Each time I click on the pager or change the page size, a new request is made to the API and the data inside my loop is updated, cause new scopes to appear. I'm having aperformance problem since this is creating an incredible number of scopes each page request / pageSize request when I check batarang. Is there a way to control this scope creation? I'm using Angular 1.3.3. UPDATE: http://jsfiddle.net/z561z7ok/ contains basically the items which are too much 'scoped', and the service serving the data. the pagination call sends a request to get new data. 0"> Service: services.factory('fruitsCollectionService', ['$rootScope', '$http', function($rootScope, $http) { var fruitsCollectionModel = function() { var collection = [] }; fruitsCollectionModel.prototype.getFruitsCollection = function(params) { var self = this; return $http.get(\\APICALL, { cache: params.cached == true, params: { //a few params }, withCredentials: true }).then( function(response) { self.collection = response.data.fruits; if(response.data.fruits.items.length > 0) { angular.forEach(response.data.fruits.items, function(fruit, key) { $rootScope.objectCache[fruit.id] = fruit; }); } return response; }, function(response) { // bring error notification to view } ); }; return fruitsCollectionModel; }]);
score: 0
has comment: http://stackoverflow.com/comment/52023545
has comment: http://stackoverflow.com/comment/44620655
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44619958
has comment: http://stackoverflow.com/comment/44620299
has comment: http://stackoverflow.com/comment/44620330
answer count: 0
has comment: http://stackoverflow.com/comment/44672706
type: Question

http://stackoverflow.com/comment/44807424
type: Comment
type: QuestionComment
score: 1
has text: And also don't forget to initialize the var params, as you are concatenating it in the for. That's giving that undefined in the beginning of the alert.
comment on: http://stackoverflow.com/q/28222048

http://stackoverflow.com/comment/44937696
comment on: http://stackoverflow.com/q/28278786
score: 0
type: Comment
type: QuestionComment
has text: Here is the code in plunker: http://plnkr.co/edit/372da6O25hOrBxpT0oX2?p=preview

http://stackoverflow.com/a/28132793
has body: make a super state with ui-router $stateProvider.state('app', { url: '', abstract:true, resolve: { init: function($q) { return $q(function(resolve, reject) { setTimeout(function() { console.log('Resolving ...'); // resolve resolve(); }, 1000 * 3); }); } }, template: '&lt;hello-world name="World"&gt;&lt;/hello-world&gt;&lt;div ui-view=""&gt;&lt;/div&gt;', }) .state('app.home', { url: '/', controller: 'HomeCtrl', template: '&lt;div class="body"&gt;{{content}}&lt;/div&gt;', }); http://plnkr.co/edit/fUnZ2X7TFBzaRno7GSiq?p=preview with your expected order : Resolving ... Initialize hello-world directive. Initialize home page.
has comment: http://stackoverflow.com/comment/44639254
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28126983
accepted answer of: http://stackoverflow.com/q/28126983
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/46470791
type: QuestionComment
has text: @Prabhu's comment above on the naming of receive event, did the trick for me. It is infact pushNotificationReceived. There is a typo in Prabhu's comment above.
score: 0
comment on: http://stackoverflow.com/q/28202565
type: Comment

http://stackoverflow.com/a/28199316
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44764931
has comment: http://stackoverflow.com/comment/44764915
score: 0
answers question: http://stackoverflow.com/q/28199224
type: Answer
has body: Why are you using an array if you're not concerned with the values? Can't you just do something like this: $('.a').fadeOut();
has comment: http://stackoverflow.com/comment/44764951
has comment: http://stackoverflow.com/comment/44764992

http://stackoverflow.com/a/28136062
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28136023
has body: You need to do two things: create a button element Attach a click event redirecting the page var button = " Link "; $("table").append(" "+title+" "+button+" "); $("table").find(".redirect-button").click(function(){ location.href = $(this).attr("data-url"); });
answers question: http://stackoverflow.com/q/28136023
has comment: http://stackoverflow.com/comment/44644184

http://stackoverflow.com/comment/44763309
has text: @user1833676 ah okay. That would explain it. Is the input part of a form? Could you `.serialize()` it if it is? or if not use `.parent()` or `.closest()` to retrieve the value?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28197793

http://stackoverflow.com/a/28140958
has body: Maybe like that: $(".post-header").each(function (ind, el) { $(this).siblings(".post-image").each(function (ind, el2) { $(el).before($(el2)); }); })
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/28140818
type: Answer
accepted answer of: http://stackoverflow.com/q/28140818

http://stackoverflow.com/comment/47697940
score: 0
type: Comment
has text: was some time ago when*
comment on: http://stackoverflow.com/a/29771085
type: AnswerComment

http://stackoverflow.com/q/28223746
answer count: 3
has comment: http://stackoverflow.com/comment/44811273
downvote count: 1
linked to: http://stackoverflow.com/q/3631199
upvote count: 0
tagged with: javascript
tagged with: jquery
has title: Conditional jquery element selection
has comment: http://stackoverflow.com/comment/44811092
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28223938
favorite count: 0
possible better answer: http://stackoverflow.com/a/28223837
has comment: http://stackoverflow.com/comment/44810592
type: Question
has answer: http://stackoverflow.com/a/28223837
accepted answer: http://stackoverflow.com/a/28223938
has body: I have a table: # Columna Relative Isso 1 This http://stackoverflow.com/ Is 2 Coloumn two this 3 http://stackoverflow.com/ not equals a 4 the Column real 5 first One Coloumn I'd like to select only the tds that have urls in them and change their contents with $("td").each(function(){ $(' ').insertAfter(this); }); I've selected them before using jquery that looks like: $('td').hover( function() { var contents = $( this ).html() ; if (contents.match("^http")) { I'm wondering if you do something like this pseudocode: $('td' WHERE innerhtml=="^http"){....
has comment: http://stackoverflow.com/comment/44810564
has answer: http://stackoverflow.com/a/28224101
score: -1

http://stackoverflow.com/a/28224853
has comment: http://stackoverflow.com/comment/44813659
downvote count: 1
has comment: http://stackoverflow.com/comment/44813938
has body: //before send var regex = /\b(please help me|bad words)\b/i; msg = msg .replace(regex, "***"); //finally
type: Answer
has comment: http://stackoverflow.com/comment/44813397
upvote count: 0
has comment: http://stackoverflow.com/comment/44813082
answers question: http://stackoverflow.com/q/28224543
has comment: http://stackoverflow.com/comment/44813467
score: -1

http://stackoverflow.com/a/29378645
accepted answer of: http://stackoverflow.com/q/28218250
upvote count: 16
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28218250
has body: You can use show-pager="false" option for ion-slide-box
type: Answer
score: 16

http://stackoverflow.com/a/28199898
downvote count: 0
type: Answer
has body: You aren't declaring and using the arguments sent to the receiver's event listener. Your modified argument is sent as a property on an argument passed to your callback. That's where you have to get it from when using your code. Also, I added a console.log() at the start of your callback so you can see if it's getting called: chrome.runtime.onMessage.addListener(function(message) { console.log("received message"); if (message.modified == "true") { alert("modified message recieved"); fourth(); } }); Note: it's a little odd to be passing strings for true and false. Why not just use booleans?
accepted answer of: http://stackoverflow.com/q/28199770
score: 1
answers question: http://stackoverflow.com/q/28199770
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/44634283
has text: Thanks for the tip. That's something I haven't thought of doing. It'll surelely lead me to the mistake.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28130650

http://stackoverflow.com/a/28237765
downvote count: 0
has body: There's a partial solution which works at least for the Bower dependencies. You can use grunt-wiredep to update your Karma configuration with the Bower dependencies, so you don't have to do that manually. There are a couple of configuration examples here.
score: 1
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44837833
answers question: http://stackoverflow.com/q/28236823

http://stackoverflow.com/comment/44866785
score: 1
has text: @Prashant if it's really a ` ` then it won't have a "value" property.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28254037

http://stackoverflow.com/a/28165460
has comment: http://stackoverflow.com/comment/89247823
score: 21
answers question: http://stackoverflow.com/q/28152698
has body: You can use the columns.render option to specify a callback function that can modify the data that is rendered in the column. The callback function takes three parameters (four since 1.10.1). The first parameter is the original data for the cell (the data from the db), the second parameter is the call type (filter, display, type, or sort), and the third parameter is the full data source for the row. The function should return the string that should be rendered in the cell. In your columns definition, add the render option to your imageUrl column definition: { "data": "imageUrl", "render": function(data, type, row) { return '&lt;img src="'+data+'" /&gt;'; } } Documentation on the render option found here.
downvote count: 0
type: Answer
upvote count: 21

http://stackoverflow.com/q/28212504
has answer: http://stackoverflow.com/a/28212980
tagged with: charts
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28212980
has title: Passing data from JSP to jQuery and plotting in Highcharts
type: Question
has body: I am reading a text file which contains data to plot a graph in JSP. I am using hidden method and passing the value to the jQuery. I am able to retrieve the value in jQuery through an alert but when I try to split the value using .split(), the values don't split based on the delimiter specified. &lt;% //response.setIntHeader("Refresh", 10); String jspPath = "C:/Users/Desktop/Out.txt"; BufferedReader reader = new BufferedReader(new FileReader(jspPath)); //BufferedReader br = new InputStreamReader(new FileInputStream(txtFilePath)); StringBuilder sb = new StringBuilder(); String line; String lastline = ""; while((line = reader.readLine())!= null){ lastline = line; } String column3[] = lastline.split("\\*"); %&gt; &lt;input type="hidden" value="&lt;%=column3[2]%&gt;" id = "filevalue"&gt; jQuery part: var a = $('#filevalue').text(); var lines = a.split('\n'); alert(lines); I am referring to this fiddle Link to create the pie chart. Here instead of the hard coded data I am trying to pass the data from the JSP. Since my data is not getting split, i m unable to proceed further. Please help me to split the data in order to provide it as input to the pie chart.
answer count: 1
tagged with: highcharts
tagged with: jsp
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28272607
upvote count: 5
type: Answer
downvote count: 0
has body: In return { alert("para"); } the {...} are interpreted as object literal. An object literal has the form { key: value, //... } Object literals cannot contain arbitrary statements.
score: 5
answers question: http://stackoverflow.com/q/28272580
accepted answer of: http://stackoverflow.com/q/28272580
type: AcceptedAnswer

http://stackoverflow.com/comment/44640845
type: Comment
comment on: http://stackoverflow.com/q/28133185
score: 0
type: QuestionComment
has text: StackOverflow is not a forum, it's a Q&A site. Inexperienced developers are perfectly able to write high-quality questions about beginner problems. See [How to Ask](http://stackoverflow.com/help/how-to-ask) and [the Stack Overflow checklist](http://meta.stackoverflow.com/q/260648). This question is not high-quality, because it's too broad. OP outlines a very very vague requirement, which means that a wide range of solutions apply. and the best solution can only be chosen based on unwritten context. Instead OP should have tried to solve the problem themselves, and ask a question with...

http://stackoverflow.com/q/28275737
has body: I am trying to toggle classes using jQuery and I'm struggling to do so. I have my HTML structure & jQuery as below Processor i3 i5 i7 jQuery $('.facet-title').click(function () { $(this).parent().parent().children("ul").slideToggle(); $(this).attr("title", ($(this).attr("title") == "Click to Collapse") ? "Click to Expand" : "Click to Collapse"); $(this).toggle(function () { $(this).children("span").removeClass("minus").addClass("plus"); }, function () { $(this).children("span").removeClass("plus").addClass("minus"); }); }); So its simple. I want three thing to happen on facet-title click. The 'ul' should toggle from "display:inline-block" to "display:none" The 'title' should toggle from "Click to Collapse" to "Click to Expand" The class's for the span should toggle from "icon minus" to "icon plus". Now, the first two event's happen fine. Its only the 3rd event which does not. what am i doing wrong? Here is a demo to show my progress with the first 2 tasks...
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28276043
has comment: http://stackoverflow.com/comment/44906242
type: Question
has answer: http://stackoverflow.com/a/28275899
tagged with: css
has title: How to toggle multiple classes for child element on parent click
possible better answer: http://stackoverflow.com/a/28275819
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28275819
tagged with: toggle
accepted answer: http://stackoverflow.com/a/28275899
has comment: http://stackoverflow.com/comment/44906281
tagged with: slidetoggle
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44814665
type: AnswerComment
has text: @T.J.Crowder I just tried it in Chrome, jQuery appeared to select what I wanted.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28225700

http://stackoverflow.com/q/28148196
has title: how do i get "this = this" in prototype working
has comment: http://stackoverflow.com/comment/44667874
tagged with: reverse
upvote count: 1
accepted answer: http://stackoverflow.com/a/28148255
favorite count: 0
has comment: http://stackoverflow.com/comment/44668314
has comment: http://stackoverflow.com/comment/44668748
downvote count: 0
has comment: http://stackoverflow.com/comment/44669738
has answer: http://stackoverflow.com/a/28148255
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44668580
tagged with: prototype
linked to: http://stackoverflow.com/q/9329446
type: Question
tagged with: this
answer count: 1
tagged with: javascript
has body: Ok peep's so I know it's bad practice to mess with prototypes but here it is anyway... Array.prototype.rev= function(){ this.reverse(); } Works fine! Updates the source array variable, ary, as expected eg: ary = [123, 456]; ary.rev(); // result: ary == [456, 123] My problem comes when writing a similar property for String. What I would like to do is something like this... String.prototype.rev= function(){ this.split(''); this.reverse(); this.join(''); } Seems simple enough right! Split the string, reverse it, and join it back together so the original string variable, str, is a reverse of it's former self, as was with the ary above! Thing is: Although this.split() has been called it needs to be stored as a variable, ie: split = this.split(''); And there-in lies the this = this problem... Now split is defined, it takes the focus away from editing the source variable and it's not like I can just say at the end of the function: this = split; As this is 'immutable' or what ever it is when they mean it is static and unchangeable? Getting to the point! My Question is this... str = 'abc' I want to be able to say str.rev() not str = str.rev() and get the result of str = 'cba' where str === 'cba', catch my drift?! All work-around's and tuition welcome peep's, I just ask that u know what ur talkin' 'bout. thx

http://stackoverflow.com/comment/44799898
comment on: http://stackoverflow.com/q/28217809
type: QuestionComment
has text: This might help :) http://www.cssreset.com/
score: 0
type: Comment

http://stackoverflow.com/q/28167253
has comment: http://stackoverflow.com/comment/44707340
has title: Javascript not recognising RSAkey() even though js is included
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28168792
has comment: http://stackoverflow.com/comment/44705684
tagged with: cryptography
downvote count: 0
type: UnansweredQuestion
tagged with: encryption
linked to: http://stackoverflow.com/q/18952492
has body: I tried to do RSA encryption in javascript and decryption in java. I referred this as example (#2 post) http://www.wenda.io/questions/5025740/encrypt-a-small-string-with-rsa-in-javascript-then-decrypt-in-java-on-server.html KeyPairGenerator kpg; try { kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(2048); KeyPair kp = kpg.genKeyPair(); yourVariablePublic = kp.getPublic(); yourVariablePublic = kp.getPrivate(); } catch(NoSuchAlgorithmException e) { } Now let`s move to java code of our current page: // receiving public key from where you store it Key publicKey = YourCarrierClass.getYourVariablePublic(); KeyFactory fact; // initializing public key variable RSAPublicKeySpec pub = new RSAPublicKeySpec(BigInteger.ZERO, BigInteger.ZERO); try { fact = KeyFactory.getInstance("RSA"); pub = fact.getKeySpec(publicKey, RSAPublicKeySpec.class); } catch(NoSuchAlgorithmException e1) { } catch(InvalidKeySpecException e) { } // now you should pass Modulus string onto your html(jsp) in such way String htmlUsedModulus = pub.getModulus().toString(16); // send somehow this String to page, so javascript can use it And to decrypt it in java code: Key privateKey = YourCarrierClass.getYourVariablePrivate(); Cipher cipher; BigInteger passwordInt = new BigInteger(ajaxSentPassword, 16); byte[] dectyptedText = new byte[1]; try { cipher = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding"); byte[] passwordBytes = passwordInt.toByteArray(); cipher.init(Cipher.DECRYPT_MODE, privateKey); dectyptedText = cipher.doFinal(passwordBytes); } catch(NoSuchAlgorithmException e) { } catch(NoSuchPaddingException e) { } catch(InvalidKeyException e) { } catch(IllegalBlockSizeException e) { } catch(BadPaddingException e) { } String passwordNew = new String(dectyptedText); System.out.println("Password new " + passwordNew); Like in example, I used the following code in javascript function sendPassword() { var password = $('#passwordField').val(); var rsa = new RSAKey(); rsa.setPublic($('#keyModulus').t…
type: Question
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/44707230
tagged with: servlets

http://stackoverflow.com/comment/44896128
type: Comment
type: QuestionComment
has text: Can you place a answer instead of code here? Is a bit unreadable
comment on: http://stackoverflow.com/q/28269745
score: 0

http://stackoverflow.com/comment/44808668
has text: My Query is ' Update table-name set quantity="xxxx" where prod-order-number="xxxx" and operation="xxxx" ' I need some help in how to get back the existing value and compare it with the the coming values ? I am not able to figure out the logic to do this. I would appreciate if you could provide me a sample code ??
comment on: http://stackoverflow.com/q/28222480
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28249909
score: 2
type: AnsweredQuestion
has body: I am doing an update in mongodb but not very familiar with how to get things done in mongodb. Todo.update({}, {$set : { tags : []}}, false, true); How do I get WriteResult? I want to know the nMatched and nModified value. I tried the following but it doesnt work. var updateResult = Todo.update({}, {$set : { tags : ['test']}}, false, true); (function(updateResult){ console.log('Size of match: ' + updateResult.nMatched); console.log('Size of modified: ' + updateResult.nModified); })();
has title: How to get update query WriteResult in mongodb
upvote count: 2
possible better answer: http://stackoverflow.com/a/28250053
has answer: http://stackoverflow.com/a/28250053
type: Question
has answer: http://stackoverflow.com/a/28265503
tagged with: updates
tagged with: mongodb
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28265503

sequelize.js
type: Tag
tag name: sequelize.js
tags question: http://stackoverflow.com/q/28231970
tags question: http://stackoverflow.com/q/28181872
tags question: http://stackoverflow.com/q/28174502
tags question: http://stackoverflow.com/q/28168776

http://stackoverflow.com/comment/44645672
type: Comment
has text: I'm trying to add a function to the function's prototype (just like you did in the example). Is it possible to get a reference to the function being prototyped? `this` doesn't work. I want to call `reportLoaded.lazy("document")` and get a wrapper automatically. It's just for fun, to understand js better.
type: AnswerComment
comment on: http://stackoverflow.com/a/28136618
score: 0

http://stackoverflow.com/q/28126930
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28126959
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: variables
accepted answer: http://stackoverflow.com/a/28126959
has title: Include in js variable
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to include the following script in a variable. * var contentString =' ddd '; The browser generates an error in the line with . I cannot place the script because it should be executed only if a window opens in google maps --> infowindow.open(map,marker1); Is it generally possible to put the declaration of js in a variable? I have tried several combinations of commas and escape variations (\") but wasn't successful.

http://stackoverflow.com/a/28273246
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44905218
has body: The problem seems to be the container.blur() call; if you move that out of the handling of the event with a setTimeout, the code works (prevents the user creating a newline, and blurs the container): function tryToPreventNewLines(e) { switch (e.keyCode) { case 13: e.preventDefault(); setTimeout(function() { container.blur(); }, 0); return false; } return true; } Updated Fiddle Of course, I'm assuming you want to blur the container when they press Enter. If not, just remove that line entirely. Tested on Chrome, Firefox, and IE11. Below you note that on Chrome, holding down Enter continues to add newlines, even with the above. The only way I see to prevent that is to control the contentEditable property: var container = document.getElementById('myDiv'); function tryToPreventNewLines(e) { switch (e.keyCode) { case 13: e.preventDefault(); this.contentEditable = false; // No longer editable this.blur(); // Remove selection box on Firefox return false; } // Removed the `return true;` here; it was a no-op } function enableEdit() { this.contentEditable = true; // Make it editable this.focus(); // And put the cursor in it } // Just for max compatibility, added the third argument below; // some browsers still require it myDiv.addEventListener( 'keydown', tryToPreventNewLines, false); myDiv.addEventListener( 'change', tryToPreventNewLines, false); myDiv.addEventListener( 'click', enableEdit, false); Updated Fiddle
accepted answer of: http://stackoverflow.com/q/28273182
type: Answer
answers question: http://stackoverflow.com/q/28273182
downvote count: 0
has comment: http://stackoverflow.com/comment/44905861
has comment: http://stackoverflow.com/comment/44905346
score: 3
upvote count: 3

http://stackoverflow.com/comment/44757439
has text: @Phylogenesis: Array.prototype.map() always returns an Array, so it can't exactly reproduce my solution. The closest you could get would be something like `[["name", "noazet"], ["difficulty", "easy"]]`. That's certainly usable, but it's a bit more clumsy, and most devs would probably wind up translating it into something like `{ "name" : "noazet", "difficulty" : "easy" }` anyway. Using `Array.prototype.reduce()` cuts out the intermediate steps.
comment on: http://stackoverflow.com/a/28195259
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28162171
score: 6
upvote count: 7
has answer: http://stackoverflow.com/a/28162680
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/32218417
has comment: http://stackoverflow.com/comment/44695634
has comment: http://stackoverflow.com/comment/44695602
tagged with: split
has body: I've seen a few javascript programmers use this pattern to produce an array: "test,one,two,three".split(','); // =&gt; ["test", "one", "two", "three"] They're not splitting user input or some variable holding a string value, they're splitting a hard-coded string literal to produce an array. In all of the cases I've seen a line like the above it would seem that it's perfectly reasonable to just use an array literal without relying on split to create an array from a string. Are there any reasons that the above pattern for creating an array makes sense, or is somehow more efficient than simply using an array literal?
tagged with: arrays
has answer: http://stackoverflow.com/a/31967719
tagged with: javascript
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/44696518
has answer: http://stackoverflow.com/a/31339480
has comment: http://stackoverflow.com/comment/50663151
has title: JavaScript String.split on a string literal to produce an array
has comment: http://stackoverflow.com/comment/44695987
answer count: 4
type: UnansweredQuestion

http://stackoverflow.com/q/28227399
has title: Please show me the basic pattern for Parse Promises
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28227815
answer count: 1
has body: I'm having trouble wrapping my head around Parse Promises. I'm trying to save an object that could have an image. I can save the post, but the image is never saved. Here's my attempt at getting the promises to work. var savePromise = new Parse.Promise.as(); if(request.params.imageData){ // if there is image data, save the image var image = new Parse.File(fileName, request.params.imageData); savePromise = image.save().then(function() { groupPost.set(constants.kBPGroupImageKey, image); }); } else{// no saved image, resolve the promise and save return savePromise; } groupPost.save().then(function(groupPost){ Any help would be greatly appreciated!
tagged with: parse-cloud-code
tagged with: promise
tagged with: parse-platform
type: UnansweredQuestion

http://stackoverflow.com/q/28259147
downvote count: 1
type: AnsweredQuestion
score: -1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28259294
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44876228
possible better answer: http://stackoverflow.com/a/28259287
has body: $(document).ready(function() { var state = localStorage.hasOwnProperty('sidebarState') ? localStorage.getItem('sidebarState') : false; function setState() { if(state) { $('#sidebar').css('transform', 'translate(0,0)'); state = false; } else { $('#sidebar').css('transform', 'translate(-100%,0)'); state = true; } localStorage.setItem('sidebarState',state); } $('#sidebar_button').click(setState); setState(); }); Always when I reload the page this return true, even if it is false before, so what is wrong.
favorite count: 0
has answer: http://stackoverflow.com/a/28259287
accepted answer: http://stackoverflow.com/a/28259294
has title: Function always returning true
has comment: http://stackoverflow.com/comment/44876122

http://stackoverflow.com/comment/44795780
type: QuestionComment
comment on: http://stackoverflow.com/q/28213656
score: 0
has text: One [example](http://www.geocodezip.com/geoxml3_test/v3_FusionTables_zipcode_map_whiteBg.html) (using the Google Maps Javascript API v3, not the deprecated and turned off [Google Maps Javascript API v2](https://developers.google.com/maps/documentation/javascript/v2/reference)). Displaying roads on top of the state polygons is going to be problematic (unless you have your own database of roads). Look at [styled maps](https://developers.google.com/maps/documentation/javascript/styling), see if that will do what you are looking for.
type: Comment

http://stackoverflow.com/a/28195865
has comment: http://stackoverflow.com/comment/44765987
has comment: http://stackoverflow.com/comment/44810906
has comment: http://stackoverflow.com/comment/44759168
type: Answer
has body: Here is the code which is being used and works without any issue. $folder = 'images/'; $filetype = '*.jpg'; /* use the file extension you would read; here its jpg file */ $files = glob($folder.$filetype); $count = count($files); echo '&lt;ul id="slider"&gt;'; for ($i = 0; $i &lt; $count; $i++) { echo '&lt;li&gt;'; echo '&lt;img src="'.$files[$i].'" /&gt;'; echo substr($files[$i],strlen($folder),strpos($files[$i], '.')-strlen($folder)); /* display name of the file */ echo '&lt;/li&gt;'; } echo '&lt;/ul&gt;';
answers question: http://stackoverflow.com/q/28195351
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44819883
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28195351

http://stackoverflow.com/q/28155388
possible better answer: http://stackoverflow.com/a/28155413
downvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28155413
has comment: http://stackoverflow.com/comment/44682108
has comment: http://stackoverflow.com/comment/44682097
has answer: http://stackoverflow.com/a/28155440
favorite count: 0
answer count: 5
score: -4
has answer: http://stackoverflow.com/a/28155477
has body: I don't understand why this statment does not pass and print my success message. A is true and B and C are false... what's the problem here? var A = true; var B = false; var C = false; if(A &amp;&amp; (B &amp;&amp; C === false)){ console.log('success'); }
type: AnsweredQuestion
has title: Why doesn't this IF statement return the console message?
has answer: http://stackoverflow.com/a/28155411
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44682234
accepted answer: http://stackoverflow.com/a/28155411
has answer: http://stackoverflow.com/a/28155452

http://stackoverflow.com/a/28418838
answers question: http://stackoverflow.com/q/28243792
type: Answer
score: 0
has body: It could be something as simple as the clients browser is blocking javascript from being executed. Maybe specifically blocking your domain or something crazy like that.

http://stackoverflow.com/a/28133755
has comment: http://stackoverflow.com/comment/44672766
has body: You could remove the hyphen(s) when focusing back on the text field: $("#SSN").focus(function(){ $(this).val() = $(this).val().replace(/-/g,""); }); Not tested, but that's the idea.
has comment: http://stackoverflow.com/comment/44640588
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28133728
answers question: http://stackoverflow.com/q/28133728
has comment: http://stackoverflow.com/comment/44640612

http://stackoverflow.com/comment/44863428
score: 0
type: Comment
type: QuestionComment
has text: So just bind onfocus event and inside handler use `this`
comment on: http://stackoverflow.com/q/28252161

http://stackoverflow.com/q/28146393
has comment: http://stackoverflow.com/comment/44664545
has answer: http://stackoverflow.com/a/30243409
has comment: http://stackoverflow.com/comment/44664460
score: 0
accepted answer: http://stackoverflow.com/a/30243830
has answer: http://stackoverflow.com/a/35054209
possible better answer: http://stackoverflow.com/a/28146507
has answer: http://stackoverflow.com/a/28146507
answer count: 4
type: AnsweredQuestion
tagged with: text-editor
has body: I would like to ask you a question about tejquery text editor, I would like to clear data from text editor after Ajax respond success. I have tried to use code below but it still not work, so could anyone help me. HTML : &lt;div class="container"&gt; &lt;input type="text" class="website-header" /&gt; &lt;textarea name="textarea" class="jqte-test website-desc"&gt;&lt;/textarea&gt; &lt;input type="button" name="bu" value="Save" id="btn-for-website-video-url" /&gt; &lt;/div&gt; Here is an jquery code with ajax : $("#btn-for-website-video-url").on("click",function(){ var website_desc = $(".website-desc").val(); var website_header = $(".website-header").val(); $.ajax({ url : "php/respon_result.php", type : "POST", dataType: "json", data : { header : website_header , desc : website_desc }, success : function(data){ // clear data in text editor $('.website-desc').val(''); }, error : function(data){ alert('Error log'); } }
linked to: http://stackoverflow.com/q/2078146
has answer: http://stackoverflow.com/a/30243830
type: Question
has title: How to clear value in tejquery text editor using jquery or javascript
tagged with: javascript
tagged with: jquery

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/28274887
tags question: http://stackoverflow.com/q/28167313
tags question: http://stackoverflow.com/q/28202779

http://stackoverflow.com/q/28129656
type: Question
has body: The documentation at http://getfuelux.com/javascript.html#tree doesn't give good example about how to use Javascript Datasource. I have read a lot of other questions on StackOverflow about it, but most of them are old (still use name instead of text). Can anyone help me with the dataSource and callback usage? Here is my current code: HTML: Javascript: None exception is printed in the console, but the ul is still blank, and if I change ul into div, the result was still the same. Can you please give me an example?
answer count: 2
tagged with: javascript
tagged with: jquery
has title: FuelUX Tree dataSource not working?
score: 0
has answer: http://stackoverflow.com/a/28155733
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: tree
has answer: http://stackoverflow.com/a/28342886
tagged with: fuelux

http://stackoverflow.com/q/28198750
type: AnsweredQuestion
type: Question
has title: Asynchronous Angular Promise and Variable Initialization
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44764155
score: 0
accepted answer: http://stackoverflow.com/a/28199264
tagged with: asynchronous
tagged with: angularjs
has body: I have a factory that looks like such: app.factory('thingFactory', function($http) { var factory = {}; var things = []; factory.refreshThings = function() { return $http.post('/GetThings'); } factory.initializeThings = factory.refreshThings() .then(function(response) { things = response.data; }, function(response){ // some error handling code here... }); factory.getThings = function() { return things; } return factory; } and a controller app.controller('myController', function($scope, thingFactory) { $scope.things = thingFactory.getThings(); } Because of the asynchronous nature of promises, and other collections being initialized (in addition to things), should I be concerned with getThings() returning an empty array, and thus, returning before the $http.post() call has resolved? Is this a better alternative? app.controller('myController', function($scope, thingFactory) { $scope.things = [] thingFactory.initializeThings .then(function(response) { $scope.things = response.data; }, function (response) { // some error handling code here... }); } Is there a safe alternative, where I can get the controller to not think about the promise and just safely get the collection from the factory?
tagged with: angular-promise
has answer: http://stackoverflow.com/a/28199264

http://stackoverflow.com/a/28143236
type: Answer
has body: You can use delay() to offset each animation. delay() will get put into each elements animation queue. var duration = 2000; $.each(['foo','bar','baz'], function(i, item){ $('#'+item).text(item).hide().delay( i * duration).fadeIn(duration) }); Reference: delay() docs DEMO
answers question: http://stackoverflow.com/q/28143151
score: 0

http://stackoverflow.com/q/28205419
favorite count: 0
possible better answer: http://stackoverflow.com/a/28205891
downvote count: 1
upvote count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28205891
has title: Darken Image Slider/Button -- Javascript
has answer: http://stackoverflow.com/a/28205976
score: -1
accepted answer: http://stackoverflow.com/a/28205976
type: Question
answer count: 2
has body: I have a webpage in which users upload an image of some hand written work. Sometimes it's scanned pencil which can be very difficult to read. Is it possible to possible to have a slider/button that I could use to darken or maybe even sharpen a particular image? I would need a slider/button per image as the page I view contains several user uploaded images. Thanks.
tagged with: javascript

http://stackoverflow.com/q/28179563
has body: var _ = require('ramda'); var obj1 = { innerNum: 1, innerObj: { innerStr: 'a', innerStrB: 'Z' } }; var obj2 = { innerNum: 2, innerObj: { innerStr: 'b' } }; var mixedObj = _.mixin(obj1, obj2); mixedIObj does not include the inner object's innerStrB. Any ramda solution?
tagged with: node.js
has answer: http://stackoverflow.com/a/28224416
accepted answer: http://stackoverflow.com/a/28224416
type: Question
type: AnsweredQuestion
tagged with: ramda.js
has title: Ramda does not provide deep mixin?
tagged with: functional-programming
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/a/28229621
has comment: http://stackoverflow.com/comment/130276316
has comment: http://stackoverflow.com/comment/137436664
answers question: http://stackoverflow.com/q/28229424
has body: In the second file, require the first one: --- two.js --- require("./one") or if you are using ES modules: --- two.js --- import "./one" Mocha will run the tests in the order the describe calls execute.
has comment: http://stackoverflow.com/comment/52270994
downvote count: 1
has comment: http://stackoverflow.com/comment/65481074
has comment: http://stackoverflow.com/comment/130275393
has comment: http://stackoverflow.com/comment/64894840
upvote count: 71
has comment: http://stackoverflow.com/comment/65477654
score: 70
has comment: http://stackoverflow.com/comment/124415972
type: Answer

http://stackoverflow.com/comment/44630224
type: AnswerComment
score: 0
type: Comment
has text: retVal = this.findParent(val, curr.left); // this.findParent isn't defined. That's because of scope issues ... - you need to make sure that this function can be accessed.
comment on: http://stackoverflow.com/a/28127105

http://stackoverflow.com/comment/44645506
has text: It could be worth noting that settings will be changed by those calls, and would therefore be 'tainted' for any later usage. It may not make a difference, but if settings should be kept as-is, `$.extend({},settings,{content:''})` could be beneficial as it will copy the settings object and not edit it directly
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28136864

http://stackoverflow.com/comment/44816299
type: Comment
comment on: http://stackoverflow.com/a/28226423
has text: Welp, It finally worked... I did exactly what you did, except I had to take the quotation marks and brackets from the ngs-show value. I did try this before, but didn't try getting the brackets off, and the quotation marks too... go figure. Well, thank you.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44733258
has text: @rosscowar It's true. But if you're going to do that you should probably also use `100 * parseFloat(userInput)` since you want to avoid the auto coercion caused by the `*` operator
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28181967
score: 0

http://stackoverflow.com/a/62073784
has comment: http://stackoverflow.com/comment/137530516
upvote count: 2
has comment: http://stackoverflow.com/comment/133911964
answers question: http://stackoverflow.com/q/28222228
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/137533584
has comment: http://stackoverflow.com/comment/109806272
downvote count: 0
has body: Based documentation on mozilla.org and taking into account side effects of Use of the new operator and that page we could try to do something like: function isArrow (fn) { if (typeof fn !== 'function') return false try { new fn() } catch(err) { if(err.name === 'TypeError' &amp;&amp; err.message === 'fn is not a constructor') { return true } } return false } console.log(isArrow(()=&gt;{})) // true console.log(isArrow(function () {})) // false console.log(isArrow({})) // false console.log(isArrow(1)) // false let hacky = function () { throw new TypeError('fn is not a constructor') } console.log(isArrow(hacky)) // unfortunately true

http://stackoverflow.com/q/28147280
has comment: http://stackoverflow.com/comment/44688251
answer count: 0
has comment: http://stackoverflow.com/comment/44681827
type: Question
has body: I'm trying to make a custom directive to create a menu where the href value changes depending on the family.id value which I got via service. I'm trying to use that family.id value of each element in ng-repeat to query a new value through a service and change the href depending on that value product.html &lt;ul class="list" custom-href categories="getfamilies"&gt;&lt;/ul&gt; href.js (function(){ var app = angular.module('hrefDirective',['productsService']); app.directive('customHref',['productsService', function(productsService) { return { restrict: 'EA', transclude: false, scope: { categories: '=' }, template: '&lt;li ng-repeat="family in categories"&gt;&lt;p&gt;&lt;a ng-bind="family.name" ng-href="{{newHref}}"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;', link : function($scope,$element, $attrs){ productsService.finalFamilies(family.id).then(function(data){ if(data == 0){ $scope.newHref = '#/product/'; }else{ $scope.newHref = '#/product/{{family.id}}'; } }); } }; }]); })(); products.js (function(){ var app = angular.module('productosController',['productsService']); app.controller('ProductsFamiliesController', function($scope, productosService){ productsService.getFamilies().then(function(data){ $scope.getfamilies = data.data; }); }); })(); services.js (function(){ var app = angular.module('productsService',[]); app.factory('productsService', ['$http','$location', function($http, $location){ var webServiceUrl = 'my url' var products = []; products.getFamilies = function(){ return $http.get(webServiceUrl+'getFamilies'); }; products.finalFamilies = function(idFamily){ return $http.get(webServiceUrl+'getFinalFamiles?id'+ idFamily); }; return products; }]); })(); Of course is not working...any clues...? plnkr.co/edit/3N19E0KyeWW7wvsLOlkk?p=info
has comment: http://stackoverflow.com/comment/44666174
has title: Angular service into directive through ng-repeat
score: 0
has comment: http://stackoverflow.com/comment/44668783
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44677381
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44668137

http://stackoverflow.com/q/28122499
tagged with: google-api
tagged with: geolocation
tagged with: php
has answer: http://stackoverflow.com/a/28122777
has body: I have created an app with and as part of data collection I would like to capture the user's current location when they access the app and website using php. Ideally, I want to make this as simple as possible. Currently, I have the following script, but it has a default address in it: $fullurl = "http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;sensor=true"; echo $json; $string .= file_get_contents($fullurl); // get json content $json_a = json_decode($string, true); //json decoder echo $json_a['results'][0]['geometry']['location']['lat']; // get lat for json echo $json_a['results'][0]['geometry']['location']['lng']; // get ing for json I would like the current location of the user to take the place of 1600 Amphitheater Parkway, Mountain View, CA. Any help is extremely appreciated.
type: AnsweredQuestion
downvote count: 0
tagged with: reverse-geocoding
has comment: http://stackoverflow.com/comment/44619192
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/59315027
tagged with: javascript
score: 4
has title: How to get a User's Current Location Using Google Geocode API and PHP
favorite count: 0
has comment: http://stackoverflow.com/comment/44619264
has answer: http://stackoverflow.com/a/59315027
upvote count: 4
accepted answer: http://stackoverflow.com/a/28122777
linked to: http://stackoverflow.com/q/3397585

http://stackoverflow.com/a/28131465
score: 1
has comment: http://stackoverflow.com/comment/44636294
has comment: http://stackoverflow.com/comment/44636239
has comment: http://stackoverflow.com/comment/44636081
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44636472
type: Answer
has comment: http://stackoverflow.com/comment/44636456
accepted answer of: http://stackoverflow.com/q/28131447
has body: When you specify a controller for a route, it should be the name of the controller (as a string), not a reference to a controller function. $routeProvider .when('/billing', { templateUrl: 'components/billing/billing.html', controller: "BillingCtrl" }) (Notice the quotes around BillingCtrl)
answers question: http://stackoverflow.com/q/28131447
downvote count: 0
has comment: http://stackoverflow.com/comment/44636063

http://stackoverflow.com/q/28132674
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28132695
score: 7
favorite count: 0
has title: Angular JS ng-switch with ng-include?
tagged with: angularjs
type: Question
upvote count: 7
answer count: 1
has body: I have 3 different code fragments which I'd like to swap out depending on the selection in a select menu. It works if I include the code inline, but when I try to use ng-includes like this, I get an Angular error and the app fails: What am I doing wrong here? Does ng-switch not work with ng-includes?
has answer: http://stackoverflow.com/a/28132695
tagged with: angularjs-directive
downvote count: 0

http://stackoverflow.com/a/28255863
has comment: http://stackoverflow.com/comment/44871179
has comment: http://stackoverflow.com/comment/44870343
has body: To get your container div as String you shoud use innerText or innerHTML. As Follows : var asText = document.getElementById('container').innerText; var asHTML = document.getElementById('container').innerHTML; If you get a null answer without using any methods it means either your div doesn't exist or not is loaded. Edit : Don't forget to specify in the manifest.json file at which time your javascript should be executed. You can do this by using the run_at parameter. manifest.json { "name": "The name of your extension", "version": "0.0.1", "manifest_version": 2, "description": "Your description goes here", "homepage_url": "http://example.com/", "content_scripts": [ { "run_at": "document_end", "all_frames": false, "matches": [ "*" ], "js": [ "*" ] } ], "web_accessible_resources": [ "*" ], "permissions": [ "storage" ] }
has comment: http://stackoverflow.com/comment/44870669
has comment: http://stackoverflow.com/comment/44870625
downvote count: 0
answers question: http://stackoverflow.com/q/28255781
has comment: http://stackoverflow.com/comment/44870195
type: Answer
has comment: http://stackoverflow.com/comment/44870119
has comment: http://stackoverflow.com/comment/44870228
has comment: http://stackoverflow.com/comment/44870601
has comment: http://stackoverflow.com/comment/44870095
has comment: http://stackoverflow.com/comment/44870773
upvote count: 1
has comment: http://stackoverflow.com/comment/44870578
has comment: http://stackoverflow.com/comment/44870698
has comment: http://stackoverflow.com/comment/44870171
score: 1

http://stackoverflow.com/comment/44746850
type: QuestionComment
type: Comment
has text: Please the link. It would be great if you create a fiddle for it.
comment on: http://stackoverflow.com/q/28169249
score: 0

http://stackoverflow.com/comment/44879064
comment on: http://stackoverflow.com/a/28260746
has text: @Xotic750 what do you mean with "not all whitespaces"? I tried lots of spacing scenarios (tabs, empty lines, spaces, and combined) https://www.regex101.com/r/yX5pS1/3
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44731973
type: QuestionComment
has text: it's no duplicate. read.
comment on: http://stackoverflow.com/q/28180683
score: 0
type: Comment

http://stackoverflow.com/q/28199611
accepted answer: http://stackoverflow.com/a/28199942
has comment: http://stackoverflow.com/comment/44765895
has comment: http://stackoverflow.com/comment/44766078
has title: PHP string to Javascript compatible (quotes)
tagged with: javascript
has comment: http://stackoverflow.com/comment/44765648
score: 0
has comment: http://stackoverflow.com/comment/44765673
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44766262
linked to: http://stackoverflow.com/q/13938645
has comment: http://stackoverflow.com/comment/44765609
has body: I am trying to insert some Options to select which are taken from DB and are being placed also to a jQuery code. I used json_encode, but that did not fix all the problems. Basically, the / are escaped and there are only single quotes, which is good, but it places double quote at the start and at the end of the string: Sample code that I see in console: " "+ "Article categories:"+ " "+ " " Random<\/option>\n" "+ " "+ With this error code in console: Uncaught SyntaxError: Unexpected identifier This is the jQuery code in PHP file itself: var options4 = { dataType: 'json', success: function(output) { $("... BLA BLA BLA .... 40 lines of code....."+ " "+ "Article categories:"+ " "+ " <?php echo json_encode($art_catlist); ?> "+ " "+ "Bla bla bla .... another 20 lines of code"+ " ").insertBefore("#new_background_header"); Some more jQuery code...... } Does somebody have idea why that happens? This code creates the list of options (it has to be usable in PHP too, so cant really change it a lot): while ($data = dbarray($result)) { $art_catlist .= " ".$data['article_cat_name']." \n"; } Screen from console: Ps.: Why you remove Hi at the start of the message? Wanted to say Hi and thanks for every help. Now it seems that I am being rude :(
has comment: http://stackoverflow.com/comment/44766053
has answer: http://stackoverflow.com/a/28199942
tagged with: php
has comment: http://stackoverflow.com/comment/44765982
has comment: http://stackoverflow.com/comment/44766009
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44765743
has comment: http://stackoverflow.com/comment/44766047
has comment: http://stackoverflow.com/comment/44765841
has comment: http://stackoverflow.com/comment/44765736
type: Question
linked to: http://stackoverflow.com/q/5673269

http://stackoverflow.com/comment/45127812
comment on: http://stackoverflow.com/q/28275044
has text: Some update: I tried to use code for form based authentication for my basic authentication client page. And basic authentication is bad, because there is no Unicode support, ugly base64 commands come into my code, and I have read that one cannot inform the user that the server got userName and passWord they just entered in their whole glory, but unfortunately the user entered wrong. Instead the message looks like a network hick-up. I do not know what a Google Cloud remote service is. As far as I understand everybody can call my webpage, if they know the password, they can enter data and my q
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44794580
has text: Brilliant, it was exactly what I was thinking but didn't knew how to do it. Thanks :) (will up-vote other answers for the effort)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28215351
type: Comment

http://stackoverflow.com/q/28239467
score: 1
accepted answer: http://stackoverflow.com/a/28239509
has body: I'm in a situation where I want to check if two elements (one is clicked and another one a reference) are the same, what I'm trying to do is: $("#process li").click(function() { currentElement = $(this); referenceElement = $("#process li:first-child"); if (currentElement === referenceElement) { $(".mark").removeClass("mark"); $(this).addClass("mark"); } }); So what I want is to check if the clicked &lt;li&gt; is the first child of the ul#process and if so first remove a .mark class from another element and then add it to the clicked one. I don't get any working result - ideas anyone? UPDATE: Thanks you very much! This is my solution: $("#processlist li").click(function() { currentElement = $(this); if (currentElement.is('li:first-child')) { $(this).addClass("mark"); } }); Now if I click on a , if it is the first child of this list, the class .mark is added - sweet!
answer count: 2
upvote count: 1
has title: Compare Elements via jQuery
tagged with: if-statement
possible better answer: http://stackoverflow.com/a/28239526
has answer: http://stackoverflow.com/a/28239526
has answer: http://stackoverflow.com/a/28239509
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
tagged with: compare

http://stackoverflow.com/q/28251307
has answer: http://stackoverflow.com/a/28258229
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28258229
tagged with: windows-store-apps
answer count: 1
has body: With VisualStudio is possible to make Windows Store Apps with HTML5, but I would like to know if its possible to use .net dlls in this kind of projects.
type: AnsweredQuestion
tagged with: window
has title: Is possible to use dll compiled in .net(C#) in Windows Store Apps with HTML5?
tagged with: javascript
tagged with: visual-studio-2012

http://stackoverflow.com/comment/44762040
type: QuestionComment
has text: I'd just like a circle. That's what I've been trying to create
score: 0
comment on: http://stackoverflow.com/q/28197718
type: Comment

http://stackoverflow.com/comment/44709297
has text: In this case, both of them should work. In other cases, the === is like an ==, but also checks to make sure the type of the items being compared are the same. In most cases, you'll want to use ===. See http://stackoverflow.com/questions/523643/difference-between-and-in-javascript for more info
type: AnswerComment
comment on: http://stackoverflow.com/a/28163010
score: 0
type: Comment

http://stackoverflow.com/comment/44711223
comment on: http://stackoverflow.com/q/28142742
type: Comment
type: QuestionComment
score: 0
has text: Posting the code that submits the form may shed some light on the matter.

http://stackoverflow.com/comment/44663987
type: Comment
type: QuestionComment
has text: So, the problem is a bug in the Editor. Would you like to file a [bug report](https://github.com/mrdoob/three.js/blob/master/CONTRIBUTING.md).?
score: 0
comment on: http://stackoverflow.com/q/28142761

http://stackoverflow.com/q/28151333
tagged with: ember.js
has answer: http://stackoverflow.com/a/28152144
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I'd like to know if it's possible to get the route my ember app is currently transitioning to, from a Ember.Service? The console is available to display it: Attempting transition to users.details so I suppose this is available somewhere? Where can I find this information? Thanks.
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Ember get route currently transitioning to

http://stackoverflow.com/comment/44786956
comment on: http://stackoverflow.com/q/28209509
has text: possible duplicate of [How to print html source to console with phantomjs](http://stackoverflow.com/questions/12450868/how-to-print-html-source-to-console-with-phantomjs)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44904148
type: AnswerComment
has text: Nope, still the same Error "Argument 'MainController' is not a function, got undefined" :(
score: 0
comment on: http://stackoverflow.com/a/28274606
type: Comment

http://stackoverflow.com/q/28275833
favorite count: 0
type: Question
has title: why the submit block is never reached when i click button inside form?
accepted answer: http://stackoverflow.com/a/28275943
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44906388
tagged with: forms
score: -3
has answer: http://stackoverflow.com/a/28275943
downvote count: 4
has body: I am creating a chat application in nodejs. in the index.html file where i set up the interface for the users to send their messages i define the following form: &lt;form id="chat-form" name="chat-form"&gt; &lt;input type="text" name="chat-input" id="chat-input" placeholder="type message"&gt; &lt;br&gt; &lt;input type="submit" value="send"/&gt; &lt;/form&gt; and inside the &lt;head&gt; &lt;/head&gt; tags i use the following script: $('#chat-form').submit(function(e){ console.log("inside the submit"); }); Although this code was expected to work, the submit code is never reached.
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28179086
upvote count: 2
type: UnansweredQuestion
has body: I have a Reflux store which seems to cause an error when triggering an action: var taskStore = Reflux.createStore({ listenables: [taskActions], init: function(){ this.tasks = []; this.index = {}; this.trigger(this.tasks); }, onLoad: function(arr){ var idx = {} arr.forEach(function(ele){ idx[ele.id] = ele }); this.tasks = arr; this.index = idx; this.trigger(arr); } }); When the action load is called and the onLoad method triggers, it fails on the this.trigger method with Chrome saying the error is Uncaught TypeError: Cannot read property 'apply' of undefined The call stack eventually gets me to the Reflux listen method: listen: function(callback, bindContext) { bindContext = bindContext || this; var eventHandler = function(args) { callback.apply(bindContext, args); }, me = this; this.emitter.addListener(this.eventLabel, eventHandler); return function() { me.emitter.removeListener(me.eventLabel, eventHandler); }; }, It's the callback in callback.apply, but it looks like that callback is undefined for some reason . I'm clearly doing something wrong to trigger such a deep error, but I don't know what. Can someone tell me what it is that I'm doing wrong in my store? The code that calls the store calls it like this: var App = React.createClass({ mixins: [ Reflux.connect(taskStore,"tasks"), Reflux.connect(taskIndex, "index"), ], ...
has title: Not triggering React event correctly
has answer: http://stackoverflow.com/a/33820204
has comment: http://stackoverflow.com/comment/44729847
type: Question
answer count: 2
downvote count: 0
tagged with: refluxjs
tagged with: javascript
tagged with: flux
has answer: http://stackoverflow.com/a/28375395
has comment: http://stackoverflow.com/comment/44938317
has comment: http://stackoverflow.com/comment/44727421
favorite count: 0
score: 2

http://stackoverflow.com/comment/44618347
type: AnswerComment
type: Comment
has text: The question implies that the code *is* running after the DOM has finished loading, because "the alert box shows nothing" - that is, the alert does appear, whereas if the DOM hadn't loaded trying to access the `.value` property of a non-existent element would give an error.
comment on: http://stackoverflow.com/a/28122176
score: 3

http://stackoverflow.com/q/28213343
has title: Backbone Subrouter to specific view
tagged with: backbone.js
type: UnansweredQuestion
has body: Is it possible to add a subrouter to a specific view? Lets say I have a Backbone app for multiple Cars. Right now, my Router would look like this carRouter = Backbone.Router.extend({ routes: { '': 'index' 'contact' : 'contact' ':car': 'car', ':car/gallery' : 'cargallery', ':car/specs' : 'specs', ':car/infos' : 'infos', 'about: 'aboutPage' } car: function(){ // do this }, cargallery: function(){ // do this }, specs: function(){ // do this }, infos: function(){ // do this } ...etc }); that approach, obviously makes the whole page render, which I basically want to avoid. When I click on "gallery" and "specs" back and forth for example, the whole page re-renders on each click. So, is it possible to do something like: routes: { 'contact' : 'contact' ':car': 'car', 'about: 'aboutPage' }, car: function(){ // new router containing // ':car/gallery' : 'cargallery', // ':car/specs' : 'specs', // ':car/infos' : 'infos', }, } And then, on the Car page, I would have 3 tabs in the menu (gallery, specs, info), which will load the Model/collection of the specific car, without the page re-rendering? Any help/suggestion is appreciated!
type: Question
has answer: http://stackoverflow.com/a/28215028
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1

http://stackoverflow.com/a/28176387
answers question: http://stackoverflow.com/q/28167867
type: Answer
upvote count: 1
score: 1
has body: I would need to see the tomcat directory structure to be sure that this is the problem, but that index.html page is looking for a webapp in your tomcat webapp directory named: ext-4.2.1.833 In other words, it is expecting something like this: + tomcat |-- bin |-- conf |-- lib |-- logs |-+ webapps |- ext-4.2.1.833 |- HelloWorldApp (or whatever you called your new app) |- manager |- ROOT Is that how you have it set-up?
downvote count: 0

http://stackoverflow.com/a/28240710
answers question: http://stackoverflow.com/q/28235102
score: 0
type: Answer
has body: In server side code you can call an client function... Razor executed in server side and javascript is in client side.that mean when you get server response it's created by razor code in server side and now you can just use javascript in client side

http://stackoverflow.com/comment/44794926
type: Comment
comment on: http://stackoverflow.com/a/28211058
has text: @Kukeltje Hi, Can you please tell me atleast one element on which jquery ui doesnt work. Thanks alot.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44694362
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28161211
has text: Correct, I was hoping I could do it before the append. My actual class is a bit more complex than "rec41" and I was hoping there was a way I would not have to rebuild the class name. I will I will end up using addClass/removeClass Been reading alot about html5 data-js hooks but am not sure I like that option
type: Comment

http://stackoverflow.com/comment/44692986
has text: What makes you think that the `alert()` would show `undefined`? I don't follow your reasoning.
score: 0
comment on: http://stackoverflow.com/q/28160866
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44684444
type: QuestionComment
has text: If you want to know Google's API plans, it is probably best to ask them directly yourself.
comment on: http://stackoverflow.com/q/28154044
score: 0
type: Comment

http://stackoverflow.com/comment/44773078
type: QuestionComment
type: Comment
has text: To use cookies APIs, did you request for permission in your extension manifest? Refer this: https://developer.chrome.com/extensions/cookies
comment on: http://stackoverflow.com/q/28198851
score: 0

http://stackoverflow.com/comment/44828431
type: Comment
type: QuestionComment
has text: Exactly. Also, are you forced to use jsonp?
comment on: http://stackoverflow.com/q/28232794
score: 0

http://stackoverflow.com/a/28170765
score: 1
has comment: http://stackoverflow.com/comment/44710945
has comment: http://stackoverflow.com/comment/44710999
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28170707
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28170707
has body: It looks like you want var set = {}; // it will be cleaner with ES6 Set $.each(arr, function(_,e){ for (var k in e) set[k] = 1; }); $.each(set, function(k){ $.each(arr, function(_,e){ if (e[k]===undefined) e[k] = 0; }); }); Demonstration
has comment: http://stackoverflow.com/comment/44710925
type: Answer
downvote count: 0

http://stackoverflow.com/q/28151709
has answer: http://stackoverflow.com/a/28152638
tagged with: angularjs
upvote count: 1
has body: I needed some datestamp formatting for my Angular UI-Calendar, in the case 2 instances of calender. To catch the date change i was using watchGroup, since the two calendars need same type of formatting. In the end I could not do the same as with two separated $watch for each calender: $scope.$watchGroup(['dt_start', 'dt_end'], function(mydate) { newdate = $filter('date')(mydate, "dd/MM/yyyy"); console.log(newdate); }); output: [Fri Jan 02 2015 00:00:00 GMT+0100 (W. Europe Standard Time), ...] with separated $watch's: $scope.$watch('dt_start', function(mydate) { newdate = $filter('date')(mydate, "dd/MM/yyyy"); console.log(newdate); }); $scope.$watch('dt_end', function(mydate) { newdate = $filter('date')(mydate, "dd/MM/yyyy"); console.log(newdate); }); and I get a dd/MM/yyyy. Am I doing something wrong on the watchgroup expression?
type: AnsweredQuestion
has title: AngularJS datefilter with $watchGroup
score: 1
accepted answer: http://stackoverflow.com/a/28152638
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44676845

http://stackoverflow.com/q/28147213
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: python
possible better answer: http://stackoverflow.com/a/28163926
has body: There is a webpage which have a link "Click to Download" Clicking which a file is downloaded . I can download this file manually by going to webpage and clicking on this link however I need to download this file via a python script . If i see the source i can see the anchor tag is will run a js function Download in csv But i dont know the url of csv file and i am looking for a way to download it via python . I know we can download a file if we have url using httplib but couldnt understand how to get a file without url . Tried few things like in header added 'Content-Disposition': 'attachment;filename="data.csv"'} but it dosent seems to work . Any ideas ?
score: 4
has answer: http://stackoverflow.com/a/28147424
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28147424
has title: downloading a file from a webpage using python script without url , calling onClick function
upvote count: 4
linked to: http://stackoverflow.com/q/18759762
has comment: http://stackoverflow.com/comment/44666437
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44666276
has comment: http://stackoverflow.com/comment/44666244
has comment: http://stackoverflow.com/comment/44666117
linked to: http://stackoverflow.com/q/1176348
favorite count: 0
has answer: http://stackoverflow.com/a/28163926
type: Question

http://stackoverflow.com/a/28234725
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: I can't find the reference but I am fairly sure that some versions of IE do not support indexing strings, you are supposed to use the the charAt function. That being true, in those versions of IE, the for .. in has nothing to iterate over for a string. By converting your string to an array using .split('') and using for .. in on that the code should work in all browsers.
has comment: http://stackoverflow.com/comment/44831350
score: 1
accepted answer of: http://stackoverflow.com/q/28234381
answers question: http://stackoverflow.com/q/28234381

http://stackoverflow.com/a/28149507
score: 1
has comment: http://stackoverflow.com/comment/44677372
downvote count: 0
answers question: http://stackoverflow.com/q/28149206
type: Answer
has body: You can use document.URL or $window.location ie: $rootScope.$on('$routeChangeStart', function(event, next, current) { console.log(document.URL); console.log($window.location) }); Please see demo here http://plnkr.co/edit/oaW40vWewxdZYxRkCW8c?p=preview
upvote count: 1

http://stackoverflow.com/comment/44787918
comment on: http://stackoverflow.com/q/28211831
score: 0
has text: [This](https://github.com/nwjs/nw.js/wiki/Transfer-objects-between-window-and-node) should help you.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28183912
has body: I am wanting to have a group of checkboxes and when they are selected it will add the price to a total field but if there are 2 certain ones checked then the price will need to be different e.g. &lt;input type="checkbox" name="Options[]" title="20"id="Options[]" value="Option 1" /&gt; Option 1 &lt;input type="checkbox" name="Options[]" title="5" id="Options[]2" value="Option 2" /&gt; Option 2 &lt;input type="checkbox" name="Options[]" title="10" id="Options[]3" value="Option 3" /&gt; Option 3 But if Option 2 and 3 are selected then total field should show $12, as in apply a discount Thanks
tagged with: jquery
has comment: http://stackoverflow.com/comment/44736944
type: UnansweredQuestion
has title: Checkbox value totaler
has comment: http://stackoverflow.com/comment/44789462
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/44738022
type: Question
has comment: http://stackoverflow.com/comment/44737002
tagged with: javascript

http://stackoverflow.com/a/28274267
has comment: http://stackoverflow.com/comment/44941240
upvote count: 1
has body: Ive taken the event handler from inline to javascript, Just make the font's you want in css var areatwo=document.getElementById('two'); var areathree=document.getElementById('three'); document.addEventListener('keydown',setFontText); document.addEventListener('keyup',setFontText); function setFontText(){ var textareavalue=document.getElementById('one').value; areatwo.value=textareavalue; areathree.value=textareavalue; } #two{font-family:courier_newregular;} #three{font-family:arialblack; } &lt;textarea id="one"&gt;&lt;/textarea&gt; &lt;textarea id="two"&gt;&lt;/textarea&gt; &lt;textarea id="three"&gt;&lt;/textarea&gt;
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/28274051
type: Answer
has comment: http://stackoverflow.com/comment/44941057

http://stackoverflow.com/q/28125161
has title: AgularJS ng-repeat without repeating parent elements
type: Question
has comment: http://stackoverflow.com/comment/44623957
answer count: 1
tagged with: javascript
has body: What I bassically want to do is the following: I have two columns and I want to fill them with data with a single ng-repeat but without repeating the columns themselves. I think that it may not be possilbe, but I had to try :) ->Start ng-repeat="item in items" -> append {{item.Name}} here -> append {{item.Description}} here ->End ng-repeat
downvote count: 0
has comment: http://stackoverflow.com/comment/44623788
has answer: http://stackoverflow.com/a/28125195
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44623698
score: 2
has comment: http://stackoverflow.com/comment/44624503

http://stackoverflow.com/q/28141392
has comment: http://stackoverflow.com/comment/44654856
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44654621
score: 0
has comment: http://stackoverflow.com/comment/44654414
has comment: http://stackoverflow.com/comment/44654541
possible better answer: http://stackoverflow.com/a/28141585
has comment: http://stackoverflow.com/comment/44654680
has answer: http://stackoverflow.com/a/28141585
has answer: http://stackoverflow.com/a/28141608
has comment: http://stackoverflow.com/comment/44654533
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44654582
has comment: http://stackoverflow.com/comment/44654470
has title: How to make a partially hidden div?
has comment: http://stackoverflow.com/comment/44654846
type: Question
accepted answer: http://stackoverflow.com/a/28141608
has body: I want to make a half shown div in a page, like a footer. When I click it I want it to slide up. The div will contain information on it. I achieved this somehow, but my problem is that the div does not get really hidden it just changes the position. You can find the demo here: http://jsfiddle.net/8ZFMJ/394/ var clicked=false; $(".two").on('click', function(){ if(clicked) { clicked=false; $(".two").css({"bottom": -430}); } else { clicked=true; $(".two").css({"bottom": "-200px"}); } });
answer count: 2

http://stackoverflow.com/q/28269552
has answer: http://stackoverflow.com/a/37496636
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28269705
has title: Show and hide navbar using javascript for scroll and hover functions
accepted answer: http://stackoverflow.com/a/28270824
tagged with: http://stackoverflow.com/tag/html
has body: I am creating a website with twitter bootstrap and for some of the functionality I am using javascript. I have created a navbar which hides when at the top of the page and when scrolled down to a certain point it shows. I then created a function for when the user is at the top of the page they can hover over a transparent div and then unhide the navbar. Here is my scripting: //Navbar Hide On Scroll (function ($) { $(document).ready(function () { // hide .navbar first $(".navbar").hide(); // fade in .navbar $(function () { $(window).scroll(function () { // set distance user needs to scroll before we fadeIn navbar if ($(this).scrollTop() &gt; 100) { $('.navbar').fadeIn(); } else { $('.navbar').fadeOut(); } }); }); }); }(jQuery)); /* Show navbar */ $(function () { $('#shownav').hover(function () { $('.navbar').fadeIn(); }); }); /* when navbar is hovered over it will override previous */ $(function () { $('.navbar').hover(function () { $('.navbar').show(); }, function () { $('.navbar').fadeOut(); }); }); The issue i am having is that I only want the hover function to be active when at the top of the page but when the scroll function is activated I want it to stop as currently when the navbar is shown using the scroll function it disappears when the user hovers on and off the navbar. Can someone help me to put the script right to stop the hover function when the page is scrolled past a certain point ? Thanks Ibrahim
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28270824
has comment: http://stackoverflow.com/comment/44895399
type: Question
possible better answer: http://stackoverflow.com/a/28269705
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/q/28230205
tagged with: mysql
has comment: http://stackoverflow.com/comment/44823017
has answer: http://stackoverflow.com/a/28230274
type: Question
has comment: http://stackoverflow.com/comment/44823151
has answer: http://stackoverflow.com/a/28230492
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/44822996
has title: Bar graph using php and mysql
answer count: 2
tagged with: bar-chart
downvote count: 0
has body: Requirement Bar chart from MySql data , i have working code for static bar chart the code as follows --> &lt;script&gt; var data = [ [0, 11], //London, UK [1, 15], //New York, USA [2, 25], //New Delhi, India [3, 24], //Taipei, Taiwan [4, 13], //Beijing, China [5, 18] //Sydney, AU ]; var dataset = [ { label: "barchart", data: data, color: "#5482FF" } ]; var ticks = [ [0, "London"], [1, "New Mumbai"], [2, "New Delhi"], [3, "Taipei"], [4, "Beijing"], [5, "Sydney"] ]; &lt;script&gt; but for dynamic bar chart data is coming from database and data is in also array format as follows Array ( [0] =&gt; Array ( [product] =&gt; abc [total] =&gt; 21 ) [1] =&gt; Array ( [product] =&gt; xyz [total] =&gt; 1 ) [2] =&gt; Array ( [product] =&gt; pqr [total] =&gt; 13 ) ) how to create bar chart from this data ? or any suggestion?
favorite count: 0
has comment: http://stackoverflow.com/comment/44822937
has comment: http://stackoverflow.com/comment/44823087
possible better answer: http://stackoverflow.com/a/28230492
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/28230274
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44823071

http://stackoverflow.com/q/28267305
score: 3
favorite count: 0
has title: Difference between facade and module pattern
has body: I was going through this article and i am confused on the diff between facade and module pattern. https://carldanley.com/js-facade-pattern/ var MyModule = ( function( window, undefined ) { // revealing module pattern ftw function MyModule() { function someMethod() { alert( 'some method' ); } function someOtherMethod() { alert( 'some other method' ); } // expose publicly available methods return { // in our normal revealing module pattern, we'd do the following: someMethod : someMethod, // in the facade pattern, we mask the internals so no one has direct access by doing this: someMethod : function() { someMethod(); } }; } } )( window ); In both the ways we are actually calling the same function which is private. What big deal does facade provides?.
type: Question
tagged with: design-patterns
upvote count: 3
linked to: http://stackoverflow.com/q/27011043
has comment: http://stackoverflow.com/comment/44892737
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44892650

http://stackoverflow.com/a/28163680
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28163255
answers question: http://stackoverflow.com/q/28163255
type: Answer
has body: This is the element which will change. Change Styles Have a look; I've taken the liberty of adding the rest of the "required" HTML bits and pieces, there (especially the DOCTYPE). You don't need to know what it's there for, right now, but it will solve a lot of problems in the future, if you always include it at the top of every HTML page you write, if you intend real people to use that page (basically, it makes Internet Explorer < IE10 suck less). I've broken this down into bits that are a little more sensible, in terms of real-world JavaScript. In most programming languages, you want to break your code down into smaller bits, to make it easier to read and work with. JavaScript isn't really much different. I have broken apart apart the act of setting the style, into its own helper function el.style.color = "purple"; // takes `el` and makes an el{color:purple} rule The catch here is that any CSS "style" that has a hyphen ("font-size", "background-color") needs to use camelCase, when setting the value in JavaScript. el.style.backgroundColor = "black"; I've created a helper function called style, which I then refer to inside of my window.onload code. In this particular case, I'm not saving a lot, in terms of what I'm typing (in fact, I'm typing more), but what it would be saving me, in a more complex case, is the chance of missing something, in repeating myself, or in copy/pasting... So by calling style(el, "fontWeight", "bold"); I don't have to remember how to set the style for old-browsers, versus new browsers, versus styles that have been set using JS earlier on, versus those that haven't (a topic for people concerned with professional websites that have to work on ancient browsers). If you look inside of the definition for style that I wrote, you'll see that I'm calling el.style[property]; normally, when we know the name of the thing we're looking for, on an object, we use a dot to separate them person.name; //"Bob". In circumstances where we might want to look fo…

http://stackoverflow.com/comment/44780048
comment on: http://stackoverflow.com/q/28207288
has text: Unfortunately, I haven't get it to work. When the page loads the rest call isn't finished, and doesn't evaluate the return.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44846593
type: Comment
has text: Yes, you will need to change that line to ` `
comment on: http://stackoverflow.com/a/28240477
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44644945
has text: if `entity` is `falsy` (null, undefined, 0.... ) assign to entity empty object `{}`
comment on: http://stackoverflow.com/q/28136577
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28163349
type: Answer
has body: You can use new RegExp to construct a regexp from a string, and use join to construct a string from an array. var decimals = ['.015625', '.03125', '.046875', ...]; var regex = new RegExp('^4(' + decimals.join('|').replace(/\./g, '\\.') + ')$'); The elements of decimals need to be strings. If they're numbers, then converting them to strings will add a leading 0 if the number is a fraction, and that will mess up the regexp. If you don't want to do that, you could use Array.prototype.map to call a function on each number that converts it to a string and removes the leading zero.
answers question: http://stackoverflow.com/q/28163149
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/28237848
answers question: http://stackoverflow.com/q/28237695
downvote count: 0
has comment: http://stackoverflow.com/comment/44837036
has body: I think you need postMessage to do this. You can send a message to other window so that you can update both. Maybe: var otherwindow = window.open("htmlfile2.html"); otherwindow.postMessage({ x: x, res: res }, "*"); And in HTML file number 2: window.addEventListener("message", function (ev) { // Update your HTML using ev.data });
type: Answer
has comment: http://stackoverflow.com/comment/44837019
upvote count: 1
score: 1

http://stackoverflow.com/comment/44730068
type: Comment
score: 2
type: AnswerComment
has text: @user61629 You just need to add the `context : theElementYouWant,` to your `$.ajax()` options (for more details you should look in the docs of [jQuery.ajax](https://api.jquery.com/jquery.ajax/) that I have linked) and then the `this` in the callback will refer to the `theElementYouWant`. I can't make an example as i don't know what element `this` should be ;)
comment on: http://stackoverflow.com/a/28179245

http://stackoverflow.com/q/28274841
has answer: http://stackoverflow.com/a/28275051
accepted answer: http://stackoverflow.com/a/28275051
has title: Dynamically Generate Javascript Code from Server - MVC 4
score: 0
possible better answer: http://stackoverflow.com/a/28968701
has comment: http://stackoverflow.com/comment/44905181
has answer: http://stackoverflow.com/a/28968701
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has body: I am using MVC 4 Web Api and I have a requirement to expose a end point which can be consumed by clients to render code on their web page. Something like this ", html); return script; } Any thoughts how this can be achieved. I tried using Response.Write("alert('hello')") but it does not work.
type: Question
tagged with: jsonp
answer count: 2
tagged with: asp.net-web-api
tagged with: javascript

http://stackoverflow.com/q/28181509
has comment: http://stackoverflow.com/comment/44732299
type: Question
has answer: http://stackoverflow.com/a/37922907
answer count: 2
tagged with: javascript
score: 0
has title: Disable Horizontal Scrolling Android
tagged with: android
has body: I have a weird issue with horizontal scrolling to the right I already made html/body width max at 100% and overflow-x hidden no elements outside viewport or negative margins to the right this issue isn't present on desktop meta user-scalable=no horizontal scrolling is set to false for stellar.js Disable horizontal scroll on parallax I honestly can't think of any reason why and this issue is only on android. http://bit.ly/1v0jVlh
tagged with: stellar.js
has answer: http://stackoverflow.com/a/28182527
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44732787
linked to: http://stackoverflow.com/q/23091264
tagged with: css
tagged with: horizontal-scrolling

http://stackoverflow.com/comment/44861698
type: QuestionComment
has text: Looks like the Web Essentials logo?
comment on: http://stackoverflow.com/q/28250885
score: 1
type: Comment

http://stackoverflow.com/q/28239157
has body: Normally altering a reference to an object/array, alters the object and vice versa. var someArr = [{letter: 'a'}, {letter: 'b'}, {letter: 'c'}]; var test = someArr[1]; test.letter = 'k'; // or // someArr[1].letter = 'k' console.log(test.letter); // outputs k console.log(someArr[1].letter); // outputs k A reference to an array index' value (which is an object) won't change if the value of said index changes - e.g. if the value is removed via splice, the reference won't point to the new value that took it's place at that index. It still holds the reference to the removed value. Why? var someArr = [{letter: 'a'}, {letter: 'b'}, {letter: 'c'}]; var test = someArr[1]; someArr.splice(1, 1); // remove object with letter b console.log(test.letter); // outputs b &lt;-- Why not c? console.log(someArr[1].letter); // outputs c Here is a JSFiddle http://jsfiddle.net/rf47jyxv/ I don't want to know that it is like that. I know it is like that. I would like to know why it is like that. Why, after splice, is the variable test that holds a reference to someArr[1] different than calling someArr[1] directly?
possible better answer: http://stackoverflow.com/a/28239306
has comment: http://stackoverflow.com/comment/44839796
has answer: http://stackoverflow.com/a/28239306
type: Question
has title: Remove from Array doesn't update reference inside variable?
has answer: http://stackoverflow.com/a/28246089
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44839802
has answer: http://stackoverflow.com/a/28244618
answer count: 3
accepted answer: http://stackoverflow.com/a/28244618
has comment: http://stackoverflow.com/comment/44839687
upvote count: 2
has comment: http://stackoverflow.com/comment/44839662
tagged with: object
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44839761

http://stackoverflow.com/comment/44620316
has text: so how would i do this exactly? i have added my images to the array so how do i display it? Im not that good with Js & Html but i understand it.
comment on: http://stackoverflow.com/a/28123293
score: 0
type: AnswerComment
type: Comment

import
type: Tag
tags question: http://stackoverflow.com/q/28198457
tag name: import

http://stackoverflow.com/comment/64873853
type: AnswerComment
score: 0
type: Comment
has text: This is a great explanation. I don't know if it solves the problem, but I definitely got a lot of value out of it.
comment on: http://stackoverflow.com/a/28230158

http://stackoverflow.com/q/28218800
accepted answer: http://stackoverflow.com/a/28219045
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/44801343
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: New to Angular and need some assistance. I have a block of HTML content that will be coming from a database that will contain a group of widgets. These are simple widgets that will essentially render out various elements, but for the purposes of this question we'll assume they're all basic HTML inside. Those widgets are included in an unpredictable way, so my first thought was to use directives to render the HTML. So, we'd have something like: &lt;div widget data="This is the content."&gt;&lt;/div&gt; So I've got a directive that will place the value of data into the div. Easy enough! Now, how would I go about nesting those widgets? So, how would I get something like: &lt;div widget data="Welcome! "&gt; &lt;div widget data="This is some inside content."&gt;&lt;/div&gt; &lt;/div&gt; to render out: Welcome! This is some inside content. ... because the issue I'm noticing is that if I place anything inside the directive HTML, it essentially gets ignored since it gets replaced with its own result (thus only echoing out Welcome!). I realize I may be going the wrong direction on this in the first place, so any insight would be greatly appreciated. Thanks so much!
has answer: http://stackoverflow.com/a/28219045
tagged with: angularjs
type: AnsweredQuestion
has title: How to dynamically nest directives in AngularJS

http://stackoverflow.com/a/28153292
has body: there is no need to use file readers. if you dont have to support ancient browsers, use FormData code snippet from there: var formData = new FormData(); formData.append("username", "Groucho"); formData.append("accountnum", 123456); // number 123456 is immediately converted to string "123456" // HTML file input user's choice... formData.append("userfile", fileInputElement.files[0]); // JavaScript file-like object... var content = 'hey!'; // the body of the new file... var blob = new Blob([content], { type: "text/xml"}); formData.append("webmasterfile", blob); var request = new XMLHttpRequest(); request.open("POST", "http://foo.com/submitform.php"); request.send(formData);
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28153131
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28153131

http://stackoverflow.com/q/28214834
tagged with: javascript
tagged with: authorization
tagged with: security
score: 0
tagged with: rest
has answer: http://stackoverflow.com/a/28218252
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28218252
has answer: http://stackoverflow.com/a/28214989
has body: I have an application which is wrote with JS frameworks and it makes REST request to RESTful service which I wrote. The problem is that I want to put an authorization. I found OAuth 1.0a and OAuth 2 for using them for that purpose. How can I make a security authorization layer in my REST with public and private key for an example if the client is JS based application ( browser application)?
type: Question
possible better answer: http://stackoverflow.com/a/28214989
tagged with: java
has title: RESTful security authorization
answer count: 2

http://stackoverflow.com/comment/44866840
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28253191
has text: This pattern is useful only if you want to load specific JS assets on specific routes of your app, if you simply want your JS file to be loaded on every client at startup just throw your JS file anywhere under the `client` directory.
score: 0

wsgi
type: Tag
tags question: http://stackoverflow.com/q/28257720
tags question: http://stackoverflow.com/q/28204466
tag name: wsgi

http://stackoverflow.com/q/28252017
favorite count: 0
score: 2
tagged with: angularjs
upvote count: 2
possible better answer: http://stackoverflow.com/a/28252322
tagged with: css
has comment: http://stackoverflow.com/comment/44863154
has title: how to assign a width to span dynamically
type: AnsweredQuestion
type: Question
has body: I am new to html and angularjs. Here I am trying to assign span width dynamically from angular js responce In my Script is $http.get(url).success(function (response) { $scope.names = response; }); my response is [ {"width":"78%"}, {"width":"60%"}, {"width":"50%"} ] I know it is not write,but i don't have any idea.. Thanks in advance
answer count: 2
has answer: http://stackoverflow.com/a/28252247
accepted answer: http://stackoverflow.com/a/28252247
downvote count: 0
has answer: http://stackoverflow.com/a/28252322
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44703070
type: AnswerComment
score: 0
type: Comment
has text: dude does tha works for you?I mean it really clever and nice but this does not work...
comment on: http://stackoverflow.com/a/28166172

http://stackoverflow.com/q/28208378
has body: I am appending a &lt;td&gt; having an input text to a row. I want to get the value of this textbox and use it in another function. Below is the code snippet : row.append($('&lt;td &gt;&lt;input type="text" value=' + item.Marks + ' size="10px" class="marks" id="txtmarks" maxlength="3"/&gt;&lt;/td&gt;')); Thanks in advance.
has comment: http://stackoverflow.com/comment/44782258
has comment: http://stackoverflow.com/comment/44782216
has comment: http://stackoverflow.com/comment/44781698
has comment: http://stackoverflow.com/comment/44781493
has comment: http://stackoverflow.com/comment/44781556
has comment: http://stackoverflow.com/comment/44781474
has comment: http://stackoverflow.com/comment/44781768
has comment: http://stackoverflow.com/comment/44781826
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44782176
upvote count: 1
has comment: http://stackoverflow.com/comment/44782608
has comment: http://stackoverflow.com/comment/44781709
has title: How to get the textbox value which is dynamically added to a table row inside a
score: -1
has answer: http://stackoverflow.com/a/28208426
has comment: http://stackoverflow.com/comment/44781584
type: Question
has comment: http://stackoverflow.com/comment/44781920
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44781552
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44681287
type: QuestionComment
has text: added the full code, pointed out which id's are the problematic ones @Annisaini
comment on: http://stackoverflow.com/q/28154732
score: 0
type: Comment

http://stackoverflow.com/q/28135785
favorite count: 0
has comment: http://stackoverflow.com/comment/61883402
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/54037517
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/54178856
tagged with: iframe
has body: I need serious help. I've programmed a site using a scroll event listener to animate some graphics, depending on how deep the user has scrolled. Works fine on desktop and iOS. Only problem is that this site needs to be embedded in an iFrame. Still works on desktop, but not in iOS. I've set up an example to show illustrate what I mean. Look at this page first on desktop, then on iOS. http://www.webzeile.com/iframescroll/index.html Fixed element (Scroll o meter) is not fixed in iOS and I have no chance to get the scrollTop here. Main page (I have no chance to modify the iframe attributes here) index Iframe content index Content 1 Content 2 Alert scroll top Alert Y offset Scroll o meter: 0 Tried everything. Can't get Scroll handler working on iOS. Any ideas?
has comment: http://stackoverflow.com/comment/44644005
type: Question
tagged with: ios
tagged with: javascript
has title: Scroll event listener not working on iOS in iFrame
tagged with: jquery
has comment: http://stackoverflow.com/comment/44644237
upvote count: 2
linked to: http://stackoverflow.com/q/18753367
has comment: http://stackoverflow.com/comment/61883165
has answer: http://stackoverflow.com/a/35373737
answer count: 1
has comment: http://stackoverflow.com/comment/54177395

http://stackoverflow.com/q/28180547
has comment: http://stackoverflow.com/comment/44731112
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28180731
accepted answer: http://stackoverflow.com/a/28180731
downvote count: 0
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/44730435
score: 1
linked to: http://stackoverflow.com/q/27254735
tagged with: javascript
upvote count: 1
answer count: 1
has title: Add promise result to items in array
favorite count: 0
has comment: http://stackoverflow.com/comment/44731341
has body: What i've been trying to do is add the files and their matching dataurl into objects in an array. Files is a FileList object. I first tried this inside the onloadend event of the Filereader but couldn't access the original file during reading so moved onto promises. var data = []; for(var i = 0; i &lt; files.length; i++){ data.push({ file: files[i], //keep the files for uploading src: readFile(files[i]) // generate the src to offer preview image }); var last = data.length -1; console.log(last); //log a data[last].src.then(function(result){ console.log(last); // log b data[last].src = result // overwrite the src deffered object with the result of the promise }); } readFile is returning a deferred promise, assume this to be working. this is working fine when files has a length of 1 but when files is multiple im having issues with the asynchronous side of things and it only working for the last item. Result of logs based on 2 files (files.length == 2): 0 //log a 1 //log a 1 //log b &lt;-- ignores 0 stays as 1 1 //log b expecting 0101
tagged with: filereader
tagged with: asynchronous

http://stackoverflow.com/a/28226849
accepted answer of: http://stackoverflow.com/q/28226830
answers question: http://stackoverflow.com/q/28226830
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44817141
upvote count: 1
type: AcceptedAnswer
has body: You need to specify the group index number in-order to get the string stored in a particular index. By default .exec function spits out both matches and captures. So that you got, apple:8080 match and 8080 capture. &gt; var string = "apple:8080"; &gt; var reg = /\w*:(\d*)/; &gt; console.log(reg.exec(string)[1].toString()); 8080 Update: Add an extra while loop in-case of more than one substrings was matched. var re = /\w*:(\d*)/g; var str = 'apple:8080 orange:8000'; var m; while ((m = re.exec(str)) != null) { console.log(m[1]); } Output: 8080 8000
type: Answer

closures
tags question: http://stackoverflow.com/q/28277701
tags question: http://stackoverflow.com/q/28193861
tags question: http://stackoverflow.com/q/28254533
tags question: http://stackoverflow.com/q/28243775
tags question: http://stackoverflow.com/q/28225138
tags question: http://stackoverflow.com/q/28124453
tags question: http://stackoverflow.com/q/28187393
tags question: http://stackoverflow.com/q/28167070
tag name: closures
tags question: http://stackoverflow.com/q/28268148
tags question: http://stackoverflow.com/q/28229561
type: Tag
tags question: http://stackoverflow.com/q/28224472
tags question: http://stackoverflow.com/q/28277293
tags question: http://stackoverflow.com/q/28220219

http://stackoverflow.com/q/28175160
type: AnsweredQuestion
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/28175397
tagged with: ionic-framework
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28175397
tagged with: angular-ui-router
has body: I cannot for the life of me wrap my head around this issue; I can't even figure out if it's a problem with AngularUI Router or Ionic itself. I'm trying to accomplish two-way binding (i.e. scope: {data: "="} in the directive definition) with a custom AngularJS directive, it works perfectly as demonstrated by this jsfiddle but the same exact code used in my particular context (i.e.: I navigate through two states before I get to the page with the "Change data" button) doesn't (jsfiddle here). SO prompts me to add some code to go along the jsfiddle links, so here goes the working version. Page: Change data! Script: //JS angular.module("myApp", []) .controller("MyCtrl", ["$scope", function ($scope) { $scope.changeData = function() { console.log("Outside directive:", $scope.signatureData); $scope.signatureData = "hello"; }; }]) .directive("signature", [function() { var directiveDefinitionObject = { template: " Don't mind me, I'm just a template... ", scope: { data: "=" }, controller: ["$scope", "$element", function($scope, $element) { $scope.data = "ciao"; $scope.$watch("data", function(d) { console.log("Inside directive:", d); }); }] }; return directiveDefinitionObject; }]); /* Console output when clicking button: Inside directive: ciao Outside directive: ciao Inside directive: hello */ Same code, though placed into context, in the second fiddle which is far too verbose to paste here (I apologize for that, I already skimmed it as much as possible but it's just to give an understanding of the issue in case it helps). The console output, however, is: /* Console output when clicking button: Inside directive: ciao Outside directive: undefined */
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28187664
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29601032
has title: AngularJS directive two-way binding not working in Ionic
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44719668
has answer: http://stackoverflow.com/a/28187664

http://stackoverflow.com/comment/44695735
type: AnswerComment
has text: @AaronDufour: Yup, it's not called `myInefficientHashFunction` for nothing. :) However, note that you need to pay attention to what you are memoising; if your hash function is doing more work than the function you are trying to memoise, you shouldn't do it. Thus, you should be handcrafting your hash function to be as simple as possible while still being unique on the domain of your memoised function.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28162116

http://stackoverflow.com/a/28223585
answers question: http://stackoverflow.com/q/28222963
type: Answer
accepted answer of: http://stackoverflow.com/q/28222963
upvote count: 2
has body: My Javascript is ropey but I guess this is how I would do it: function getAddress(results) { if(results &amp;&amp; results.length) { for (var i=0; i&lt;results.length; i++) { if (results[i].types.indexOf('neighborhood') != -1) { return results[i].formatted_address; } } return results[0].formatted_address; } return ''; }
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44821087

http://stackoverflow.com/comment/44898812
has text: @rafael: ok, i just give the example just for simplication. but I dont think so if the data can't be submitted anyway. We can still use jquery each() function right to get the question text and choises? but I dont know how to store them in array and then submit via ajax.
comment on: http://stackoverflow.com/q/28271387
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28183500
has body: BLE Chrome API not yet implemented on OSX or Windows. Keep waiting. Too bad the Chrome Bluetooth API has no mention of supported OS's. It got my hopes up too.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28145217
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28145217
has comment: http://stackoverflow.com/comment/73071043
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/73207288
has comment: http://stackoverflow.com/comment/73197954

http://stackoverflow.com/a/28190879
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44749959
downvote count: 0
has body: Wouldn't be this oneliner simpler? "folder_photos_today_12".replace(/_[0-9]+/g,"").replace(/_/g," "); http://jsfiddle.net/sf2p4yua/ Here are some explanations: .replace(/_[0-9]+/g,"") replaces the combination of underscore and more that one digit after, so you'll have this string folder_photos_today. .replace(/_/g," ") replaces all underscores inside the string: folder photos today.
type: Answer
answers question: http://stackoverflow.com/q/28190496

http://stackoverflow.com/comment/44810592
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28223746
has text: You could use [`:contains`](http://api.jquery.com/contains-selector/), but that doesn't quite give you what you want since it'll search the whole string.

http://stackoverflow.com/comment/44691485
score: 0
type: Comment
type: QuestionComment
has text: do you really need to load the whole body? Are you also reloading the same polling script at the same time (and other scripts)?
comment on: http://stackoverflow.com/q/28159887

http://stackoverflow.com/q/28245298
score: 1
has title: Javascript the Good Parts Closure Syntax in the First Example
favorite count: 0
type: Question
upvote count: 2
has body: The Closure section of chapter 4 has the following example. var myObject = (function() { var value = 0; return { increment: function(inc) { value += typeof inc === 'number' ? inc : 1; }, getValue: function() { return value; } } }()); Why is the function wrapped in an extra set of parenthesis? I've tested it without the parenthesis and the behavior is the same. Am I missing something here, or am I taking this too literally?
downvote count: 1
linked to: http://stackoverflow.com/q/6645766
linked to: http://stackoverflow.com/q/111102
answer count: 0
has comment: http://stackoverflow.com/comment/44920928
tagged with: javascript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/6645766

http://stackoverflow.com/comment/44779025
score: 1
type: QuestionComment
has text: place it in an ` ` https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage
type: Comment
comment on: http://stackoverflow.com/q/28206886

http://stackoverflow.com/a/28165189
type: Answer
answers question: http://stackoverflow.com/q/28165054
score: 1
upvote count: 1
has body: There are two problems. First, when you click on the link, the click is bubbling out to the body. So the menu toggles open, then it toggles closed again, so nothing happens. Use event.stopPropagation() to prevent that. Second, when the side menu is closed, &lt;body&gt; is just the one line containing the link. If you want to be able to click anywhere in the window, use $(document) rather than $('body'). $(function () { $('.sidemenu-toggle').on('click', function (event) { event.preventDefault(); event.stopPropagation(); $('.sidemenu').toggleClass('is-visible'); $('body.sidemenu-enabled').toggleClass('sidemenu-open'); $('.sidemenu').toggleClass('sidemenu-open'); }); }); $(document).on('click', function (e) { var opened = $('body').hasClass('sidemenu-open'); if (opened === true) { $('.sidemenu').removeClass('is-visible'); $('body').removeClass('sidemenu-open'); } }); DEMO
accepted answer of: http://stackoverflow.com/q/28165054
has comment: http://stackoverflow.com/comment/44720733
has comment: http://stackoverflow.com/comment/44700921
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28189778
has title: Issue in turn.js page box-shadow and left-margin alignment
type: Question
tagged with: javascript
tagged with: turnjs
downvote count: 0
tagged with: jquery
has body: I am facing problem in page flip turn.js I set the box-shadow for both odd and even page, but odd pages box shadow is display at first execution. At the time of second time page flip box shadow is not visible. For even page not visible at any time. I have set the left-margin of the page but pages is not shifting any more. #flipbook{ width:400px; height:300px; margin-left:100px; } #flipbook .odd{ background:-webkit-gradient(linear, right top, left top, color-stop(0.95, #FFF), color-stop(1, #DADADA)); background-image:-webkit-linear-gradient(right, #FFF 95%, #C4C4C4 100%); background-image:-moz-linear-gradient(right, #FFF 95%, #C4C4C4 100%); background-image:-ms-linear-gradient(right, #FFF 95%, #C4C4C4 100%); background-image:-o-linear-gradient(right, #FFF 95%, #C4C4C4 100%); background-image:linear-gradient(right, #FFF 95%, #C4C4C4 100%); -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; -o-box-shadow:inset 0 0 5px #666; -ms-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px red; } Where I am doing wrong? JSFiddle
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
answer count: 0

http://stackoverflow.com/a/28184009
has comment: http://stackoverflow.com/comment/44737295
answers question: http://stackoverflow.com/q/28183907
has body: No, they are not shared. From the spec on Regular Expression Literals: A regular expression literal is an input element that is converted to a RegExp object (see 15.10) each time the literal is evaluated. Two regular expression literals in a program evaluate to regular expression objects that never compare as === to each other even if the two literals' contents are identical. However, this changed with ES5. Old ECMAScript 3 had a different behavior: A regular expression literal is an input element that is converted to a RegExp object (section 15.10) when it is scanned. The object is created before evaluation of the containing program or function begins. Evaluation of the literal produces a reference to that object; it does not create a new object. Two regular expression literals in a program evaluate to regular expression objects that never compare as === to each other even if the two literals' contents are identical. This was supposed to share the compilation result of the regex engine across evaluations, but obviously led to buggy progams. You should throw your book away and get a newer edition.
type: Answer
upvote count: 5
score: 5
downvote count: 0

http://stackoverflow.com/a/29687769
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28259236
accepted answer of: http://stackoverflow.com/q/28259236
score: 0
has body: In case anyone is wondering this was simply a slight lack of JQM experience. Disabling ajax on the form solved the problem ()

http://stackoverflow.com/q/28274738
type: Question
tagged with: javascript
tagged with: printing
tagged with: windows
downvote count: 0
has body: What is the simplest way to provide the Print function when developing (a) a web application using PHP, and (b) a Windows application using Visual C++ or C#, so that the contents in a specific area of the window can be printed out by a printer, or converted to .ps or .pdf file format if a PostScript or PDF writer is already installed? For web application I have read using JavaScript, which is acceptable for me, but the most important issue is to avoid shifting of words or graphics in the printout when compared with the layout being shown in the window area. Just some start-up pointers will be good enough for me, since I am not asking for specific code solution. I am not sure if this is actually the same as writing virtual printer driver, so pardon me if I am repeating the question.
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44904297
upvote count: 1
tagged with: php
tagged with: visual-studio
score: 1
has title: How to print window contents, and how to avoid the layout being shifted?

http://stackoverflow.com/q/28243258
tagged with: firefox
answer count: 1
tagged with: javascript
tagged with: backbone.js
score: 0
tagged with: events
has comment: http://stackoverflow.com/comment/44847891
has comment: http://stackoverflow.com/comment/44851615
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44860168
has comment: http://stackoverflow.com/comment/44848918
has title: Backbone click event not working correctly in firefox
has answer: http://stackoverflow.com/a/28249436
type: Question
has body: This code executes perfectly in safari and chrome but has problems with Firefox. Basically, I have a group of radio buttons. This click event should only be fired if the radio button has an attribute of checked. However for some reason, the radio button in firefox seems to fire the event even when the radio-button is not checked. var MyView = Backbone.View.extend({ events: { 'click input[type="radio"]:checked' : 'radioListener', }, radioListener : function(evt) { var selectedObject = evt.currentTarget; $(selectedObject).prop('checked', false); $(selectedObject).val(''); $(selectedObject).change(this.clearSelection(evt)); } });

http://stackoverflow.com/comment/45008487
score: 0
comment on: http://stackoverflow.com/q/28249808
type: QuestionComment
type: Comment
has text: What browser? Either it works as expected in my ones or I just don't understand the question.

http://stackoverflow.com/a/49671541
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/86356747
answers question: http://stackoverflow.com/q/28251644
has comment: http://stackoverflow.com/comment/86391501
downvote count: 0
has comment: http://stackoverflow.com/comment/86369691
has body: function owlInitialize() { if ($(window).width() &lt; 1024) { $('#carousel').owlCarousel(); }else{ $('#carousel').owlCarousel('destroy'); } } $(document).ready(function(e) { owlInitialize(); }); $(window).resize(function() { owlInitialize(); }); Working Fiddle: https://jsfiddle.net/j6qk4pq8/187/
type: Answer

http://stackoverflow.com/comment/44834695
type: Comment
has text: It's close but the thing that did not work is the test6 and test7 aren't devided
type: AnswerComment
comment on: http://stackoverflow.com/a/28236646
score: 0

http://stackoverflow.com/a/28201603
accepted answer of: http://stackoverflow.com/q/28201490
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28201490
has body: You can set line-height to the height of the container, or you can use the transform trick to vertically center your &lt;h1&gt;: li .over h1 { position: absolute; left: 0; top: 50%; // 50% of the parent width: 100%; transform: translateY(-50%); // -50% of the child } Source: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
score: 2
downvote count: 0

http://stackoverflow.com/q/28264993
has comment: http://stackoverflow.com/comment/44886742
has comment: http://stackoverflow.com/comment/44886788
has comment: http://stackoverflow.com/comment/44887047
has answer: http://stackoverflow.com/a/28265024
type: Question
has title: window.open doesn't Open a Window
has comment: http://stackoverflow.com/comment/44886759
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44886816
has comment: http://stackoverflow.com/comment/44886701
tagged with: window.open
has comment: http://stackoverflow.com/comment/44886693
has comment: http://stackoverflow.com/comment/44886752
score: 0
has body: The following markup is generated by my ASP.NET MVC page. &lt;button onclick="window.open='/Client/ReleaseForm';" type="button" class="btn btn-primary"&gt; View/Print Release Form &lt;/button&gt; However, clicking the button has no effect. No window is opened, no new tabs are opened, and no errors are shown in the console of my Chrome browser. I know there are pop-up blockers, but I had got the impression that this worked as long as it was in response to a user action (such as clicking the button). Can anyone tell me how I can display content in a new window?
has comment: http://stackoverflow.com/comment/44886934
has comment: http://stackoverflow.com/comment/44886705
has comment: http://stackoverflow.com/comment/44886696
accepted answer: http://stackoverflow.com/a/28265024
has comment: http://stackoverflow.com/comment/44886728
has comment: http://stackoverflow.com/comment/44886709
type: AnsweredQuestion

http://stackoverflow.com/a/28268956
answers question: http://stackoverflow.com/q/28268901
type: AcceptedAnswer
downvote count: 0
has body: Change to += instead of = and start the for loop with 1 unless you want to print out as loop 0, loop 1 and so on... document.getElementById("content").innerHTML += "Loop: " + i + "&lt;br&gt;"; var amount = prompt("How many list items would you like?"); if(isNaN(amount) || amount &lt; 1) { alert("Please enter a positive whole number"); } else { for(i = 1; i &lt;= amount; i++) { document.getElementById("content").innerHTML += "Loop: " + i + "&lt;br&gt;"; } } &lt;div id="content"&gt;&lt;/div&gt;
type: Answer
accepted answer of: http://stackoverflow.com/q/28268901
upvote count: 1
score: 1

http://stackoverflow.com/q/28123596
has answer: http://stackoverflow.com/a/28123613
has comment: http://stackoverflow.com/comment/44643792
has body: if I set a prototype value and make two instances then update the prototype value in one instance now other instance prototype value does not update, why? code is var A = function() { } A.prototype.u = 2; var a = new A(); var b = new A(); a.u = 4 alert(a.u) // 4 alert(b.u) // 2 it's so unreasonable, it's prototype value not this value. right?
answer count: 1
has title: prototype value does not update for every instance in js, why?
favorite count: 0
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44643377
downvote count: 0
has comment: http://stackoverflow.com/comment/44620870
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/28123613
has comment: http://stackoverflow.com/comment/44643951
tagged with: javascript

http://stackoverflow.com/q/28256440
type: UnansweredQuestion
has title: What happens when an iPhone/iPad keyboard is shown/closed in Safari?
answer count: 0
has comment: http://stackoverflow.com/comment/44871395
has body: I'm trying to understand what happens after the "Done" button is clicked on the iPhone/iPad keyboard when viewing a webpage in Safari, specifically what events are fired. From what I can gather so far, the text box that was selected loses it's focus. Is this all that happens, or does the whole window lose it's focus? I'm also interested to know if the showing of the keyboard causes any resize events to be fired?
has comment: http://stackoverflow.com/comment/44871183
type: Question
tagged with: ios
has comment: http://stackoverflow.com/comment/44871326
tagged with: javascript
tagged with: mobile-safari
score: 0

http://stackoverflow.com/a/28242406
score: 0
has comment: http://stackoverflow.com/comment/44848098
has comment: http://stackoverflow.com/comment/44846418
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44847535
has comment: http://stackoverflow.com/comment/44846149
type: Answer
has comment: http://stackoverflow.com/comment/44848640
has comment: http://stackoverflow.com/comment/44847032
accepted answer of: http://stackoverflow.com/q/28224543
has comment: http://stackoverflow.com/comment/44846861
has comment: http://stackoverflow.com/comment/44847561
answers question: http://stackoverflow.com/q/28224543
has comment: http://stackoverflow.com/comment/44847758
has body: Here is the new insert.php. I added the badword filter, switched it over to using mysqli (which will prevent sql injection) and secured it a little. &lt;?php session_start(); $uname = $_SESSION['username']; $msg = $_REQUEST['msg']; $db = new mysqli("localhost", "user", "pass", "chat"); if($db-&gt;connect_errno &gt; 0){ die("Unable to connect to database: " . $db-&gt;connect_error); } //the list of words to check. $badWordList = array( 'test1', 'test2' ); //loop over each bad word foreach($badWordList as $k=&gt;$bad){ //clean up the bad word for use in a regex $pattern = '/\b'.preg_quote($bad).'\b/i'; //replace each bad word $msg = preg_replace($pattern, str_repeat('*', strlen($bad)), $msg); } //call html entities to prevent html from being entered $msg = htmlentities($msg, ENT_QUOTES); //create a prepared statement $stmt = $db-&gt;prepare("INSERT INTO logs (`username` , `msg`) VALUES (?,?)"); //bind the username and message $stmt-&gt;bind_param('ss', $uname, $msg); //run the query to insert the row $stmt-&gt;execute(); //get all the entries from `logs` if($result = $db-&gt;query("SELECT `username`,`msg` FROM `logs` ORDER by `id` ASC")){ //loop over the result and echo out the chat while($row = $result-&gt;fetch_assoc()){ echo "&lt;span class='uname'&gt;" . $row['username'] . "&lt;/span&gt;: &lt;span class='msg'&gt;" . $row['msg'] . "&lt;/span&gt;&lt;br&gt;"; } } else { die("There was an error retrieving the chat records: " . $db-&gt;error); } Some notes: This will find bad words in a case sensitive manner so if you were looking for "foo", it will find "FOO" or "Foo" or "fOo". It is using a boundary match so it will match the whole word only. If you were looking for "foo", it would not match "food". Keep this in mind as it will also not match a plural version of a bad word. If you remove the \b boundary characters from the pattern then "food" will become "***d". Up to you how want to handle it. It is easy to bypass. You can substitute characters ("f00" with zeroes), …

http://stackoverflow.com/comment/44757899
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28193321
has text: And by errors I don't mean code errors, I mean input errors.

database
tags question: http://stackoverflow.com/q/28254253
tags question: http://stackoverflow.com/q/28157617
type: Tag
tags question: http://stackoverflow.com/q/28207744
tag name: database
tags question: http://stackoverflow.com/q/28222480
tags question: http://stackoverflow.com/q/28200083
tags question: http://stackoverflow.com/q/28172527
tags question: http://stackoverflow.com/q/28205869
tags question: http://stackoverflow.com/q/28238899

http://stackoverflow.com/comment/44725438
type: QuestionComment
has text: this one needs a jsfiddle
comment on: http://stackoverflow.com/q/28178120
type: Comment
score: 0

http://stackoverflow.com/a/28192901
type: AcceptedAnswer
has body: Your convColors is being called with objects, not numbers. You need an accessor function like the one you used to compute the max value. .style('fill', function (d) { return convColors(d.conversion); });
downvote count: 0
answers question: http://stackoverflow.com/q/28192560
accepted answer of: http://stackoverflow.com/q/28192560
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28162935
has comment: http://stackoverflow.com/comment/44700571
has comment: http://stackoverflow.com/comment/44700660
has answer: http://stackoverflow.com/a/28165563
has body: I am using ADF technology for my website. But for a single select table, I am not able to change the on hover background color to a color that I require using CSS. Is there any way I can change it using JavaScript?
type: Question
tagged with: javascript
score: 0
answer count: 3
type: UnansweredQuestion
tagged with: oracle-adf
has answer: http://stackoverflow.com/a/28308667
has answer: http://stackoverflow.com/a/28184332
tagged with: css
has title: Forcing different CSS styles to override the existing adf styling

http://stackoverflow.com/comment/44868900
comment on: http://stackoverflow.com/q/28253334
type: Comment
has text: @SameekMishra look at my answer, after parsing, the client end (json2) is the same as your expected output. One thing though, these two json strings contain different data but that is not the main concern here.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44669446
type: Comment
has text: I can not give my class name with it ?
score: 0
comment on: http://stackoverflow.com/a/28149054
type: AnswerComment

http://stackoverflow.com/comment/44887063
has text: It is preferable that you do not input your whole executing code, but rather a [SSCCE](http://www.sscce.org). Please consider updating your code to help others to help you.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28265228
score: 1

http://stackoverflow.com/q/28166854
has answer: http://stackoverflow.com/a/28167007
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I am using the jquery selectmenu plugin to display a nicely style select menu. I have three select menus, all options are hidden in the last two menus, when you select an option from menu one it shows the relevant options in menu two. The same thing happens for menu the two to three. Without the selectmenu plugin this works fine. Unfotunately with the select menu plugin it disapears and doesn't reappear. DEMO http://jsfiddle.net/GXtpC/1525/ $(function(){ $('select').selectmenu({ style:'popup' }); $('.select1').on('change', function () { var parentId = $(this).children(":selected").attr("id"); $('.all-opt').hide(); $('.' + parentId).show(); }); $('.select2').on('change', function () { var parentIdReg = $(this).children(":selected").attr("data-id"); $('.select3-option').hide(); $('.' + parentIdReg).show(); }); }); Fully working without jQuery selectmenu plugin DEMO http://jsfiddle.net/GXtpC/1526/
tagged with: select-menu
has title: hide/show option in select using jQuery UI selectmenu
has answer: http://stackoverflow.com/a/35019146
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44705687
has comment: http://stackoverflow.com/comment/70640720
score: 1
upvote count: 1
tagged with: jquery-ui-selectmenu
type: Question
has answer: http://stackoverflow.com/a/28180639
tagged with: jquery-ui
tagged with: javascript
answer count: 3

http://stackoverflow.com/a/28158912
has comment: http://stackoverflow.com/comment/44690324
type: Answer
answers question: http://stackoverflow.com/q/28157312
has body: In generateUpload you are declaring functions but you don't call them from somewhere. I think you should remove all those functions and have them called from inside generateUpload. For example function generateUpload() { // The Browser API key obtained from the Google Developers Console. var developerKey = 'ID'; // The Client ID obtained from the Google Developers Console. var clientId = 'ID'; // Scope to use to access user's photos. var scope = ['https://www.googleapis.com/auth/photos']; var pickerApiLoaded = false; var oauthToken; // Use the API Loader script to load google.picker and gapi.auth. //just call the function onApiLoad(); //call the rest of your functions } and outside of generateUpload implement the oauthToken function function onApiLoad() { gapi.load('auth', {'callback': onAuthApiLoad}); gapi.load('picker', {'callback': onPickerApiLoad}); }
has comment: http://stackoverflow.com/comment/44689545
score: 0
has comment: http://stackoverflow.com/comment/44691620

http://stackoverflow.com/a/28220628
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44806106
has body: In the past a lot of course material and references emphasized the OO aspects of JavaScript sometimes to the neglect of functional approaches. I think that began to change with the development of frameworks and extensive collections of JS libraries. Secrets of the JavaScript Ninja makes the case that mastering functions is a fundamental part of effectively using JavaScript. In Ninja the definition of a closure is more general: "... closures allow a function to access all the variables, as well as other functions, that are in scope when the function itself is declared." -- "Chapter 5: Closing in on closures" Discussing closures, Effective JavaScript puts it (more or less) this way: a function can refer to variables defined outside of its scope; functions can refer to variables defined by another function after the second function has returned (because in JavaScript functions are objects); a function can contain internal functions that are "closed over" and which can modify properties of the enclosing function. The source code for Effective JavaScript Chapter 2. Item 11 "Get Comfortable with Closures" is on gibhub at: https://github.com/effectivejs/code/tree/master/ch2/item11 The neat thing about an enclosed function is that it doesn't need a name if you don't plan on calling it explicitly: it can be anonymous and simply be evaluated as part of the outer function.
has comment: http://stackoverflow.com/comment/44806271
answers question: http://stackoverflow.com/q/28220219

http://stackoverflow.com/comment/44644570
score: 1
has text: The following may be helpful:http://stackoverflow.com/a/16063711/1641941 under passing (constructor) arguments.
comment on: http://stackoverflow.com/q/28132452
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28133976
has title: How to update a JSF Backing Bean, with data from an SVG element after each move?
has comment: http://stackoverflow.com/comment/44696450
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44656633
has body: I am new to using JSF, and I have an application that uses Prime Faces and SVG. I have multiple SVG rect elements on the screen, each created from values that are passed from my bean up on the server. i.e., #{bean.x},....,. Each element is clickable, and is able to be dragged. When an element is done being dragged and you release the mouse, I would like to fire an event to get the SVG element's id, and update the corresponding x and y in the bean. i.e., drag svg element 52, from 100, 100 to 120, 100, after I release my mouse update array element 52's x and y in my bean to 120,100. I have thought of a couple of ways to do this. Since the values of my SVG elements are passed from my bean, is it possible to bind it so that when the svg element is moved it is automatically updated? My buddy told me it is possible, and that to do this I would have to make a "Custom Component." I'm not sure how to go about that completely, does anyone have any idea if this is the right path or true? If so any advice or help with this? I was adding an onClick to each SVG Element that would fire an ajax call and pass the data to the bean, but I feel this defeats the purpose of JSF to use Javascript(but sometimes we need it, it seems...)? IT seems this would work as well, but not sure if this is the best path either. I'm not sure if there are other ways, or what is the correct way to go about this, but I'm not sure how to advance. If there are any questions or comments, please let me know, thank you!
tagged with: http://stackoverflow.com/tag/svg
tagged with: jsf
answer count: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/44648843
comment on: http://stackoverflow.com/q/28138609
score: 0
has text: what exactly are you trying to do? please provide relevant code
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28206764
type: UnansweredQuestion
has body: I am using jQuery and PHP to upload images to the server and return a JSON of the cropped image. My JavaScript code is: $('document').ready(function () { $('#stat').hide(); $('#file').on('change', function () { var fd = new FormData($('#target')[0]); $('#display &gt; img').remove(); $('#stat').show(); $.ajax({ url: '&lt;?php echo base_url('crop/upload') ?&gt;', type: "POST", data: fd, timeout: 1000 * 100, contentType: false, processData: false, success: function (data, textStatus, jqXHR) { $('#stat').hide(); $('div &gt; img').remove(); console.log(data); console.log(data[1].thumb); $('#display &gt; img').remove(); var img = $('&lt;img&gt;'); img.attr('src', data[1].thumb); img.appendTo('#display') }, error: function (jqXHR, textStatus, errorThrown) { console.log(textStatus); }, dataType: 'json' }) }) }) But whenever the image size is larger than 2 MB the, I see a parse error in the JS console. I tried to set a timeout, but it didn't work. What is the problem? Does the browser sets a timeout? How can I enable users to upload large images without a parse error ?
has comment: http://stackoverflow.com/comment/44780572
tagged with: php
tagged with: image-uploading
has comment: http://stackoverflow.com/comment/44780742
downvote count: 0
has comment: http://stackoverflow.com/comment/44781227
has comment: http://stackoverflow.com/comment/44780720
has comment: http://stackoverflow.com/comment/44780676
tagged with: parse-error
has comment: http://stackoverflow.com/comment/44780758
has comment: http://stackoverflow.com/comment/44779921
has comment: http://stackoverflow.com/comment/44780462
type: Question
has comment: http://stackoverflow.com/comment/44782364
score: 1
has answer: http://stackoverflow.com/a/28206802
has comment: http://stackoverflow.com/comment/44778866
upvote count: 1
has title: Uploading large images using jQuery and PHP
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/28144241
has title: ng-token-auth redirct to login page when auth:invalid
has answer: http://stackoverflow.com/a/32832747
tagged with: authentication
type: Question
has comment: http://stackoverflow.com/comment/46622554
tagged with: javascript
has comment: http://stackoverflow.com/comment/44801434
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has body: I'm using ng-token-auth and I have below in my code: $rootScope.$on('auth:invalid', function(){ $state.go('page.login'); }); I do have a state page.login but somehow it doesn't seem to redirect. I've put in console.log inside the function and it seems to return text in the console so I know the event is triggered. I also have above under module run action with $state injected into it. What am I doing wrong here?

asp.net-mvc-5
tags question: http://stackoverflow.com/q/28237548
tags question: http://stackoverflow.com/q/28159719
type: Tag
tags question: http://stackoverflow.com/q/28169261
tag name: asp.net-mvc-5

http://stackoverflow.com/a/28240602
answers question: http://stackoverflow.com/q/28240521
has comment: http://stackoverflow.com/comment/44842285
type: AcceptedAnswer
upvote count: 3
type: Answer
has body: Get all the keys as an Array them map them to Objects as key-value pairs from source JSON.stringify( Object.keys(source) .map( function (e) { var o = {}; o[e] = source[e]; return o; } ) ); // "[{"quantity":1},{"text":"test"}]"
has comment: http://stackoverflow.com/comment/44942241
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/44842481
accepted answer of: http://stackoverflow.com/q/28240521

http://stackoverflow.com/comment/44843388
type: AnswerComment
score: 0
type: Comment
has text: Once the page is served up by the web server the razor code will have already run its course. The only thing adding a thread sleep will do is delay the serving of the page. You will need to use Ajax to pull in additional content from the server. http://www.w3schools.com/ajax/ good luck.
comment on: http://stackoverflow.com/a/28241117

http://stackoverflow.com/comment/60832572
score: 1
type: Comment
has text: I'm voting to close this question as off-topic because it has nothing to do with programming.
type: QuestionComment
comment on: http://stackoverflow.com/q/28126294

http://stackoverflow.com/comment/44826714
type: Comment
score: 0
type: AnswerComment
has text: so do I need to change the href of anchor and append token ?
comment on: http://stackoverflow.com/a/28231623

http://stackoverflow.com/comment/44681780
type: QuestionComment
has text: @tymeJV Yeah I think you may be right
comment on: http://stackoverflow.com/q/28154638
score: 0
type: Comment

http://stackoverflow.com/q/28132939
has answer: http://stackoverflow.com/a/28133876
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44639224
has comment: http://stackoverflow.com/comment/44639202
favorite count: 0
has comment: http://stackoverflow.com/comment/44638486
tagged with: angularjs
type: Question
score: 9
has comment: http://stackoverflow.com/comment/44644783
has comment: http://stackoverflow.com/comment/44638766
accepted answer: http://stackoverflow.com/a/28133876
has comment: http://stackoverflow.com/comment/44639083
has comment: http://stackoverflow.com/comment/44638633
has answer: http://stackoverflow.com/a/28133712
has comment: http://stackoverflow.com/comment/44638905
has comment: http://stackoverflow.com/comment/47185564
has comment: http://stackoverflow.com/comment/44638875
answer count: 3
has comment: http://stackoverflow.com/comment/44639399
has body: I have an form input which is for a MySQL date field. Ex: 2015-01-31. I want to allow the user to input this using 3 different form inputs. One for the year, one for the month, and one for the day. Obviously ng-model isn't going to work right out of the box, because I'm trying to bind just one part of the date string to each input. I'm pretty sure the way to do it is bye creating three "temporary" scope vars/models $scope.year; $scope.month; $scope.day; ...and then somehow combine/binding them to the actual value. //If only it were this easy! $scope.date = $scope.year + "-" + $scope.month + "-" + $scope.day; The line above of course won't work because the values aren't two-way-bound. If the form were only for saving new data, I could could get away with that by just combining the inputs on submit. But I need it to handle/show existing data also. And it's going to get super ugly if I can't figure out a way to wrangle Angular's binding magic to do what I want. I found this question which I think is trying to do the same thing, but they solve it with a custom directive, which is something I'm hoping to avoid. I know this may be a more maintainable/portable/modular way to do it, but I'm new to Angular and a bit intimidated by that. Also, the inputs are using the lovely angular-selectize directive, which adds an additional layer of complexity to that approach.
possible better answer: http://stackoverflow.com/a/28133712
tagged with: angularjs-directive
linked to: http://stackoverflow.com/q/25141773
upvote count: 9
has answer: http://stackoverflow.com/a/28133716
has comment: http://stackoverflow.com/comment/44638569
tagged with: javascript
has comment: http://stackoverflow.com/comment/44638889
has title: How to bind one model to multiple inputs with Angular JS
has comment: http://stackoverflow.com/comment/47171070
has comment: http://stackoverflow.com/comment/44638482

http://stackoverflow.com/comment/44821608
has text: @AlexanderO'Mara yup. That one is *falsey* too.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28229357

http://stackoverflow.com/comment/44904118
has text: @singhakash did you downvotes me?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28273995

http://stackoverflow.com/a/28268988
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44894029
downvote count: 0
answers question: http://stackoverflow.com/q/28268925
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44894010
type: Answer
has body: You could use the following: Example Here $('#restautantsdiv .addrest-btn-active').closest('#restListings &gt; li').each(function () { var labelname = $(this).find("h4").text(); alert(labelname); }); It returns: "Imax Vendor 01", "Imax Vendor 02" Start by selecting all .addrest-btn-active elements within #restautantsdiv: $('#restautantsdiv .addrest-btn-active') Then find the closest li parent element that is a direct child of #restListings: .closest('#restListings &gt; li') From there, it will iterate over each parent li element that contains .addrest-btn-active, and retreieve the h4 text: $(this).find("h4").text().
accepted answer of: http://stackoverflow.com/q/28268925

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/28167165
tags question: http://stackoverflow.com/q/28252529
type: Tag

http://stackoverflow.com/comment/44633119
has text: Why don't you just not use `controls`?
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28130126

http://stackoverflow.com/q/28190498
has comment: http://stackoverflow.com/comment/44748939
tagged with: load
tagged with: append
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44748834
type: Question
has answer: http://stackoverflow.com/a/28190606
score: -1
downvote count: 2
tagged with: window.location
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44748819
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: When is window.location.href = url gets executed?
has body: For the following code window.location.href = url; $(window.document.body).append(compiledTemplate); I want $(window.document.body).append(compiledTemplate); to be appended on the new Page which will get opened, but it appends thecompiledTemplate` in the existing window then loads the url specified Is there a way to do that. ? Note: url to be passed already has its Form load event defined. I do not want to override it.

http://stackoverflow.com/comment/44724854
score: 0
has text: Elaborating.. I would like to use a unified method across my test script in Selenium. Should be able to call it any time, I want to highlight an webelement.
comment on: http://stackoverflow.com/q/28135095
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28161632
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28149213
upvote count: 7
has comment: http://stackoverflow.com/comment/44699935
has comment: http://stackoverflow.com/comment/44700952
has body: Explaining the problem This is a common mapReduce trap, but clearly part of the problem you have here is that the questions you are finding don't have answers that explain this clearly or even properly. So an answer is justified here. The point in the documentation that is often missed or at least misunderstood is here in the documentation: MongoDB can invoke the reduce function more than once for the same key. In this case, the previous output from the reduce function for that key will become one of the input values to the next reduce function invocation for that key. And adding to that just a little later down the page: the type of the return object must be identical to the type of the value emitted by the map function. What this means in the context of your question is that at a certain point there are "too many" duplicate key values being passed in for a reduce stage to act on this in one single pass as it will be able to do for a lower number of documents. By design the reduce method is called multiple times, often taking the "output" from data that is already reduced as part of it's "input" for yet another pass. This is how mapReduce is designed to handle very large datasets, by processing everything in "chunks" until it finally "reduces" down to a singular grouped result per key. This is why the next statement is important is that what comes out of both emit and the reduce output needs to be structured exactly the same in order for the reduce code to handle it correctly. Solving the problem You correct this by fixing up how you are both emitting the data in the map and how you also return and process in the reduce function: db.collection.mapReduce( function() { emit( { "firstName": this.firstName, "lastName": this.lastName }, { "count": 1, "duplicate": [this] } // Note [this] ) }, function(key,values) { var reduced = { "count": 0, "duplicate": [] }; values.forEach(function(value) { reduced.count += value.count; value.duplicate.forEach(function(duplicate) { re…
accepted answer of: http://stackoverflow.com/q/28149213
score: 7
has comment: http://stackoverflow.com/comment/44700427
has comment: http://stackoverflow.com/comment/107928097
has comment: http://stackoverflow.com/comment/44700125

http://stackoverflow.com/comment/44896575
has text: You may also wish to check for whether or not p.attachments has any values in the array, and whether or not an attachment has a url. `if (p.attachments && p.attachments.length > 0 && p.attachments[0].url) { ... }`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28269335

http://stackoverflow.com/comment/44692497
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28159711
has text: Because I'm not confused enough, `DOMParser().parseFromString()` returns an uninitialized document.

http://stackoverflow.com/comment/44776542
type: AnswerComment
score: 0
has text: @SpencerWieczorek Your example's a tad hard to see, here's a modified one: http://jsfiddle.net/0boLeezj/2/
type: Comment
comment on: http://stackoverflow.com/a/28205056

http://stackoverflow.com/a/28165714
score: 0
answers question: http://stackoverflow.com/q/28165424
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/104226196
has body: If you just want to download a file, you don't need to use ajax to do it. Actually, you cannot download file using ajax. You can still do it by making a hyperlink Export request to a server page that responses content-type is application/vnd.ms-excel and content-disposition is attachment.
has comment: http://stackoverflow.com/comment/104204826

http://stackoverflow.com/comment/44697616
comment on: http://stackoverflow.com/a/28163317
score: 0
type: AnswerComment
type: Comment
has text: Code blocks on their own are not usually useful answers. Please explain what the code you're showing does, and why/how that code answers the question.

http://stackoverflow.com/comment/44751363
type: Comment
comment on: http://stackoverflow.com/q/28192063
type: QuestionComment
has text: answer in syntax highlighting
score: 0

http://stackoverflow.com/a/28221446
has body: The difference is calling a function vs taking a reference to a function. The syntax func() immediately calls the function provided. In element.onclick = func(), the event will be bound to the return value of func. With element.onclick = func, you are not calling func, simply referencing it and assigning it to the event. If func happened to return a function, then you could use the element.onclick = func() syntax, and it would do what you expect. document.getElementById('element1').onclick = print(); // Assigns the *return value* of print document.getElementById('element1').onclick = print; // Assigns print function returnPrinter() { return function print() { // do stuff } } document.getElementById('element1').onclick = returnPrinter(); // Assigns the return value, which is a function, thus doing what you want
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28221390
score: 8
answers question: http://stackoverflow.com/q/28221390
upvote count: 8
type: Answer

http://stackoverflow.com/comment/44781378
score: 0
type: AnswerComment
type: Comment
has text: var urls=[]; var i=0; jQuery.each(attachment, function(key, value) { if(key=="url"){ urls[i]= value; i++; } }); urls.join(",");
comment on: http://stackoverflow.com/a/28207979

http://stackoverflow.com/comment/44787532
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28211404
has text: What is `html` in your JavaScript?

http://stackoverflow.com/comment/44806226
comment on: http://stackoverflow.com/q/28221390
score: 0
type: Comment
type: QuestionComment
has text: yep sorry, I meant that one, but i initially thought you wrote it. I'm gonna accept @ssube's answer of course. still, thank you both.

http://stackoverflow.com/comment/44871326
type: Comment
type: QuestionComment
has text: I don't think "Done" triggers that, but instead the "return" button (located where "Next" would have been). I have a jQuery autocomplete that loses it's focus when I press "Done", thus hiding the dropdown ` ` element. I'm trying to figure out a way of either intercepting the event that is triggered - or if it is just a simple blur event, catch it inside the jQuery autocomplete plugin.
comment on: http://stackoverflow.com/q/28256440
score: 0

http://stackoverflow.com/a/28186302
has comment: http://stackoverflow.com/comment/44742324
type: Answer
downvote count: 0
score: 1
has body: You need to use event delegation at this context, $('.box1').on('click','#__internal' , showMessage); Or try to bind the event to it after that html string got appended into the DOM. $($.trim(guts)).appendTo('.box1'); $('#__internal').bind('click',pVar,showMessage); NOTE: But i don't know why are you refusing to use event delegation here. DEMO created without event delegation.
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28186277
answers question: http://stackoverflow.com/q/28186277

http://stackoverflow.com/comment/106325433
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29788621
has text: chrome version Version 79.0.3945.88 (Official Build) (64-bit). Disabling QUIC Protocol provided (so far) immediate relief. For some reason, after disabling and relaunching, I needed to do the process again as it didn't seem to take the first time. Sometimes bugs are hard to squash. At this late date, I can only assume that our corporate network/firewall has changed to something that was at odds with QUIC Protocol.

http://stackoverflow.com/comment/46289885
has text: Try using a promise. Have a look at: http://howtonode.org/promises
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28172507
type: QuestionComment

http://stackoverflow.com/comment/44653174
type: AnswerComment
score: 0
type: Comment
has text: @maddoga feel free to mark the answer correct :). Glad I could help!
comment on: http://stackoverflow.com/a/28127583

http://stackoverflow.com/q/28211174
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/77455710
tagged with: google-chrome
has body: I try to get the DOM I select by ContextMenu in Chrome Extension. Code: chrome.contextMenus.onClicked.addListener(function(info, tab){ // the info.selectionText just the text, don not contains html. }); chrome.contextMenus.create({ title: "Demo", contexts: ["selection"], id: "demo" }); but the info.selectionText don't contains the HTML DOM. Is there any way to get the selection dom in Chrome extension contextMenu?. Please suggest. thanks.
type: Question
tagged with: javascript
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/37699339
has answer: http://stackoverflow.com/a/28215694
answer count: 3
tagged with: google-chrome-extension
downvote count: 1
linked to: http://stackoverflow.com/q/3461989
has comment: http://stackoverflow.com/comment/67445421
upvote count: 5
has title: Get Selection DOM in chrome extension contextmenu

http://stackoverflow.com/comment/100547458
type: AnswerComment
has text: remove is deprecated
type: Comment
score: 4
comment on: http://stackoverflow.com/a/28139883

cakephp
tags question: http://stackoverflow.com/q/28187478
type: Tag
tags question: http://stackoverflow.com/q/28241172
tag name: cakephp
tags question: http://stackoverflow.com/q/28166583
tags question: http://stackoverflow.com/q/28185146
tags question: http://stackoverflow.com/q/28207282

http://stackoverflow.com/q/28145382
answer count: 4
has title: How do I end javascript program mid program
has answer: http://stackoverflow.com/a/28145436
has body: I need some help ending my program. Is there a command to end it halfway through? In this short guess the number game i made everything goes fine unless the first person wins because it has to complete the loop even after the game has ended var rdmNumber = Math.random(); var timesNumber = rdmNumber * 100; var theNumber = Math.round(timesNumber); var playerOne = prompt("Player 1 please enter your name..."); var playerTwo = prompt("Player 2 please enter your name..."); while (userInput != theNumber) { var userInput = prompt(playerOne + ", Take a Guess (0-100)"); if (userInput == theNumber) { alert("You Guessed it! " + userInput + " is correct. " + playerOne + " has won!"); } else if (userInput &lt; theNumber) { alert("Higher"); } else { alert("Lower"); } var userInput = prompt(playerTwo + ", Take a Guess (0-100)"); if (userInput == theNumber) { alert("You Guessed it! " + userInput + " is correct. " + playerTwo + " has won!"); } else if (userInput &lt; theNumber) { alert("Higher"); } else { alert("Lower"); } }
has answer: http://stackoverflow.com/a/28145434
type: Question
has answer: http://stackoverflow.com/a/28145866
score: 0
has answer: http://stackoverflow.com/a/28145420
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28205654
has comment: http://stackoverflow.com/comment/44777210
upvote count: 1
tagged with: arrays
possible better answer: http://stackoverflow.com/a/28205793
tagged with: javascript
has answer: http://stackoverflow.com/a/28205837
favorite count: 0
accepted answer: http://stackoverflow.com/a/28205961
tagged with: html-lists
has comment: http://stackoverflow.com/comment/44776963
has answer: http://stackoverflow.com/a/28205802
answer count: 4
has answer: http://stackoverflow.com/a/28205961
downvote count: 0
has answer: http://stackoverflow.com/a/28205793
has title: Javascript add li to ul using array
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44777016
tagged with: dom
type: Question
has body: I am working on a spelling game for my children, and I want to display a spelling list based on what they enter and an array that is created. Here is the link to my project on github https://github.com/urock24/myWebSite.git Here is the code in question, javascript first function populateSpellList() { // for loop should run through spelling list array and create list items in "listSpelling" for (var i = 0; i < spellingList.length; i++ ) { // create a new li var newLI = document.createElement("li"); var indSpellingWord = spellingList[i]; // grab the spelling list item var newContent = document.createTextNode(indSpellingWord); // add the spelling list item to the li newLI.appendChild(newContent); // get the unordered list and add the new li var displaySpellList = document.getElementById("listSpelling"); displaySpellList.appendChild(newLI); } } And the HTML The Spelling List test I can get an alert to pop up for me after every line in the function except the last, and it only seems to pop up once. But no matter what happens it is not displaying any list items in that list. I have seen a lot of jquery examples on here so I am definitely going to be pursuing learning jquery, but for now "plain" javascript would be great.

http://stackoverflow.com/a/28199095
answers question: http://stackoverflow.com/q/28198793
upvote count: 2
downvote count: 0
has body: This is another approach if the function is known. $(document).ready(function() { $('button').click(function() { var functionObject = JSON.parse($('button').attr('data-function')); window[functionObject.name].apply(window, functionObject.arguments); }); }); Run Function It parses the JSON string from the data-function attribute. Call the function provided by name using the window object (eliminating eval) and passes the arguments (inside an array) to the function using apply.
type: Answer
score: 2

http://stackoverflow.com/comment/44908890
has text: Java is the best way out
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28277078

http://stackoverflow.com/q/28163821
has body: Sample of what I mean: http://jsfiddle.net/vXnCM/3717/ text text text text text text focus Open the link in Chrome and click Focus, then start typing. Your new text is red. But if you delete the "ASDF" from the HTML and run it again, your new text is black. How can I have it be red with no starting text in the div? (Or, equally effective, how can I have it be red and then clear the starting text from the div without losing the cursor location?)
linked to: http://stackoverflow.com/q/5488809
type: Question
linked to: http://stackoverflow.com/q/10542769
has title: Using JS to set cursor in a contenteditable div works fine in Chrome, but not if the div is empty
tagged with: dom
linked to: http://stackoverflow.com/q/11432933
has answer: http://stackoverflow.com/a/28168158
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: range
possible better answer: http://stackoverflow.com/a/28165010
accepted answer: http://stackoverflow.com/a/28168158
has answer: http://stackoverflow.com/a/28165010
score: 2
type: AnsweredQuestion
upvote count: 2
linked to: http://stackoverflow.com/q/15813895

http://stackoverflow.com/comment/44836629
has text: I've just noticed a little 'problem' with the code, you have to add the `&& url` to the second `if` as well, otherwise the default will always trigger 'download'. I'll amend my post. Thanks for marking!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28236409

http://stackoverflow.com/a/28274017
downvote count: 0
has body: My fiddle maybe help you!!! Just Sample code $(document).bind("contextmenu", function (event) { event.preventDefault(); }); $(document).on("mousedown","#divID",function (e) { if ($(".context-menu").length != 0) { $(".context-menu").remove(); } if (e.button == 2) { event.preventDefault(); $(" " + " " + " Do Somthing " + " " + " ") .appendTo($(this)) .css({ top: event.pageY + "px", left: event.pageX + "px" }); return false; } return true; }); Jquery on bind event parent but targeting child
answers question: http://stackoverflow.com/q/28273617
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28273617
type: AcceptedAnswer

http://stackoverflow.com/comment/44841409
type: QuestionComment
comment on: http://stackoverflow.com/q/28240111
has text: This must be ur brower fault.Else ur code is working for me .Check it with chrome
score: 0
type: Comment

http://stackoverflow.com/a/28236899
answers question: http://stackoverflow.com/q/28236608
type: Answer
has body: I would mainly agree with somethinghere, but since you animate a div with an image inside, than I would animate height of div and set the image height to 100%. Think that looks better/smoother Fiddle. JS changing class is from the answer, but CSS is: #mapsec { height: 0; overflow: hidden; -webkit-transition: height 500ms; transition: height 500ms; } #mapsec.active { height: 200px; } #mapsec img { height: 100%; width: 100%; }
has comment: http://stackoverflow.com/comment/44835160
has comment: http://stackoverflow.com/comment/44835013
has comment: http://stackoverflow.com/comment/44835900
has comment: http://stackoverflow.com/comment/44835358
score: 0

http://stackoverflow.com/q/28148232
answer count: 1
has answer: http://stackoverflow.com/a/29643918
accepted answer: http://stackoverflow.com/a/29643918
tagged with: javascript
has comment: http://stackoverflow.com/comment/46370561
has comment: http://stackoverflow.com/comment/47856629
score: 2
has body: When I call gapi.auth.signIn it is called twice: before opening login popup and after user clicks login button. But in both cases authResponse parameter is not changed. Here is my code sample: gapi.auth.signIn({ scope: 'https://www.googleapis.com/auth/plus.login', callback: function(authResponse) { console.log(authResponse); } )}; And this is how authResponse object looks like in both cases { client_id: /* my client id */ cookie_policy: undefined error: "immediate_failed" error_subtype: "access_denied" expires_at: "1422353634" expires_in: "86400" g_user_cookie_policy: undefined issued_at: "1422267234" response_type: "token" scope: "https://www.googleapis.com/auth/plus.login" state: "" status: { google_logged_in: false method: null signed_in: false } } EDIT: Before sign in I try to check if user is already authorized in google, here is this code: gapi.auth.authorize({ client_id: _googleClientId, immediate: true, scope: 'https://www.googleapis.com/auth/plus.login' }, function(response) { if (response.status.signed_in) { connectGoogleSuccess(response); } else { gapi.auth.signIn({ scope: 'https://www.googleapis.com/auth/plus.login', callback: function(authResponse) { console.log(authResponse); } )}; } } ); How to make to change authResponse object properly after user clicked 'Login' button? Any help is appreciated)
type: AnsweredQuestion
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
tagged with: google-api
has title: Google JS API: gapi.auth.signIn callback function issue

http://stackoverflow.com/q/28274967
score: -8
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44904897
has comment: http://stackoverflow.com/comment/44905089
tagged with: loops
has comment: http://stackoverflow.com/comment/44904777
has comment: http://stackoverflow.com/comment/44904773
type: Question
has comment: http://stackoverflow.com/comment/44904758
upvote count: 0
tagged with: arrays
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44904780
has title: how to display all elements of an array in javascript
accepted answer: http://stackoverflow.com/a/28275132
has body: I wish to print elements of the array below var array = [1,2,3,4,5]; However, only 3 digits must be printed at a time, e.g, step 1: should print 1,2,3 step 2: should print 2,3,4 step 3: should print 3,4,5 step 4: should print 1,2,3 step 5: should print 2,3,4 and the loop continues ..... I wish to display the thumbnails of this slider in a manner that they will fit a small screen. http://www.tympanus.net/Tutorials/FullscreenSlideshowAudio That means only a few thumbnails must appear at a time, while the rest are invisible for a short while. Thanks..
has comment: http://stackoverflow.com/comment/44904798
favorite count: 0
has comment: http://stackoverflow.com/comment/44904759
downvote count: 8
has answer: http://stackoverflow.com/a/28275132

http://stackoverflow.com/comment/44795645
type: Comment
has text: how can i check if jquery is getting imported successfully or not? I am not using _doPostBack.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28215331

http://stackoverflow.com/comment/44658330
comment on: http://stackoverflow.com/a/28141532
score: 0
type: AnswerComment
type: Comment
has text: Can you not just loop through your data and based on their type create a marker specific to that type then use the correct icon?

http://stackoverflow.com/comment/44820325
type: Comment
comment on: http://stackoverflow.com/a/28228529
type: AnswerComment
score: 0
has text: Not the object of function. It adds it as hidden properties of function definition itself. Try to console `add.num` before assigning and after assigning.

http://stackoverflow.com/a/31032449
answers question: http://stackoverflow.com/q/28159688
score: 0
type: Answer
has body: you will need to assign your value to a string before adding it to setAction var f = function (){ var x = 777; cscript="app.alert ("+ x +")"; this.getField("Text1").setAction("MouseUp", cscript); }

http://stackoverflow.com/q/28254533
upvote count: 0
score: -2
answer count: 1
has answer: http://stackoverflow.com/a/28254551
tagged with: javascript
tagged with: express
favorite count: 0
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28254551
downvote count: 2
has body: I am experimenting with some express routes and I am attempting to do something like this: route.get('/guest', GuestHandler.getAll) and 'getAll' would be defined as so (doesn't work): GuestHandler.getAll = function() { return function(req, res) { res.send('hello world'); } }; This works: GuestHandler.getAll = function(req, res) { res.send('hello world'); } How can I make something like the former work without explicitly doing the latter?
type: AnsweredQuestion
has title: What is the difference between calling and returning a function?
tagged with: closures
type: Question

http://stackoverflow.com/q/28250038
answer count: 1
tagged with: javascript
has title: Differing one button from another on a prototype object jquery
accepted answer: http://stackoverflow.com/a/28250111
score: 2
type: AnsweredQuestion
tagged with: button
downvote count: 0
favorite count: 0
type: Question
has body: first, the prototype: function Notification (title, message, id) { var $title = this.title = title; var $message = this.message = message; var $id = this.id = title; /* ---------------creating HTML prototype */ var $mainDiv = $(" ").appendTo($("#wrapper")); $mainDiv.attr('id', $id); $mainDiv.addClass('main-div'); var $dismissButton = $(" X ").appendTo($mainDiv); $dismissButton.attr('id', 'dismissButton'); var $pTitle = $(" ").appendTo($mainDiv); $pTitle.attr('id', 'title'); $pTitle.text($title); var $para = $(" ").appendTo($mainDiv); $para.attr('id', 'message'); $para.text($message); var $ul = $(" ").appendTo($mainDiv); var $li1 = $(" ").appendTo($ul); $li1.attr('id', 'okButton'); var $button = $(" Ok ").appendTo($li1); $button.addClass('buttons'); /* ---------------Dismissing notifications */ $("#dismissButton").click(function() { document.getElementById($id).remove(); }); }; So, the prototype is made using new Notification(*arguments here*) and there we get a box with a notification widget. so far so good. when i press the X button (id dismissbutton) it should remove the box, and it does. However. if i use the new notification several times i get several boxes (with different ids for the $mainDiv) with their dismiss buttons not working. the upmost widget box's dismiss button is the only one that works, and it deleted all the other boxes as well. I need to seperate them and have the dismiss button working for each box seperately. thanks in advance :)
upvote count: 2
has answer: http://stackoverflow.com/a/28250111

http://stackoverflow.com/comment/44774461
type: QuestionComment
comment on: http://stackoverflow.com/q/28204182
has text: `.css('color')` returns **RGB** format color. The `'#bfbfff'` HEX is `rgb(191, 191, 255)` http://jsfiddle.net/philip100/yq1uhc23/6/
score: 0
type: Comment

http://stackoverflow.com/comment/44734752
comment on: http://stackoverflow.com/q/28182649
score: 0
type: QuestionComment
type: Comment
has text: I'm trying to keep all my functions within the controller to keep the code clean.

http://stackoverflow.com/comment/44871997
score: 0
type: AnswerComment
has text: But that means adding a lot of extra overhead loading jQuery.
comment on: http://stackoverflow.com/a/28256918
type: Comment

http://stackoverflow.com/a/28184491
has comment: http://stackoverflow.com/comment/44738086
accepted answer of: http://stackoverflow.com/q/28184249
score: 1
answers question: http://stackoverflow.com/q/28184249
has comment: http://stackoverflow.com/comment/44740740
type: AcceptedAnswer
downvote count: 0
has body: I just found this stack overflow post, which answers your question. Copying from the post: "run this in your browser's javascript console, then jQuery should be available... var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); // ... give time for script to load, then type. jQuery.noConflict(); NOTE, if the site has scripts that conflict with jQuery (other libs, etc..) you could still run into problems." Alternatively, you could copy and paste the whole jquery libary into your console. Here is a link to the latest version of Jquery: http://code.jquery.com/jquery-latest.min.js
has comment: http://stackoverflow.com/comment/44738126
has comment: http://stackoverflow.com/comment/44738236
type: Answer
has comment: http://stackoverflow.com/comment/44738291
has comment: http://stackoverflow.com/comment/44738283
upvote count: 1

http://stackoverflow.com/comment/44709261
has text: @Vijay That would be completely correct, however I only used the second div with the class as an example. I effectively want all images **not** under an ancestor of some description.
comment on: http://stackoverflow.com/q/28167313
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28237737
has comment: http://stackoverflow.com/comment/44921666
score: 2
has comment: http://stackoverflow.com/comment/44938766
has body: You haven't register the LoginFactory as an Angular provider, the dependency injection works if its a valid angular service/provider/factory. If you register your function with the following code, then the LoginFactoryProvider should be found. angular.module('UserLogin', []) .provider('LoginFactory', LoginFactoryProvider); function LoginFactoryProvider ( /* NO-DI */ ) { return { $get: ['DI', function ($DI) { return { setLogin: function(user, pass) { /* etc */ } } } } } Now you can add in all Controllers where you want to access the LoginFactory.setLogin function with dependency injection as you wanted: var LoginController = function ($scope, $routeParams, $location, LoginFactory) { Ofcourse before this works you need to register the module UserLogin into the first part of your app.js like so: var Call23 = angular.module("Call23", ["ngResource", "ngRoute", 'ui.bootstrap', "UserLogin"])
downvote count: 0
has comment: http://stackoverflow.com/comment/44907067
has comment: http://stackoverflow.com/comment/44909132
answers question: http://stackoverflow.com/q/28236805
has comment: http://stackoverflow.com/comment/44945356
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44900151

http://stackoverflow.com/q/28141337
has comment: http://stackoverflow.com/comment/44654473
has comment: http://stackoverflow.com/comment/44662705
answer count: 0
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44654691
has title: Cannot Read Property of Undefined javaScript
upvote count: 1
has comment: http://stackoverflow.com/comment/44654763
has comment: http://stackoverflow.com/comment/44654441
has body: I am checking to see if a string is a substring of another string in the array. Here is a piece of my index.js: var state = []; router.post('/doquery', function(req, res) { var input = req.body.input; var tempState = []; var i = 0; console.log(input); console.log(state); console.log(state.length); while (i &lt; state.length) { if ( ( ((state[i].name).indexOf(input)) !== -1 ) || ( ((state[i].city).indexOf(input)) !== -1 ) || ( ((state[i].country).indexOf(input)) !== -1 ) || ( ((state[i].birthday).indexOf(input)) !== -1 ) || ( ((state[i].email).indexOf(input)) !== -1 )|| ( ((state[i].phone).indexOf(input)) !== -1 ) ) { tempState.push(state[i]); } i++; } res.render('doquery', {title: 'Doquery', tempState: tempState}); }); I get this error message: Cannot read property 'length' of undefined. I understand that this means that state is not defined. But I did define it. Any suggestions on how to fix it? EDIT: If it makes any difference, i also have this in my code: router.post('/add', function(req, res) { var obj = { name: req.body.name, city: req.body.city, country: req.body.country, birthday: req.body.birthday, email: req.body.email, phone: req.body.phone }; state.push(obj); res.render('add', { title: 'Person just added', item: obj }); }); state have the var obj in it.
has comment: http://stackoverflow.com/comment/44654651
type: UnansweredQuestion

http://stackoverflow.com/q/28126037
has comment: http://stackoverflow.com/comment/44625313
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28126613
has comment: http://stackoverflow.com/comment/44625328
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44625423
type: Question
has body: I searched around net and tried many things but scrollTop is scrolling randomly. I want to scroll within a div when clicked on links. My div: //longtext here //longtext here //longtext here Three links: Item 1 Item 2 Item 3 The onclick method: changeItemDisplay: function(a) { var target = "#item_"+a; $("#dishesresults").stop().animate({scrollTop: ($(target).position().top)+"px"}, 800); } This is not working correctly, but they have some pattern there for scrolling. Even if I click one link twice consecutively then also it is moving every time. Don't know what is causing this.
has comment: http://stackoverflow.com/comment/44625504
has comment: http://stackoverflow.com/comment/44625299
score: -2
has comment: http://stackoverflow.com/comment/44625393
tagged with: javascript
has title: scrollTop within div not working with onclick on tag
has comment: http://stackoverflow.com/comment/44625437
has answer: http://stackoverflow.com/a/28126613
upvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28205234
has answer: http://stackoverflow.com/a/28205429
accepted answer: http://stackoverflow.com/a/28205429
possible better answer: http://stackoverflow.com/a/28205323
has title: Javascript Array splice removes data but does not reset index
has answer: http://stackoverflow.com/a/28205323
tagged with: array-splice
type: Question
has body: I have an array of objects. It had 3 objects I then deleted them one by one using arr.splice(0,1) which I repeated 3 times. I then added a new object to the (what is supposed to be an empty array) and printed out the ENTIRE array in console. As you can see, it IS the only object in the array, but instead of starting with index 0, it starts with index 3. Also, the indexes for 0,1,2 are not there, they are not "null" or anything like it. their gone. What's going on? This is the actual code for removal. I invoke it 3 times. this.removeSelected = function () { //Remove from array //I have verified that selFramePos=0 many times. f.splice(selFramePos, 1); } This object that I keep in each array slot(Just a bunch of data, nothing special): Data = { normal : normData, imageUrl: selfDefaults.viewport.src, topLeftX: norm(cf.paper.width, vpo.cx, vpw), topLeftY: norm(cf.paper.width, vpo.cy, vpw), width: norm(cf.paper.width, vpo.width, vpw), height: norm(cf.paper.width, vpo.height, vpw), rotation: selfRotator.getRotation().rotation, cropping: { shape: selfSelector.getSelection().shape, tlx: mathUtils.normalize(cf.paper.width, selfSelector.getSelection().left, vpw), tly: mathUtils.normalize(cf.paper.width, selfSelector.getSelection().top, vpw), w: mathUtils.normalize(cf.paper.width, selfSelector.getSelection().width, vpw), h: mathUtils.normalize(cf.paper.width, selfSelector.getSelection().height, vpw), color: selfSelector.getSelection().color, opacity: selfSelector.getSelection().opacity }, filters: null, transition: { type: 'dissolve', time: 500 }, requireUserInput: true } My problem was that I kept creating new array slots with an increasing index number like so: var i=0 function add2Array () { arr[i]='something' i++ } So every time I called the function, it created a 'unique id' of sort instead of working with indexes and positions. I fixed it by removing i and just using 'push' instead of arbitrarily increasing indexes.
tagged with: arrays
has comment: http://stackoverflow.com/comment/44776447
tagged with: javascript
has comment: http://stackoverflow.com/comment/44776285
score: -1
has comment: http://stackoverflow.com/comment/44776262
answer count: 2
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/44776334
has comment: http://stackoverflow.com/comment/44776523
has comment: http://stackoverflow.com/comment/44776489
favorite count: 0
has comment: http://stackoverflow.com/comment/44776544
has comment: http://stackoverflow.com/comment/44776533
type: AnsweredQuestion

http://stackoverflow.com/q/28259888
has answer: http://stackoverflow.com/a/28259918
has answer: http://stackoverflow.com/a/28259903
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28259918
type: Question
has title: Is not using external style sheet for CSS causing my code not to execute?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44877786
tagged with: javascript
tagged with: jquery
has body: The code that you see was kindly given to me by a Stack Overflow user and his JSFiddle can be found at http://jsfiddle.net/f18513hw/. His code works just fine in JSFiddle. I copied and pasted his codes into my Textpad and saved it in my htdocs folder of XAMPP and tried to run it. I discovered that when I place my cursor on the icon of the cars, the icon magnifies (as it's supposed to) but I get not textbox appearing beneath the icon. That is the whole idea of my webpage, to place one's mouse on an image and a textbox appears and the user then inserts his comments into the box. When I asked Stack Overflow users why no textbox was appearing, a lady kindly pointed out that I was missing the jQuery library link, so I put that in, too. I have checked and rechecked the layout of the codes (the JavaScript and jQuery link are placed within the head tags, and the CSS codes placed within the style tags) and nothing seems wrong, but the code still doesn't run. Since none of the scripts are server-side, I decided not to use XAMPP and simply saved the scripts in "My Document" and run it on the browser, but nothing changed. Could someone please tell me what I'm doing wrong? If a code runs in JFiddle, is there any rhyme or reason why it should not run on a browser? This is ridiculous.
accepted answer: http://stackoverflow.com/a/28259903
tagged with: http://stackoverflow.com/tag/html
tagged with: css

fullcalendar
tags question: http://stackoverflow.com/q/28171188
tags question: http://stackoverflow.com/q/28239631
tag name: fullcalendar
tags question: http://stackoverflow.com/q/28264695
tags question: http://stackoverflow.com/q/28198933
tags question: http://stackoverflow.com/q/28219122
type: Tag
tags question: http://stackoverflow.com/q/28278752

http://stackoverflow.com/q/28137015
tagged with: html5-audio
answer count: 0
upvote count: 3
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44713114
has title: Audio play() not working on Android 4.4 mobile devices
score: 3
has comment: http://stackoverflow.com/comment/44703425
tagged with: audio-streaming
downvote count: 0
tagged with: javascript
has body: I am trying to play a simple audio file via javascript on page load which works on browsers and mobile devices but same not working with android 4.4 version. Below is the code snippet: &lt;audio controls id="player"&gt; &lt;source src="testaudio.mp3" type="audio/mpeg"&gt; Your browser does not support the audio element. &lt;/audio&gt; &lt;script&gt; var audiofile = document.getElementById("player")[0]; audiofile.load(); audiofile.play(); &lt;/script&gt; Please let me know if I am missing something. Thanks in advance.
favorite count: 0
tagged with: android-4.4-kitkat
has comment: http://stackoverflow.com/comment/44654685
tagged with: audio-player

http://stackoverflow.com/comment/44823814
type: AnswerComment
comment on: http://stackoverflow.com/a/28230534
has text: I did it and its working fine... i have updated the fiddle.. http://jsfiddle.net/Sanju_Bollera/5vuzagkw/2/
type: Comment
score: 0

http://stackoverflow.com/a/28220788
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28220504
has body: i couldnt understand what you are asking, but it looks like this is what you are looking for: $(function(){ $("#BT_Insert").click(function(){ $(".insert_img").each(function(id,val){ console.log($(val).attr("src")); $("#editor").val($("#editor").val()+"\n"+$(val).attr("src")); }); }); }); #editor{ width:500px; height:100px; } Click Me
answers question: http://stackoverflow.com/q/28220504

http://stackoverflow.com/comment/44869472
type: Comment
score: 0
has text: did you try to leave just 1.10.2 version? usually there are not so many things that could really require older version of jquery
comment on: http://stackoverflow.com/q/28255264
type: QuestionComment

http://stackoverflow.com/q/28270567
tagged with: node.js
has answer: http://stackoverflow.com/a/28270650
type: AnsweredQuestion
type: Question
has title: How to go about utilizing acorn.js in another .js file?
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28270650
score: 0
has body: I'm trying to write a Javascript translator using a Javascript parser called "acorn.js." I'm writing my code in Sublime using a Node build system. Calling the following line: require("./acorn.js"); produces no errors, but whenever I attempt to access any functions within that file, an undefined error is thrown. Is there any way I can import or reference this library to gain access to its functions without having to utilize a JQuery import or something of the like? Here is the answer: var test = acorn.parse("var x;"); And if you're using this specific library, what is returned is an AST of the contents of what you parse. In this case, it's the string "var x;".
has comment: http://stackoverflow.com/comment/44896839

http://stackoverflow.com/comment/44782718
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28208569
has text: the video isn't centered yet, I want the video to be in the center of the screen, this is the result of your code: `http://s12.postimg.org/u0k04f8t9/angel_beats_bg5.jpg`

http://stackoverflow.com/comment/44787474
score: 1
has text: Same way you did for first one. Just make sure you use unique IDs (in case above your ID is 'Style')
comment on: http://stackoverflow.com/q/28211542
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44849560
type: Comment
score: 1
has text: You can't do multilevel menus with ` ` but you can do it with CSS menus, and maybe the `Select2` plugin can do it easily for you.
comment on: http://stackoverflow.com/q/28244358
type: QuestionComment

http://stackoverflow.com/comment/44644203
comment on: http://stackoverflow.com/q/28135844
score: 0
type: Comment
type: QuestionComment
has text: I don't know how could I provide a better example in this case :(

http://stackoverflow.com/q/28279351
tagged with: javascript
has answer: http://stackoverflow.com/a/28279494
has title: Once attached to root object in browser, is the root prefix mandatory when referencing?
answer count: 1
has comment: http://stackoverflow.com/comment/44912858
type: UnansweredQuestion
score: 0
has body: When I implement a class to the browser's root-scope: window.Foo = (function() { function Foo() {} return Foo; })(); Is it necessary or good practice to add the root prefix every time it is referenced? E.g. var a = new window.Foo(); or is the following fine? var a = new Foo();
type: Question

http://stackoverflow.com/a/28233810
answers question: http://stackoverflow.com/q/28233487
has body: If your response is valid JSON, try the following: xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState === 4 &amp;&amp; xmlhttp.status === 200) { var jsonResponse = JSON.parse(xmlhttp.responseText); console.log(jsonResponse); } }
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28233487
type: Answer

http://stackoverflow.com/comment/44794047
comment on: http://stackoverflow.com/a/28213281
score: 0
type: AnswerComment
type: Comment
has text: Thanks again. I tested and its working fine. sorry one more thing i missed. This doesn't calculate the date based on the hours. I tried 02/03/2015 18:26 - 30/01/2015 18:23 returned 3.0 minutes which is correct. It should say 1.03 ( 1 day 3 minutes). sorry completely forgot i also needed help excluding weekend calculation

http://stackoverflow.com/a/28188940
has comment: http://stackoverflow.com/comment/44747444
has comment: http://stackoverflow.com/comment/44748144
accepted answer of: http://stackoverflow.com/q/28188775
type: Answer
answers question: http://stackoverflow.com/q/28188775
score: 4
has body: I think your mistake is in the fact that you make a texture of a texture. When you do: dummyDataTex = new THREE.DataTexture( dummyRGBA, 4, 4, THREE.RGBAFormat ); the object dummyDataTex that you create here is already of type THREE.Texture. So your next step: dummyTex = new THREE.Texture(dummyDataTex); is not necessary. You should instead immediately use dummyDataTex.
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28161676
favorite count: 0
has body: My goal is to have a form similar to http://jquerycreditcardvalidator.com/. Ive tried viewing the source code of that page, but it is beyond my expertise, so I tried to rewrite the code using jquery. I also want to mask the input after the first 2 digits are typed. The problem: Clearing the displayed CC image, appears to only work on FireFox, and is unpredictable. Once the input is masked to conform to the credit card type, the cursor is thrown to the end of the input box What am I doing wrong here? There has to be a much simpler way to do this Fidle with code:http://jsfiddle.net/nh7qqfgx/ (for the sake of convince, colored rectangular divs are placeholders for the actual card logos) Code: $('#ccnumber').validateCreditCard(function (result) { // this will execute everytime the value of the `#cc_number` field changes if (result.card_type == null) { $("#ccHolder").removeClass(); } if (result.card_type != null) { cardtype = result.card_type.name; $("#ccHolder").addClass(result.card_type.name); if (result.card_type.name === 'visa') { //if the card is Visa $("#ccnumber").mask("9999-9999-9999-9999", { placeholder: " ", autoclear: false }); } if (result.card_type.name === 'amex') { //if the card is American Express $("#ccnumber").mask("999-999999-999999", { placeholder: " ", autoclear: false }); } if (result.card_type.name === 'mastercard') { //if the card is MasterCard $("#ccnumber").mask("9999-9999-9999-9999", { placeholder: " ", autoclear: false }); } if (result.card_type.name === 'discover') { //if the card is Discover $("#ccnumber").mask("9999-9999-9999-9999", { placeholder: " ", autoclear: false }); } if (result.card_type.name === 'JCB') { //if the card is JCB $("#ccnumber").mask("9999-9999-9999-9999", { placeholder: " ", autoclear: false }); } if (result.card_type.name === 'Diners Club') { //if the card is Diners Club $("#ccnumber").mask("999-999999-99999", { placeholder: " ", autoclear: false }); } } });
tagged with: css
answer count: 0
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/44694729
has title: jQuery - How to mask credit card number during input?
has comment: http://stackoverflow.com/comment/44696672
upvote count: 5
tagged with: javascript
score: 4
type: Question
tagged with: validation
tagged with: jquery

http://stackoverflow.com/a/28239720
has comment: http://stackoverflow.com/comment/44840869
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44841310
has comment: http://stackoverflow.com/comment/44840777
answers question: http://stackoverflow.com/q/28239486
has comment: http://stackoverflow.com/comment/44841013
has body: Assuming your code like this: ...... ...... ...... .... Do this scripting: This is a simpler version, you can modify it according to your need.

http://stackoverflow.com/q/28140906
type: Question
tagged with: try-catch
has body: Try catch is used to catch errors and report to user. all said and fine. But where exactly one has to put the try-catch. Or What exactly has to go inside try catch on a usual basis. Most importantly, is it absolutely a good coding practice to have a try catch block?
tagged with: javascript
has answer: http://stackoverflow.com/a/28141046
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28141106
has title: Javascript - Where exactly to place try - catch?
type: UnansweredQuestion

http://stackoverflow.com/q/28239290
tagged with: css
answer count: 1
tagged with: popup
score: 0
tagged with: bxslider
has body: I am trying to launch a pop up div which will contain a bx slider. The link that launches the pop up div works fine. So is the pop up which appears with some text but the images inside the bxslider don't appear. I thought it was a z-index issue but seems not (or did not manage to fix it indeed). The loading and direction control images are there but not the images.. Many thanks for your help ! pop-up with SLIDER Projet Uranus Projet Uranus : développement web
accepted answer: http://stackoverflow.com/a/28239567
has title: Bxslider in a pop up div
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/28239567
type: Question

http://stackoverflow.com/q/28278630
has answer: http://stackoverflow.com/a/28278695
has answer: http://stackoverflow.com/a/28280548
has comment: http://stackoverflow.com/comment/44911380
tagged with: node.js
type: AnsweredQuestion
has body: For instance, if a browser has javascript disabled does node.js still work or does it need a fallback? I know this might be a stupid question, but i'm trying to prove to a friend that node.js works on the server-side and doesn't rely on the client side.
type: Question
has comment: http://stackoverflow.com/comment/44911369
has comment: http://stackoverflow.com/comment/44911648
tagged with: javascript
has comment: http://stackoverflow.com/comment/44911531
possible better answer: http://stackoverflow.com/a/28280548
has title: Node.js - Disabling Browser's Javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44911338
has answer: http://stackoverflow.com/a/28279138
accepted answer: http://stackoverflow.com/a/28279138
tagged with: server-side
has comment: http://stackoverflow.com/comment/44914135
has comment: http://stackoverflow.com/comment/44911585

http://stackoverflow.com/q/28261508
has title: Bootstrap glyphicon/nav bar showing popup window
accepted answer: http://stackoverflow.com/a/28261678
answer count: 1
downvote count: 0
tagged with: javascript
has body: I'm using a few things from bootstrap in my template, like glyphicon's and a navbar. Which is on my "forum.php". Now when I want to delete a topic, I want a javascript popup to show up which is working just fine. But through that popup I can see bootstraps navbar and glyphicon. How do I fix this? forum.php Delete category css.css #popup_container { width:100%; height:100%; opacity:.99; top:0; left:0; display: none; position:fixed; background-color:#313131; overflow:auto } #prompt-delete { position:absolute; left:50%; top:17%; margin-left:-202px; } popup.php my popup Close Javascript.js function showDiv() { document.getElementById('popup_container').style.display = "block"; } function closeDiv() { document.getElementById("popup_container").style.display = "none"; } When popup is showing, through that div, on the background I see the glypicon of bootstrap without being faded into the background. It shows without opacity. The rest of the page is faded with the opacity defined in the css.
favorite count: 0
tagged with: twitter-bootstrap
upvote count: 1
has answer: http://stackoverflow.com/a/28261678
tagged with: css
type: AnsweredQuestion
score: 1
type: Question

http://stackoverflow.com/a/28272375
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28272306
has body: Update style class any property won't feasible, but you could overwrite style any property using jquery css() function, it would also work in same manner, for instance you want to remove width then you can use auto property, see below sample code $("table.searchlistTable").css("width", 'auto');
answers question: http://stackoverflow.com/q/28272306
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28252436
tagged with: dynamic
has comment: http://stackoverflow.com/comment/44864386
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44864546
has title: Are Javascript Procedures Partial or Total?
accepted answer: http://stackoverflow.com/a/28252637
has comment: http://stackoverflow.com/comment/44864187
type: Question
linked to: http://stackoverflow.com/q/14863430
has comment: http://stackoverflow.com/comment/44864496
answer count: 1
tagged with: javascript
has body: This question may be too specific; however, I believe the variety of answers from the knowledgeable might be immensely helpful with respect to understanding dynamic languages such as Javascript (the language basis for my question). Just to catch everyone reading up to a common place, here is some literature: Liskov's (2001) Program Development in Java describes a total procedure as total if ..."its behavior is specified for all legal inputs," (54). A partial, then (as she also writes), is partial if illegal input is allowed and the behavior for that input undefined. Though a few subtleties are not explained above, the distinction from my own research between total and partial appears pretty distinct, particularly for statically typed languages. From my understanding, the term "partial" is most often used to refer to the allowance of breaking formal parameters to procedures - arguments that cause an unhandled error within the body of the procedure. Are procedures written in a dynamically typed language - here for primitive inputs - partial or total? If you've got the book, another page to look at carefully is p. 58 (if not, you can find a pretty solid pdf of it online, somewhere). Note (concerning comments): I understand the notions of partial and total are language independent and refer specifically to each procedure;'s implementation; however, I am asking this about dynamically-typed languages in general where "legality" of input - and the enforcement of those rules - appears to be less well defined
score: 0
tagged with: partial
has answer: http://stackoverflow.com/a/28252637

http://stackoverflow.com/q/28164338
score: 1
has title: Booking Calendar Widget to prevent last minute booking
has comment: http://stackoverflow.com/comment/44711680
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44699939
has body: I want to modify my booking calendar widget in such a way that I can prevent people from booking at the last minute. I would like to make it in such a way that bookings are only allowed at least 3 days in advance. the code is shown as below (my guess is that it has something to do with datepicker, but I could be wrong): class Calendar_widget extends WP_Widget { function Calendar_widget(){ parent::__construct( 'calendar_widget', 'Calendar Widget' ); } function do_with_time_stamp_something(&$arrayOfTimeStamps, $timeStamp){ // var_dump($timeStamp); if(!empty($timeStamp)){ $date_link = date( "F.j.Y", $timeStamp ); array_push($arrayOfTimeStamps, array( get_site_url()."/event_category/event/?date=".$date_link, date( "m/d/Y", $timeStamp ) )); } } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $i=0; global $wpdb; $data = array(); $wpdb->query(" SELECT $wpdb->postmeta.`meta_value` FROM $wpdb->postmeta INNER JOIN $wpdb->posts ON $wpdb->postmeta.post_id=$wpdb->posts.ID WHERE (`meta_key` = '".SHORTNAME."_event_date' OR `meta_key` = '".SHORTNAME."_multiple_weeks_array' OR `meta_key` = '".SHORTNAME."_multiple_weeks_array_1') and $wpdb->posts.post_status = 'publish' and $wpdb->posts.post_type = 'event' "); foreach($wpdb->last_result as $v){ $meta_value = maybe_unserialize($v->meta_value); if(is_array($meta_value)){ foreach ($meta_value as $timeStamp) { // do_with_time_stamp_something($data, $timeStamp); if(!empty($timeStamp)){ $date_link = date( "F.j.Y", $timeStamp ); array_push($data, array( get_site_url()."/event_category/event/?date=".$date_link, date( "m/d/Y", $timeStamp ) )); } } } else { // var_dump($meta_value); if(!empty($meta_value)){ // var_dump($meta_value); $timeStamp = strtotime($meta_value); $date_link = date( "F.j.Y", $timeStamp ); array_push($data, false); } // do_with_time_stamp_something($data, $meta_value); if(!empty($timeStamp)){ $date_link = date( "F.j.Y", $timeStamp ); array_push($data, array( g…
linked to: http://stackoverflow.com/q/492994
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
type: Question
tagged with: jquery-ui

http://stackoverflow.com/comment/44739873
score: 0
comment on: http://stackoverflow.com/a/28185469
type: AnswerComment
has text: It does not matter, you still can use ngModal for that.
type: Comment

http://stackoverflow.com/a/28148694
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44725814
score: 0
type: Answer
has body: You should be able to get the array you want using something like: var countryList = document.querySelectorAll('.country'); var countryNames = Array.prototype.map.call(countryList, function(c){return c.textContent});
has comment: http://stackoverflow.com/comment/44668816
has comment: http://stackoverflow.com/comment/44668845
accepted answer of: http://stackoverflow.com/q/28148169
answers question: http://stackoverflow.com/q/28148169
has comment: http://stackoverflow.com/comment/44668734

http://stackoverflow.com/comment/44686027
comment on: http://stackoverflow.com/q/28145290
score: 0
type: Comment
type: QuestionComment
has text: Hi es128, ill take a look at this thread and see if it helps.

http://stackoverflow.com/a/28237425
type: Answer
has comment: http://stackoverflow.com/comment/44836206
score: 0
has body: I think you are missing a parenthesis ")": photosPopup_sb.Append("&lt;img src=\"Images/Design/openmenu.png\" onclick=\"photoMenu(" + IDphoto + ", '" + photoFileName + "')\" /&gt;");
answers question: http://stackoverflow.com/q/28237338

http://stackoverflow.com/comment/44640363
has text: http://stackoverflow.com/questions/2523436/javascript-implementation-of-a-set-data-structure
comment on: http://stackoverflow.com/q/28133977
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28219880
tagged with: http://stackoverflow.com/tag/q
has title: How do you assert when testing a Node module that uses promises?
score: 0
tagged with: sinon
tagged with: node.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28225034
type: Question
answer count: 1
has body: I have a Node controller “simpleController” which has a dependency on an instance of “DataAccess”. The controller calls the function “getData” on the instance of “DataAccess” and has a promise returned to it. If the promise is then rejected, the controller should return a status of 500. I would like to write a test on “simpleController” but mock the instance of “DataAccess” so I can return a failed promise and assert the “simpleController” behaviour is as expected. I have attempted to write a unit test to perform this but the test times out. (function (simpleController) { var DataAccess = require('./DataAccess'); var dataAccessInstance; simpleController.init = function (dataSource) { dataAccessInstance = new DataAccess(dataSource); }; simpleController.setMockDependencies = function (mockDataAccessInstance) { dataAccessInstance = mockDataAccessInstance; }; simpleController.performAction = function (req, res) { var entityId = req.query.id; dataAccessInstance.getData(entityId) .then(function (data){ res.status(200).json(data); }, function (err) { res.status(200).json(err); }); } })(module.exports); /* global describe, it */ 'use strict'; var assert = require('assert'); var sinon = require('sinon'); var Q = require('q'); var DataAccess = require('../lib/temp/DataAccess'); describe('Simple Controller Tests', function () { var simpleController; var dataAccess; beforeEach(function (done) { simpleController = require('../lib/temp/simpleController'); var dataSource = 'dummy'; dataAccess = new DataAccess(dataSource); done(); }); it('should return status of 500 if data access fails', function (done) { // Arrange var req = { query: { id: '12345678' } }; var res = {}; var deferred = Q.defer(); var stub = sinon.stub(dataAccess, 'getData', function() { return deferred.promise; }); simpleController.setMockDependencies(dataAccess); deferred.promise.fail(function () { // Assert assert.ok(stub.called); assert.equal(res.status, 500); done(); }); // Act simpleController.performAction(re…
tagged with: javascript
tagged with: mocha.js

http://stackoverflow.com/q/28258688
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44875283
tagged with: variables
has comment: http://stackoverflow.com/comment/44875287
has answer: http://stackoverflow.com/a/28258740
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am trying to write the date in a simple mm/dd/yyyy format. My script is: test = new Date() month = test.getMonth() month = month + 1 day = test.getDate() year = test.getFullYear() document.getElementById("dateText").innerHTML = month;"/";day;"/";year I got document.write(month,"/",day,"/",year) to work but I cannot get this to work. I would like to use my styled paragraph with a &lt;p&gt; tag, not the default type. I am putting it in the &lt;header&gt; in the body as follows: &lt;p id="dateText"&gt;&lt;/p&gt;
accepted answer: http://stackoverflow.com/a/28258740
favorite count: 0
has title: javascript innerhtml with javascript variables
tagged with: innerhtml
upvote count: 1
has comment: http://stackoverflow.com/comment/44875442
has comment: http://stackoverflow.com/comment/44875285
type: AnsweredQuestion

http://stackoverflow.com/comment/44633450
comment on: http://stackoverflow.com/a/28130127
score: 0
type: Comment
has text: I know that user1 is just an example. But in your example when it's not valid you need to delete `user1` from the window object since it's actually `window['user1'] = null`. The code is clear and does it's job perfectly. I've updated mine to reflect the comment I gave.
type: AnswerComment

http://stackoverflow.com/comment/44661571
has text: I add the GitHub code to the controller. Thanks you both.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28139243

http://stackoverflow.com/comment/44823658
type: Comment
type: QuestionComment
has text: @AlexisKing is `getViewport.width` enough if the functions name was getViewport?
comment on: http://stackoverflow.com/q/28230586
score: 0

http://stackoverflow.com/a/29584730
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47318362
answers question: http://stackoverflow.com/q/28248216
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28248216
has body: You should care more about the size of the JSON request as opposed to how many items. For instance, if your item is only a character then 1000 characters is miniscule but if your item is a massive document then you may have a problem. The point at which you need to be aware of is when a full page reload becomes faster than an AJAX request. You can do some simple profiling by using your browsers dev tools to get a rough idea. Since you're using a RESTful API, one solution may be to send the primary ID of an item and something like a name when the browser makes the 1000 item index call. Then you can use the primary ID to link to the full item. Another solution may be to implement your pagination with AJAX. You can avoid multiple full page loads this way.
type: Answer

arrow-functions
tag name: arrow-functions
type: Tag
tags question: http://stackoverflow.com/q/28139810
tags question: http://stackoverflow.com/q/28222228

http://stackoverflow.com/q/28270274
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44910123
type: Question
has answer: http://stackoverflow.com/a/28270749
tagged with: firebase
has body: From what I understand in the documentation of firebase, data you input is converted into JSON right? Now in order for you to connect to firebase, the easiest way is to use javascript. But what if you use the JSON data in firebase to create an XML file? Is this possible?
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has title: Using firebase to store data for xml generation
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44912547
has comment: http://stackoverflow.com/comment/44910662
favorite count: 0

http://stackoverflow.com/comment/44881166
comment on: http://stackoverflow.com/a/28261798
score: 0
type: AnswerComment
has text: Strange...when I follow your link to jsFiddle, the code works there (albeit I need to polish it a lot), however when I copy and paste the code into my files (which are just stored locally on my computer), they don't work. Any ideas?
type: Comment

http://stackoverflow.com/q/28127327
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has title: Detect connection issues in iframe
tagged with: http://stackoverflow.com/tag/html
score: 1
has comment: http://stackoverflow.com/comment/44628019
favorite count: 0
type: Question
upvote count: 2
has body: this questions is related to an html file calling out different pages in different iframe tags. Is there a way, using JavaScript probably, to check if there was a connection issue to the page? If so, to try reloading this frame until the connection is established. To be a bit clearer, if you have a look at the following link (http://tvgl.barzalou.com) (even if the content is in French, you will notice how different parts of the page load, and more often than not, loads correctly). But once in a while, during the weekend, a slight connection issue to the net arrives and for some reason, the frame gives out this ridiculous grey / light grey icon saying that there was a connection issue. Of course, when the page is manually reloaded, the frame comes back to life.
tagged with: iframe
answer count: 2
has answer: http://stackoverflow.com/a/28127609
has answer: http://stackoverflow.com/a/28138080
has comment: http://stackoverflow.com/comment/44630850
downvote count: 1
has comment: http://stackoverflow.com/comment/44628009

http://stackoverflow.com/comment/44764065
comment on: http://stackoverflow.com/a/28198471
has text: Well I guess that would work too. Just depends on which you think looks nicer.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44784444
score: 0
type: Comment
type: QuestionComment
has text: Are you using phantomjs only for downloading html content or trying to download it as an image? For generating image check http://phantomjs.org/screen-capture.html
comment on: http://stackoverflow.com/q/28209509

http://stackoverflow.com/a/28242047
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: How about this mess: var firstLegend = d3.select(".c3-legend-item"); var legendCon = d3.select(firstLegend.node().parentNode); var legendY = parseInt(firstLegend.select('text').attr('y')); legendCon .append('text') .text('Legend Title') .attr('y', legendY - 20);
type: Answer
accepted answer of: http://stackoverflow.com/q/28241553
answers question: http://stackoverflow.com/q/28241553

http://stackoverflow.com/comment/44810884
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28223569
type: QuestionComment
has text: Is the problem that the address is not visible or is the problem that the addres is 'undefined'?

http://stackoverflow.com/q/28225642
type: Question
has title: Use an object as a HashMap in JavaScript
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28225705
has body: I am going to use an object as a HashMap in JavaScript. I want to add a key which would be a new property for that object and give it a value. Then, after a while, take that value and do stuff on that. I want to extract all the links. Save the URL of the page as the key and the array of its links as the value. Therefore, I have wrote following lines. let's say the URL of the page is http://www.google.com var test = {}; var links = document.getElementsByTagName('a'); var currentURL = document.URL; test.currentURL = links; Here, my expectation was that I have a key which is http://www.google.com together with its value which is an array contains all the links on the page. After that, I wanted to write following line var inProcessURL = allTheURLs[0].url; var arrayOfLinks = test.inProcessURL; and then work based on this array. But, I found that in the first part, I am creating the key which is 'currentURL' not 'http://www.google.com' which causes me to not be able to refer to it later on. Is there any way based on which I can do my goal in JavaScript or I have to change my data structure from an Object to the Array? I don't know which key I am going to refer to at different step. They would be something extracted from an array.
linked to: http://stackoverflow.com/q/2241875
score: 0
type: AnsweredQuestion
tagged with: object
has answer: http://stackoverflow.com/a/28225705
tagged with: hashmap
has comment: http://stackoverflow.com/comment/44814580

http://stackoverflow.com/q/28271551
has answer: http://stackoverflow.com/a/28972764
tagged with: requirejs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28972764
tagged with: ruby-on-rails
has title: Order of events for a Rails 4 Backbone Require loading
type: Question
tagged with: javascript
score: 4
upvote count: 4
tagged with: ruby-on-rails-4
has body: I have three main files: A) application.js // This resides in rails land at app/assets/javascripts/application.js B) SOF.js // This resides in rails land at app/assets/javascripts/SOF.js C) router.js // This resides in backbone land at app/assets/javascripts/backbone/routers/router.js I am wondering why the declared dependencies in the router.js are occuring without being called in the router itself. Said another way, the order of events are : A gives a console.log from before the normal require.js define() then B's then C's then all C's dependencies that are JUST defined in the function init themselves!!!! then A begins to initialize, where it calls B.initialize() then B begins to initialize where it calls C.initialize() (a)then C begins to initialize, (b)recognize the route, and follow the appropriate router method, finishing its router method calls (even though there aren't any). Then C finishes initing, and passes control back to B Then B finishes initing, and passes control back to A Then A finishes initing, and no more logs.... My understanding is that the App.js(A) should init the SOF.js(B), which inits the router in router.js(C), and THEN the router should recognize the route, and follow the appropriate route, and create any models/collections/views there. Why is it that by just including the files in the define() portion of require.js method declaration that it causes them to load, EVEN before the files themselves init? If I remove the declaration, they won't load, but then of course, I can't reference them to manually initi them in the appropriate route.... Files for your eyes (with above order of events on left): Application.js: 1- console.log('Application.js: Started'); require([ 'SOF' ], function(SOF){ 5- console.log("Application.js: initializing SOF..."); SOF.initialize(App.songs); //App.songs is an object that contains the data from the Rails DB 10- console.log("Application.js: SOF_Application Fully initialized"); }); SOF.js: 2- console.log('SOF.js: S…
downvote count: 0
answer count: 1
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/46158295
has comment: http://stackoverflow.com/comment/46163248

http://stackoverflow.com/comment/44683123
comment on: http://stackoverflow.com/a/28155925
has text: It's not needed in this example because the form is in the DOM before the handler is attached.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28141261
answer count: 1
tagged with: mergesort
tagged with: javascript
has answer: http://stackoverflow.com/a/28141365
tagged with: sorting
favorite count: 0
has comment: http://stackoverflow.com/comment/44654171
tagged with: merge
has body: I'm trying to implement merge sort algorithm in JavaScript. But I'm getting a strange behavior when it comes to merging two sorted arrays. When I pass those two arrays: [1,4, 5] and [3, 6, 7, 10] to the merge function, I always get this result: [ 1, 3, 4, 6, 7 ]. Strangely without the element 5 and 10 ! Here's my function: function merge(a, b) { var result = [], k = 0, i = 0, j = 0; while(a.length &gt; i+1 &amp;&amp; b.length &gt; j+1){ if(a[i] &lt;= b[j]){ result[k++] = a[i++]; } else { result[k++] = b[j++]; } } while(a.length &gt; i+1) { result[k++] = a[i++]; } while(b.length &gt; j+1) { result[k++] = b[j++]; } return result; } Any help would be appreciated. Thanks.
accepted answer: http://stackoverflow.com/a/28141365
upvote count: 1
downvote count: 1
type: AnsweredQuestion
tagged with: algorithm
has title: Implementing merge sort algorithm in JavaScript
type: Question
score: 0

http://stackoverflow.com/q/28207610
has answer: http://stackoverflow.com/a/52853000
has answer: http://stackoverflow.com/a/59245722
has body: I am trying to solve this problem using JS by just using an array. var str = 'abcdefgh'; for (i = 0; i &lt; 255; i++) { arr[i] = false; } function check() { for (i = 0; i &lt; str.length; i++) { if (arr[str.charCodeAt(i)] == true) { return false; } arr[str.charCodeAt(i)] = true; } return true; } I am initializing an array of fixed size 256 to have the boolean value false. Then i am setting the value for the corresponding ASCII index to true for characters in the string. And if i find the same character again, i am returning false. While running the program, i am getting false returned even if the string doesn't have any duplicate characters.
has answer: http://stackoverflow.com/a/66666382
has answer: http://stackoverflow.com/a/28207644
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/64253189
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/55215359
answer count: 12
possible better answer: http://stackoverflow.com/a/37932256
downvote count: 0
has answer: http://stackoverflow.com/a/28207675
accepted answer: http://stackoverflow.com/a/28207675
has answer: http://stackoverflow.com/a/69568338
type: Question
has answer: http://stackoverflow.com/a/37932256
has answer: http://stackoverflow.com/a/28207760
tagged with: javascript
has answer: http://stackoverflow.com/a/68986119
has comment: http://stackoverflow.com/comment/44780442
has title: Checking if the characters in a string are all unique
score: 9
has answer: http://stackoverflow.com/a/51632877

http://stackoverflow.com/q/28157437
type: AnsweredQuestion
has title: Creating a series of timed form submissions
accepted answer: http://stackoverflow.com/a/28158054
type: Question
has comment: http://stackoverflow.com/comment/44687050
tagged with: forms
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/3089475
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28158054
has body: I am interested in designing a timed quiz questions which submit themselves after 30 seconds or so. Following this other SO request I have coded the following: &lt;script&gt; var counter = 30; var interval = setInterval(function() { counter--; // Display 'counter' wherever you want to display it. document.getElementById("counter").innerHTML = "Timer:"+counter if (counter == 0) { // Submit form test.submit('timeout'); } }, 1000); &lt;/script&gt; &lt;p id="counter"&gt;&lt;/p&gt; This seems to work on most modern browsers. There is a problem however that this seems to work fine for the first question or form. I think the second form defines an additional function which causes the countdown to go twice as fast. Then the third, three times as fast, etc. Is there a way to ensure that this function is only defined once? Thanks for any help you can provide. I am new to javascript so I apologize in advance if I have used the wrong terminology.

http://stackoverflow.com/a/28230669
has body: You can't reference another object node in an object literal from within the same object literal, but you can do it from outside the literal. For example, you could do this: var obj = { Inköp: { name: 'Inköp', key: 73, menu: { Kvitto: { key: 75, name: 'med kvitto', }, Faktura: { key: 70, name: 'på faktura', } } } }; obj.def = obj.Inköp.menu.Kvitto; You could also set def to a string value, "Kvitto", which you could then access from outside the literal like this: obj.Inköp.menu[obj.Inköp.def]; It depends on if you want succinctness in declaring your literal or in using it.
score: 0
answers question: http://stackoverflow.com/q/28230634
type: Answer

angularjs-directive
tags question: http://stackoverflow.com/q/28218800
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/28230080
tags question: http://stackoverflow.com/q/28133663
tags question: http://stackoverflow.com/q/28132074
tags question: http://stackoverflow.com/q/28175575
tags question: http://stackoverflow.com/q/28244473
tags question: http://stackoverflow.com/q/28188929
tags question: http://stackoverflow.com/q/28214322
tags question: http://stackoverflow.com/q/28182998
tags question: http://stackoverflow.com/q/28130068
tags question: http://stackoverflow.com/q/28158014
tags question: http://stackoverflow.com/q/28208721
tags question: http://stackoverflow.com/q/28232737
tags question: http://stackoverflow.com/q/28166863
tags question: http://stackoverflow.com/q/28221566
tags question: http://stackoverflow.com/q/28162804
tags question: http://stackoverflow.com/q/28188367
tags question: http://stackoverflow.com/q/28159446
tags question: http://stackoverflow.com/q/28269136
tags question: http://stackoverflow.com/q/28159624
tags question: http://stackoverflow.com/q/28132674
tags question: http://stackoverflow.com/q/28207284
tags question: http://stackoverflow.com/q/28207826
tags question: http://stackoverflow.com/q/28225690
tags question: http://stackoverflow.com/q/28132939
tags question: http://stackoverflow.com/q/28265288
tags question: http://stackoverflow.com/q/28241222
tags question: http://stackoverflow.com/q/28238755
tags question: http://stackoverflow.com/q/28237663
tags question: http://stackoverflow.com/q/28209667
tags question: http://stackoverflow.com/q/28148336
tags question: http://stackoverflow.com/q/28129243
tags question: http://stackoverflow.com/q/28219102
tags question: http://stackoverflow.com/q/28252545
tags question: http://stackoverflow.com/q/28183651
tags question: http://stackoverflow.com/q/28232185
tags question: http://stackoverflow.com/q/28132029
tags question: http://stackoverflow.com/q/28210753
tags question: http://stackoverflow.com/q/28137911
type: Tag
tags question: http://stackoverflow.com/q/28175160
tags question: http://stackoverflow.com/q/28234496
tags question: http://stackoverflow.com/q/28165229
tags question: http://stackoverflow.com/q/28236891
tags question: http://stackoverflow.com/q/28139088
tags question: http://stackoverflow.com/q/28211842
tags question: http://stackoverflow.com/q/28154322
tags question: http://stackoverflow.com/q/28214948
tags question: http://stackoverflow.com/q/28192210
tags question: http://stackoverflow.com/q/28167445
tags question: http://stackoverflow.com/q/28171937
tags question: http://stackoverflow.com/q/28226769
tags question: http://stackoverflow.com/q/28144648
tags question: http://stackoverflow.com/q/28250841
tags question: http://stackoverflow.com/q/28140817

http://stackoverflow.com/comment/44902739
comment on: http://stackoverflow.com/q/28273819
has text: @BhojendraNepal No need to move the script, just spell innerHTML correctly
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28150095
has body: I have the following select2: &lt;select id="e1" multiple style="width: 250px;" name="attributes[]"&gt; &lt;?php if(isset($vars['attributes'])):?&gt; &lt;?php foreach($vars['attributes'] as $attribute):?&gt; &lt;option value="&lt;?php echo $attribute['id'];?&gt;"&gt;&lt;?php echo $attribute['name'];?&gt;&lt;/option&gt; &lt;?php endforeach;?&gt; &lt;?php endif;?&gt; &lt;/select&gt; Now i load some of the data via. Ajax: which lists the following array: Now i wish to add these 3 as selected values to my select2. How do i do that? update HEre is my code so far: var _lst = document.getElementById('e1'); var optCount = _lst.options.length; for (var i=0 ; i&lt;data['attributes'].length; i++){ var opt = new Option(data['attributes'][i]['name'],data['attributes'][i]['id']); _lst.options[optCount+i] = opt; }
has answer: http://stackoverflow.com/a/28150232
type: AnsweredQuestion
tagged with: select
type: Question
has title: select2 set multiple selected values
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28150232
score: 0
answer count: 1
tagged with: jquery-select2

http://stackoverflow.com/comment/44634068
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28130650
has text: Open the site in firefox to see what it should do. It's supposed to scroll the sidebar, depending on how big the window size, sidebar size, content size, etc. If any errors would be thrown I wouldn't be asking this question here, I guess. Thanks for the pointer, I checked the chrome console, nothing.
score: 0

http://stackoverflow.com/comment/70743173
comment on: http://stackoverflow.com/q/28153192
has text: Possible duplicate of [Filter on ng-repeat with ng-model value](http://stackoverflow.com/questions/33996751/filter-on-ng-repeat-with-ng-model-value)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44791593
comment on: http://stackoverflow.com/q/28213683
score: 0
type: QuestionComment
type: Comment
has text: What do you want to do on focusout? If we know that we could propose an alternative since this way it won't work.

http://stackoverflow.com/q/28221167
has comment: http://stackoverflow.com/comment/44805826
accepted answer: http://stackoverflow.com/a/28223203
has body: I am trying to replicate this effect: http://atopos.gr/not-a-toy/ (try moving around the mouse), but I have no clue how they achieved it? I have tried to play around with a JSfiddle here: http://jsfiddle.net/1tz5b6r0/, but it does not work. The function: function animate() { requestAnimationFrame(animate); update(); } Runs requestAnimationFrame but that does not seem to occur anywhere in their code. I can't figure out what they did to create this effect What am I missing?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44805610
has title: Blurred & transparent circle background effect on mouse move
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28223203
score: 1
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28138421
answers question: http://stackoverflow.com/q/28138310
score: 1
upvote count: 1
downvote count: 0
type: AcceptedAnswer
has body: You can just remove one item from list, deletePerson: function(event) { event.preventDefault(); if (confirm("Are you sure to delete the person?")) { this.model.destroy({ success: function() { $(event.currentTarget).closest('tr').remove(); } }); } return false; }
type: Answer
accepted answer of: http://stackoverflow.com/q/28138310

http://stackoverflow.com/comment/44691046
type: Comment
comment on: http://stackoverflow.com/a/28159807
has text: Haha, well that coming from A.B I have to buy it, thanks
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44684705
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28156555
has text: @mattytommo it actually works! thanks for the suggestion! I was focusing on making custom event, did not think about this before.
score: 0

http://stackoverflow.com/q/28267604
has comment: http://stackoverflow.com/comment/51522825
tagged with: dc.js
type: Question
tagged with: crossfilter
has comment: http://stackoverflow.com/comment/54088490
has comment: http://stackoverflow.com/comment/54064416
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How to make interactive leaflet clustered map with dc js and crossfilter?
has body: I would like to know a way to bind the leaflet clustering visualization with dc js charts. I have a code below which is very incomplete in which I found a way to group the data using crossfilter js. I can make a pie chart using dc js with grouping. But to bind it with leaflet I don't have a definite approach. I looked into https://github.com/yurukov/dc.leaflet.js However I have a realtime visualization which uses a set interval method to get the data at periodic intervals of time. Hence dc.leaflet.js wont work in this case because each time a new layer is added. My code so far is given below. Can someone share some light on how to do this? Leaflet Markercluster
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
upvote count: 1
tagged with: leaflet
score: 1
has comment: http://stackoverflow.com/comment/50437888

http://stackoverflow.com/q/28147040
type: Question
has comment: http://stackoverflow.com/comment/44665959
has comment: http://stackoverflow.com/comment/44665722
has body: I have a JavaScript function which resizes automatically a div when the window gets resized that looks like this: window.onresize = function(){container.style.height = document.body.clientHeight - 300} The problem is that when the window gets resized to a very small size (so that document.body.clientHeight is less than 300), it shows an error message. Is there a way to keep this error message from appearing (like On Error Resume Next in VBScript) or of blocking a resizing to very small sizes (see here)?
has answer: http://stackoverflow.com/a/34978566
has comment: http://stackoverflow.com/comment/44665892
has title: Block error message HTA with javascript
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/12219154
has comment: http://stackoverflow.com/comment/44665696
tagged with: hta
has comment: http://stackoverflow.com/comment/44665721
accepted answer: http://stackoverflow.com/a/34978566
linked to: http://stackoverflow.com/q/28114310
type: AnsweredQuestion
tagged with: javascript